Skip to content

Commit 08a1f61

Browse files
authored
Merge pull request #17 from mutablelogic/dev2
Switched to web components workflow
2 parents d10fa51 + aaa2187 commit 08a1f61

File tree

107 files changed

+8071
-420
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+8071
-420
lines changed

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,12 @@
11
# js-framework
22

3+
To install packages,
4+
5+
```bash
6+
npm install
7+
```
8+
9+
Development mode,
10+
11+
```bash
12+
npm run dev

chat/.npmrc

-1
This file was deleted.

chat/package.json

-11
This file was deleted.

config/esbuild.config.mjs

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import esbuild from 'esbuild';
2+
3+
const commonOptions = {
4+
entryPoints: ['example/index.js'],
5+
outdir: 'dist',
6+
format: 'esm',
7+
bundle: true,
8+
loader: {
9+
'.svg': 'file',
10+
'.woff': 'file',
11+
'.woff2': 'file',
12+
'.ttf': 'file',
13+
'.otf': 'file',
14+
'.html': 'copy',
15+
'.json': 'copy',
16+
}
17+
};
18+
19+
if (process.env.NODE_ENV === 'production') {
20+
await esbuild.build({
21+
...commonOptions,
22+
minify: true,
23+
sourcemap: false,
24+
define: {
25+
'process.env.NODE_ENV': '"production"',
26+
},
27+
}).catch(() => process.exit(1));
28+
} else {
29+
commonOptions.entryPoints.push('example/index.html', 'example/data.json');
30+
let ctx = await esbuild.context({
31+
...commonOptions,
32+
minify: false,
33+
sourcemap: true,
34+
define: {
35+
'process.env.NODE_ENV': '"development"',
36+
},
37+
})
38+
39+
let { host, port } = await ctx.serve({
40+
servedir: commonOptions.outdir,
41+
});
42+
console.log(`Serving on http://${host}:${port}`);
43+
44+
await ctx.watch();
45+
console.log('watching');
46+
}

config/eslint.config.mjs

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@ export default [
1616
{
1717
languageOptions: {
1818
globals: globals.browser,
19-
ecmaVersion: 'latest',
19+
ecmaVersion: 13,
2020
sourceType: 'module',
2121
},
2222
},
2323
...compat.extends('airbnb-base'),
2424
{
2525
rules: {
2626
'import/prefer-default-export': 'off',
27+
'import/no-default-export': 'error'
2728
},
2829
}
2930
];

0 commit comments

Comments
 (0)