2021-02-21 10:11:46 +01:00

17 lines
394 B
JavaScript

const { build } = require("esbuild"),
{ copyFile } = require("fs");
const production = process.env.NODE_ENV === "production",
formats = ["cjs", "esm"];
(async () => {
for (const format of formats) {
await build({
entryPoints: ["./src/index.ts"],
watch: !production,
format,
outfile: `./dist/index${format === "cjs" ? "" : "." + format}.js`
});
}
})();