-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.mjs
More file actions
34 lines (34 loc) · 933 Bytes
/
build.mjs
File metadata and controls
34 lines (34 loc) · 933 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import {write, list, remove} from 'components/fs';
import notFound from 'containers/404.html';
import app from 'containers/app.js';
import staticjs from 'containers/static';
import serviceWorker from 'containers/sw.js';
import router from 'containers/router.js';
(async () => {
const sources = [
// List that prevents deleting source files
'.git',
'components',
'node_modules',
'src',
'static',
'.gitignore',
'build.mjs',
'package.json',
'yarn.lock',
'_README.md',
];
// Cleaning first
var flist = [];
(await list('.')).forEach(file => {
if (sources.indexOf(file) == -1) flist.push(remove(file));
});
await Promise.all(flist); // wait until all the files have been removed
await Promise.all([
notFound(),
app(),
//serviceWorker(),
staticjs(),
router(),
])
})()