-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.js
More file actions
25 lines (23 loc) · 742 Bytes
/
build.js
File metadata and controls
25 lines (23 loc) · 742 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
const esbuild = require("esbuild");
const bundles = {
"article.js": ["archives/static/scripts/article.js"],
"editor.js": ["archives/static/scripts/editor.js"],
"article.css": ["archives/static/styles/bundle/article.css"],
"default.css": ["archives/static/styles/bundle/default.css"],
"admin.js": ["archives/static/scripts/admin.js"]
}
for (const bundle of Object.keys(bundles)) {
esbuild.build({
entryPoints: bundles[bundle],
outfile: `archives/static/build/${bundle}`,
bundle: true,
minify: true,
keepNames: false,
sourcemap: false,
loader: {
'.ttf': 'dataurl',
'.woff': 'dataurl',
'.woff2': 'dataurl'
},
});
}