ionian/src/client/build.ts
2023-06-01 14:18:53 +09:00

32 lines
859 B
TypeScript

import esbuild from "esbuild";
async function main() {
try {
const result = await esbuild.build({
entryPoints: ["app.tsx"],
bundle: true,
outfile: "../../dist/bundle.js",
platform: "browser",
sourcemap: true,
minify: true,
target: ["chrome100", "firefox100"],
watch: {
onRebuild: async (err, _result) => {
if (err) {
console.error("watch build failed: ", err);
} else {
console.log("watch build success");
}
},
},
});
console.log("watching...");
return result;
} catch (error) {
console.error(error);
process.exit(1);
}
}
main().then((res) => {
});