-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.js
More file actions
33 lines (31 loc) · 822 Bytes
/
build.js
File metadata and controls
33 lines (31 loc) · 822 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
(async () => {
const isPrepare = process.env.NODE_ENV === "prepare";
if (isPrepare) {
console.log("Finished! 🚀 You can run `yarn start`");
process.exit(0);
}
const isDev = process.env.NODE_ENV === "development";
require("fs-extra").copySync("public", "build");
require("esbuild")
.build({
entryPoints: ["src/index.js"],
outdir: "build",
minify: true,
watch: isDev,
sourcemap: false,
bundle: true,
define: { "process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV) },
// logLevel: "silent",
})
.catch(() => process.exit(1));
if (isDev) {
require("live-server").start({
root: "build",
open: true,
host: "localhost",
port: 8081,
// logLevel: 0,
});
console.log("Let's Crow! 🦅");
}
})();