build: basic esbuild setup
This commit is contained in:
parent
3f5d49190f
commit
fe0816d037
6 changed files with 289 additions and 0 deletions
purescript/factorio-throughput
22
purescript/factorio-throughput/build.js
Normal file
22
purescript/factorio-throughput/build.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
const esbuild = require("esbuild");
|
||||
const PurescriptPlugin = require("esbuild-plugin-purescript");
|
||||
const path = require("path");
|
||||
|
||||
const isProd = process.env.NODE_ENV === "production";
|
||||
|
||||
esbuild
|
||||
.build({
|
||||
entryPoints: ["src/index.js"],
|
||||
bundle: true,
|
||||
outdir: "dist",
|
||||
watch: !isProd,
|
||||
plugins: [
|
||||
PurescriptPlugin({
|
||||
output: isProd ? path.resolve(__dirname, "dce-output") : undefined,
|
||||
}),
|
||||
],
|
||||
define: {
|
||||
global: "window",
|
||||
},
|
||||
})
|
||||
.catch((_e) => process.exit(1));
|
Loading…
Add table
Add a link
Reference in a new issue