-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbundle.js
More file actions
33 lines (26 loc) · 732 Bytes
/
Copy pathbundle.js
File metadata and controls
33 lines (26 loc) · 732 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
// Import Node.js Dependencies
const repl = require("repl");
const path = require("path");
const fs = require("fs");
// Import Third-party Dependencies
const esbuild = require("esbuild");
// CONSTANTS
const kAssetsDir = path.join(__dirname, "assets");
const kOutDir = path.join(__dirname, "out");
fs.mkdirSync(kOutDir, { recursive: true });
async function main() {
await esbuild.build({
entryPoints: [
path.join(kAssetsDir, "scripts", "index.js")
],
loader: {
".jpg": "file",
".png": "file"
},
platform: "node",
bundle: true,
outdir: kOutDir
});
fs.copyFileSync(path.join(__dirname, "editor.html"), path.join(kOutDir, "index.html"));
}
main().catch(() => process.exit(1));