bunup 0.15.8 → 0.15.10
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/cli/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
build,
|
|
5
5
|
processLoadedConfigs,
|
|
6
6
|
resolveBuildOptions
|
|
7
|
-
} from "../shared/bunup-
|
|
7
|
+
} from "../shared/bunup-mzcgpyzk.js";
|
|
8
8
|
import {
|
|
9
9
|
BunupBuildError,
|
|
10
10
|
BunupCLIError,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
import { loadConfig } from "coffi";
|
|
28
28
|
import pc4 from "picocolors";
|
|
29
29
|
// packages/bunup/package.json
|
|
30
|
-
var version = "0.15.
|
|
30
|
+
var version = "0.15.10";
|
|
31
31
|
|
|
32
32
|
// packages/bunup/src/printer/print-build-report.ts
|
|
33
33
|
import { promisify } from "util";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BuildContext, BuildMeta, BuildOptions, BuildOutputFile, BuildResult, BunupPlugin, DefineConfigItem, DefineWorkspaceItem, WithOptional, WithRequired } from "./shared/bunup-
|
|
1
|
+
import { BuildContext, BuildMeta, BuildOptions, BuildOutputFile, BuildResult, BunupPlugin, DefineConfigItem, DefineWorkspaceItem, WithOptional, WithRequired } from "./shared/bunup-8hm7nmkc";
|
|
2
2
|
declare function build(userOptions: Partial<BuildOptions>, rootDir?: string): Promise<BuildResult>;
|
|
3
3
|
declare function defineConfig(options: DefineConfigItem | WithRequired<DefineConfigItem, "name">[]): DefineConfigItem | WithRequired<DefineConfigItem, "name">[];
|
|
4
4
|
declare function defineWorkspace(options: WithOptional<DefineWorkspaceItem, "config">[], sharedOptions?: Partial<DefineConfigItem>): DefineWorkspaceItem[];
|
package/dist/index.js
CHANGED
package/dist/plugins.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Arrayable, BuildOptions, BunupPlugin, BunupPluginHooks, exports, injectStyles, unused } from "./shared/bunup-
|
|
1
|
+
import { Arrayable, BuildOptions, BunupPlugin, BunupPluginHooks, exports, injectStyles, unused } from "./shared/bunup-8hm7nmkc";
|
|
2
2
|
type CopyOptions = {
|
|
3
3
|
/** Whether to follow symbolic links when copying files. */
|
|
4
4
|
followSymlinks?: boolean;
|
|
@@ -280,33 +280,6 @@ function resolvePlugins(options, packageJsonData) {
|
|
|
280
280
|
plugins.push(externalOptionPlugin(options, packageJsonData));
|
|
281
281
|
return plugins;
|
|
282
282
|
}
|
|
283
|
-
function getResolvedCompile(entry, compile, format) {
|
|
284
|
-
if (compile) {
|
|
285
|
-
let resolvedEntry;
|
|
286
|
-
const compileObj = typeof compile === "object" ? compile : {};
|
|
287
|
-
const target = typeof compile === "string" ? compile : compileObj.target;
|
|
288
|
-
if (entry.length > 1) {
|
|
289
|
-
throw new BunupBuildError("Can only compile one entrypoint at a time. If you want to compile multiple entries, use build config array. Check https://bunup.dev/docs/advanced/compile#multiple-entries for more information.");
|
|
290
|
-
} else {
|
|
291
|
-
resolvedEntry = entry[0];
|
|
292
|
-
}
|
|
293
|
-
const { name: entryName } = path2.parse(resolvedEntry);
|
|
294
|
-
const parentDirName = path2.basename(path2.dirname(resolvedEntry));
|
|
295
|
-
const execName = compileObj.outfile ?? (entryName === "index" && parentDirName !== "src" ? parentDirName : entryName);
|
|
296
|
-
const name = [execName];
|
|
297
|
-
if (format !== "esm") {
|
|
298
|
-
name.push(`-${format}`);
|
|
299
|
-
}
|
|
300
|
-
if (target) {
|
|
301
|
-
name.push(`-${target.replace("bun-", "")}`);
|
|
302
|
-
}
|
|
303
|
-
return {
|
|
304
|
-
...compileObj,
|
|
305
|
-
outfile: name.join("")
|
|
306
|
-
};
|
|
307
|
-
}
|
|
308
|
-
return;
|
|
309
|
-
}
|
|
310
283
|
function getResolvedMinify(options) {
|
|
311
284
|
const { minify, minifyWhitespace, minifyIdentifiers, minifySyntax } = options;
|
|
312
285
|
const defaultValue = minify === true;
|
|
@@ -339,6 +312,27 @@ function getResolvedDefine(define, env) {
|
|
|
339
312
|
function getDefaultChunkNaming(name) {
|
|
340
313
|
return `shared/${name ?? "chunk"}-[hash].[ext]`;
|
|
341
314
|
}
|
|
315
|
+
function getCompileNaming(entry, compile, format) {
|
|
316
|
+
let resolvedEntry;
|
|
317
|
+
const compileObj = typeof compile === "object" ? compile : {};
|
|
318
|
+
const target = typeof compile === "string" ? compile : compileObj.target;
|
|
319
|
+
if (entry.length > 1) {
|
|
320
|
+
throw new BunupBuildError("Can only compile one entrypoint at a time. If you want to compile multiple entries, use build config array. Check https://bunup.dev/docs/advanced/compile#multiple-entrypoints for more information.");
|
|
321
|
+
} else {
|
|
322
|
+
resolvedEntry = entry[0];
|
|
323
|
+
}
|
|
324
|
+
const { name: entryName } = path2.parse(resolvedEntry);
|
|
325
|
+
const parentDirName = path2.basename(path2.dirname(resolvedEntry));
|
|
326
|
+
const execName = compileObj.outfile ?? (entryName === "index" && parentDirName !== "src" ? parentDirName : entryName);
|
|
327
|
+
const name = [execName];
|
|
328
|
+
if (format !== "esm") {
|
|
329
|
+
name.push(`-${format}`);
|
|
330
|
+
}
|
|
331
|
+
if (target) {
|
|
332
|
+
name.push(`-${target.replace("bun-", "")}`);
|
|
333
|
+
}
|
|
334
|
+
return `[dir]/${name.join("")}-[hash].[ext]`;
|
|
335
|
+
}
|
|
342
336
|
function getResolvedSplitting(splitting, format) {
|
|
343
337
|
return splitting === undefined ? format === "esm" : splitting;
|
|
344
338
|
}
|
|
@@ -482,7 +476,8 @@ async function build(userOptions, rootDir = process.cwd()) {
|
|
|
482
476
|
loader: options.loader,
|
|
483
477
|
drop: options.drop,
|
|
484
478
|
naming: {
|
|
485
|
-
chunk: chunkNaming
|
|
479
|
+
chunk: chunkNaming,
|
|
480
|
+
entry: options.compile ? getCompileNaming(entryArray, options.compile, fmt) : undefined
|
|
486
481
|
},
|
|
487
482
|
conditions: options.conditions,
|
|
488
483
|
banner: options.banner,
|
|
@@ -493,7 +488,7 @@ async function build(userOptions, rootDir = process.cwd()) {
|
|
|
493
488
|
ignoreDCEAnnotations: options.ignoreDCEAnnotations,
|
|
494
489
|
emitDCEAnnotations: options.emitDCEAnnotations,
|
|
495
490
|
jsx: options.jsx,
|
|
496
|
-
compile:
|
|
491
|
+
compile: options.compile,
|
|
497
492
|
outdir: options.compile ? options.outDir : undefined,
|
|
498
493
|
throw: false,
|
|
499
494
|
plugins: bunPlugins,
|
package/package.json
CHANGED
|
File without changes
|