1
Fork 0
solar-conflux/purescript/purebird/build.js

36 lines
833 B
JavaScript
Raw Normal View History

2023-10-29 02:11:28 +02:00
const esbuild = require("esbuild");
const PurescriptPlugin = require("esbuild-plugin-purescript");
const alias = require("esbuild-plugin-alias");
const { sassPlugin } = require("esbuild-sass-plugin");
const production = process.env.NODE_ENV === "production";
// const preactCompat = require.resolve("preact/compat");
esbuild
.build({
entryPoints: ["src/index.ts"],
bundle: true,
minify: production,
outdir: "dist",
watch: true,
plugins: [
PurescriptPlugin(),
sassPlugin(),
alias({
//react: preactCompat,
//"react-dom": preactCompat,
}),
],
sourcemap: "both",
jsxFactory: "h",
jsxFragment: "Fragment",
// inject: ["./src/preact-shim.ts"],
loader: {
".svg": "file",
".png": "file",
},
})
.catch((_e) => process.exit(1));