pluribuild 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/run.mjs +9 -6
- package/package.json +1 -1
- package/src/build.ts +1 -3
- package/src/run.ts +6 -2
package/dist/index.cjs
CHANGED
|
@@ -69,7 +69,7 @@ async function build({ entryPoints, dev, dir, ...options } = {}) {
|
|
|
69
69
|
...options
|
|
70
70
|
};
|
|
71
71
|
if (dev) await (await esbuild.default.context(buildOptions)).watch();
|
|
72
|
-
await esbuild.default.build(buildOptions);
|
|
72
|
+
else await esbuild.default.build(buildOptions);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
exports.build = build;
|
package/dist/index.mjs
CHANGED
|
@@ -45,7 +45,7 @@ async function build({ entryPoints, dev, dir, ...options } = {}) {
|
|
|
45
45
|
...options
|
|
46
46
|
};
|
|
47
47
|
if (dev) await (await esbuild.context(buildOptions)).watch();
|
|
48
|
-
await esbuild.build(buildOptions);
|
|
48
|
+
else await esbuild.build(buildOptions);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
export { build, getDefaultEntryPoints, toEntryPoint };
|
package/dist/run.mjs
CHANGED
|
@@ -269,7 +269,7 @@ function getDefaultEntryPoints(dir = "entries") {
|
|
|
269
269
|
// src/build.ts
|
|
270
270
|
async function build({
|
|
271
271
|
entryPoints,
|
|
272
|
-
dev,
|
|
272
|
+
dev: dev2,
|
|
273
273
|
dir,
|
|
274
274
|
...options2
|
|
275
275
|
} = {}) {
|
|
@@ -294,17 +294,17 @@ async function build({
|
|
|
294
294
|
minify: true,
|
|
295
295
|
...options2
|
|
296
296
|
};
|
|
297
|
-
if (
|
|
297
|
+
if (dev2) {
|
|
298
298
|
let ctx = await esbuild.context(buildOptions);
|
|
299
299
|
await ctx.watch();
|
|
300
|
-
}
|
|
301
|
-
await esbuild.build(buildOptions);
|
|
300
|
+
} else await esbuild.build(buildOptions);
|
|
302
301
|
}
|
|
303
302
|
|
|
304
303
|
// src/run.ts
|
|
305
304
|
var args = new import_args_json.Args();
|
|
305
|
+
var dev = args.hasKey("--dev");
|
|
306
306
|
var options = {
|
|
307
|
-
dev
|
|
307
|
+
dev,
|
|
308
308
|
minify: !args.isExplicitlyOff("--minify")
|
|
309
309
|
};
|
|
310
310
|
var rawArgs = process.argv.slice(2);
|
|
@@ -312,4 +312,7 @@ if (rawArgs.length !== 0 && !(0, import_args_json.isKey)(rawArgs[0])) options.di
|
|
|
312
312
|
for (let [k, v] of Object.entries(options)) {
|
|
313
313
|
if (v === void 0) delete options[k];
|
|
314
314
|
}
|
|
315
|
-
build(options)
|
|
315
|
+
build(options).then(() => {
|
|
316
|
+
if (dev) console.log("Initial build complete");
|
|
317
|
+
else console.log("Build complete");
|
|
318
|
+
});
|
package/package.json
CHANGED
package/src/build.ts
CHANGED
package/src/run.ts
CHANGED
|
@@ -4,9 +4,10 @@ import type { BuildOptions } from "./BuildOptions.ts";
|
|
|
4
4
|
import { build } from "./build.ts";
|
|
5
5
|
|
|
6
6
|
let args = new Args();
|
|
7
|
+
let dev = args.hasKey("--dev");
|
|
7
8
|
|
|
8
9
|
let options: BuildOptions = {
|
|
9
|
-
dev
|
|
10
|
+
dev,
|
|
10
11
|
minify: !args.isExplicitlyOff("--minify"),
|
|
11
12
|
};
|
|
12
13
|
|
|
@@ -17,4 +18,7 @@ for (let [k, v] of Object.entries(options)) {
|
|
|
17
18
|
if (v === undefined) delete options[k as keyof BuildOptions];
|
|
18
19
|
}
|
|
19
20
|
|
|
20
|
-
build(options)
|
|
21
|
+
build(options).then(() => {
|
|
22
|
+
if (dev) console.log("Initial build complete");
|
|
23
|
+
else console.log("Build complete");
|
|
24
|
+
});
|