Files
dsh-long-skin/scripts/build-client.mjs
2026-10-03 16:43:51 +08:00

29 lines
641 B
JavaScript

import { build } from "esbuild";
const id = "dsh-client-liang-intensity-skin";
await build({
entryPoints: ["src/client/index.tsx"],
outfile: "lib/client.js",
bundle: true,
format: "cjs",
platform: "browser",
target: "es2022",
jsx: "automatic",
sourcemap: true,
loader: { ".css": "text" },
external: [
"react",
"react/jsx-runtime",
],
define: {
"process.env.NODE_ENV": '"production"',
},
banner: {
js: `window.__ModuleLoader__.load({id:${JSON.stringify(id)},factory:(require)=>{var module={exports:{}};var exports=module.exports;`,
},
footer: {
js: "return module.exports;}});",
},
});