mirror of
https://github.com/avinal/sciezka.git
synced 2026-07-03 23:30:09 +05:30
26 lines
490 B
JavaScript
26 lines
490 B
JavaScript
|
|
import * as esbuild from "esbuild";
|
||
|
|
|
||
|
|
const watch = process.argv.includes("--watch");
|
||
|
|
|
||
|
|
const options = {
|
||
|
|
entryPoints: [
|
||
|
|
"src/background.ts",
|
||
|
|
"src/content.ts",
|
||
|
|
"src/sciezka.ts",
|
||
|
|
],
|
||
|
|
bundle: true,
|
||
|
|
outdir: "dist",
|
||
|
|
format: "iife",
|
||
|
|
target: "es2020",
|
||
|
|
sourcemap: watch,
|
||
|
|
};
|
||
|
|
|
||
|
|
if (watch) {
|
||
|
|
const ctx = await esbuild.context(options);
|
||
|
|
await ctx.watch();
|
||
|
|
console.log("Watching for changes...");
|
||
|
|
} else {
|
||
|
|
await esbuild.build(options);
|
||
|
|
console.log("Build complete.");
|
||
|
|
}
|