Skip to content

Commit cd71cdb

Browse files
committed
Update esbuild.js
1 parent 5611979 commit cd71cdb

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

esbuild.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import pkg from "./package.json" with { type: "json" };
22
import esbuild from "esbuild";
33

4+
const watch = process.argv.includes("-w");
45
const date = new Date();
56
const banner = `/**
67
* ${pkg.name} v${pkg.version} build ${date.toDateString()}
@@ -22,14 +23,14 @@ const lib = {
2223
const demo = {
2324
entryPoints: ["./demo/src/index.ts"],
2425
outdir: "./public/demo",
25-
minify: process.argv.includes("-m"),
2626
logLevel: "info",
2727
format: "iife",
2828
target: "es6",
29+
minify: !watch,
2930
bundle: true
3031
};
3132

32-
if(process.argv.includes("-w")) {
33+
if(watch) {
3334

3435
const ctxDemo = await esbuild.context(demo);
3536
await ctxDemo.watch();

0 commit comments

Comments
 (0)