You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
424 B
JavaScript

const { build } = require("esbuild");
const glob = require("tiny-glob");
const watch = process.argv.at(-1) === "--watch";
(async () => {
let entryPoints = Object.fromEntries(
(await glob("./src/**/*.ts")).map((e) => [
e.replace(/\.ts$/, ""),
e,
])
);
build({
entryPoints,
sourcemap: true,
outdir: "./dist",
logLevel: "info",
platform: "node",
watch,
target: "node16",
format: "cjs",
});
})();