parent
36d55283d2
commit
3e8421d8b7
11 changed files with 55 additions and 54 deletions
29
website/assets/esbuild.config.js
Normal file
29
website/assets/esbuild.config.js
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
const esbuild = require("esbuild");
|
||||
|
||||
let minify = false;
|
||||
let sourcemap = true;
|
||||
let watch_fs = true;
|
||||
|
||||
if (process.env.NODE_ENV === "production") {
|
||||
minify = true;
|
||||
sourcemap = false;
|
||||
watch_fs = false;
|
||||
}
|
||||
|
||||
const watch = watch_fs && {
|
||||
onRebuild(error) {
|
||||
if (error) console.error("[watch] build failed", error);
|
||||
else console.log("[watch] build finished");
|
||||
},
|
||||
};
|
||||
console.log(watch);
|
||||
|
||||
esbuild.build({
|
||||
entryPoints: ["./js/app.js"],
|
||||
outfile: "../source/build/app.js",
|
||||
bundle: true,
|
||||
minify: minify,
|
||||
sourcemap: sourcemap,
|
||||
watch: watch,
|
||||
plugins: [],
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue