@rolldown/browser 1.0.0-beta.24 → 1.0.0-beta.25
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.cjs +5 -5
- package/dist/cli.mjs +5 -5
- package/dist/config.cjs +3 -3
- package/dist/config.d.cts +2 -2
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +3 -3
- package/dist/experimental-index.browser.mjs +1 -1
- package/dist/experimental-index.cjs +2 -2
- package/dist/experimental-index.d.cts +2 -4
- package/dist/experimental-index.d.mts +2 -4
- package/dist/experimental-index.mjs +2 -2
- package/dist/experimental-runtime-types.d.ts +2 -0
- package/dist/filter-index.d.cts +2 -2
- package/dist/filter-index.d.mts +2 -2
- package/dist/index.browser.mjs +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/parallel-plugin-worker.cjs +2 -2
- package/dist/parallel-plugin-worker.mjs +2 -2
- package/dist/parallel-plugin.d.cts +2 -2
- package/dist/parallel-plugin.d.mts +2 -2
- package/dist/parse-ast-index.cjs +1 -1
- package/dist/parse-ast-index.d.cts +1 -2
- package/dist/parse-ast-index.d.mts +1 -2
- package/dist/parse-ast-index.mjs +1 -1
- package/dist/rolldown-binding.wasi-browser.js +1 -1
- package/dist/rolldown-binding.wasi.cjs +24 -1
- package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
- package/dist/shared/{binding-DG3bbtXG.d.cts → binding-B9-3a5q4.d.cts} +0 -2
- package/dist/shared/{binding-cECB-Ts3.d.mts → binding-DQYRWAqj.d.mts} +0 -2
- package/dist/shared/{define-config-BnlWQIlM.d.cts → define-config-BtEiHmBk.d.mts} +26 -29
- package/dist/shared/{define-config-Dipre2WB.d.mts → define-config-ZN70csxk.d.cts} +26 -29
- package/dist/shared/{load-config-FXcGLoFh.mjs → load-config-B_r5s5Sw.mjs} +1 -1
- package/dist/shared/{load-config-B-Wrkmqo.cjs → load-config-CbbGAxoK.cjs} +1 -1
- package/dist/shared/{parse-ast-index-B0vXlNs8.cjs → parse-ast-index-80TSV2Ni.cjs} +1 -1
- package/dist/shared/{parse-ast-index-DQEVpsUG.mjs → parse-ast-index-Bo5jcF9A.mjs} +1 -1
- package/dist/shared/{src-DmJCtJ15.mjs → src-DgEwyn6q.mjs} +57 -41
- package/dist/shared/{src-dEUToPiW.cjs → src-Dtgcnc61.cjs} +56 -40
- package/dist/{src-BHNQaKQh.js → src-nDvl0w95.js} +57 -41
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-DDkG_k5U.cjs');
|
|
2
2
|
const require_dist = require('./dist-BVAp8sOm.cjs');
|
|
3
|
-
const require_parse_ast_index = require('./parse-ast-index-
|
|
3
|
+
const require_parse_ast_index = require('./parse-ast-index-80TSV2Ni.cjs');
|
|
4
4
|
const src_rolldown_binding_wasi_cjs = require_chunk.__toESM(require("../rolldown-binding.wasi.cjs"));
|
|
5
5
|
const node_path = require_chunk.__toESM(require("node:path"));
|
|
6
6
|
const node_url = require_chunk.__toESM(require("node:url"));
|
|
@@ -8,7 +8,7 @@ const node_os = require_chunk.__toESM(require("node:os"));
|
|
|
8
8
|
const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
|
|
9
9
|
|
|
10
10
|
//#region package.json
|
|
11
|
-
var version = "1.0.0-beta.
|
|
11
|
+
var version = "1.0.0-beta.25";
|
|
12
12
|
var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
13
13
|
|
|
14
14
|
//#endregion
|
|
@@ -2109,7 +2109,8 @@ const ResolveOptionsSchema = strictObject({
|
|
|
2109
2109
|
mainFiles: optional(array(string())),
|
|
2110
2110
|
modules: optional(array(string())),
|
|
2111
2111
|
symlinks: optional(boolean()),
|
|
2112
|
-
tsconfigFilename: optional(string())
|
|
2112
|
+
tsconfigFilename: optional(string()),
|
|
2113
|
+
yarnPnp: optional(boolean())
|
|
2113
2114
|
});
|
|
2114
2115
|
const TreeshakingOptionsSchema = union([boolean(), looseObject({
|
|
2115
2116
|
annotations: optional(boolean()),
|
|
@@ -2159,7 +2160,8 @@ const InputOptionsSchema = strictObject({
|
|
|
2159
2160
|
literal("none"),
|
|
2160
2161
|
literal("simple"),
|
|
2161
2162
|
literal("full")
|
|
2162
|
-
]))
|
|
2163
|
+
])),
|
|
2164
|
+
chunkModulesOrder: optional(union([literal("module-id"), literal("exec-order")]))
|
|
2163
2165
|
})),
|
|
2164
2166
|
define: pipe(optional(record(string(), string())), description("Define global variables")),
|
|
2165
2167
|
inject: optional(record(string(), union([string(), tuple([string(), string()])]))),
|
|
@@ -2300,7 +2302,8 @@ const OutputOptionsSchema = strictObject({
|
|
|
2300
2302
|
}, () => `The 'true' value is not supported`)),
|
|
2301
2303
|
preserveModules: pipe(optional(boolean()), description("Preserve module structure")),
|
|
2302
2304
|
preserveModulesRoot: pipe(optional(string()), description("Put preserved modules under this path at root level")),
|
|
2303
|
-
virtualDirname: optional(string())
|
|
2305
|
+
virtualDirname: optional(string()),
|
|
2306
|
+
minifyInternalExports: pipe(optional(boolean()), description("Minify internal exports"))
|
|
2304
2307
|
});
|
|
2305
2308
|
const getAddonDescription = (placement, wrapper) => {
|
|
2306
2309
|
return `Code to insert the ${ansis_default.bold(placement)} of the bundled file (${ansis_default.bold(wrapper)} the wrapper function)`;
|
|
@@ -2469,19 +2472,6 @@ function transformModuleInfo(info, option) {
|
|
|
2469
2472
|
};
|
|
2470
2473
|
}
|
|
2471
2474
|
|
|
2472
|
-
//#endregion
|
|
2473
|
-
//#region src/utils/transform-side-effects.ts
|
|
2474
|
-
function bindingifySideEffects(sideEffects) {
|
|
2475
|
-
switch (sideEffects) {
|
|
2476
|
-
case true: return src_rolldown_binding_wasi_cjs.BindingHookSideEffects.True;
|
|
2477
|
-
case false: return src_rolldown_binding_wasi_cjs.BindingHookSideEffects.False;
|
|
2478
|
-
case "no-treeshake": return src_rolldown_binding_wasi_cjs.BindingHookSideEffects.NoTreeshake;
|
|
2479
|
-
case null:
|
|
2480
|
-
case void 0: return void 0;
|
|
2481
|
-
default: throw new Error(`Unexpected side effects: ${sideEffects}`);
|
|
2482
|
-
}
|
|
2483
|
-
}
|
|
2484
|
-
|
|
2485
2475
|
//#endregion
|
|
2486
2476
|
//#region src/utils/transform-sourcemap.ts
|
|
2487
2477
|
function isEmptySourcemapFiled(array$1) {
|
|
@@ -2498,7 +2488,7 @@ function normalizeTransformHookSourcemap(id$1, originalCode, rawMap) {
|
|
|
2498
2488
|
}
|
|
2499
2489
|
|
|
2500
2490
|
//#endregion
|
|
2501
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
2491
|
+
//#region ../../node_modules/.pnpm/remeda@2.24.0/node_modules/remeda/dist/chunk-D6FCK2GA.js
|
|
2502
2492
|
function u$1(o$1, n$1, a$2) {
|
|
2503
2493
|
let t$1 = (r$1) => o$1(r$1, ...n$1);
|
|
2504
2494
|
return a$2 === void 0 ? t$1 : Object.assign(t$1, {
|
|
@@ -2508,7 +2498,7 @@ function u$1(o$1, n$1, a$2) {
|
|
|
2508
2498
|
}
|
|
2509
2499
|
|
|
2510
2500
|
//#endregion
|
|
2511
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
2501
|
+
//#region ../../node_modules/.pnpm/remeda@2.24.0/node_modules/remeda/dist/chunk-WIMGWYZL.js
|
|
2512
2502
|
function u(r$1, n$1, o$1) {
|
|
2513
2503
|
let a$2 = r$1.length - n$1.length;
|
|
2514
2504
|
if (a$2 === 0) return r$1(...n$1);
|
|
@@ -2517,7 +2507,7 @@ function u(r$1, n$1, o$1) {
|
|
|
2517
2507
|
}
|
|
2518
2508
|
|
|
2519
2509
|
//#endregion
|
|
2520
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
2510
|
+
//#region ../../node_modules/.pnpm/remeda@2.24.0/node_modules/remeda/dist/chunk-3IFJP4R5.js
|
|
2521
2511
|
function d(...r$1) {
|
|
2522
2512
|
return u(i, r$1);
|
|
2523
2513
|
}
|
|
@@ -2724,7 +2714,7 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
|
2724
2714
|
});
|
|
2725
2715
|
data.loadModulePromiseMap.set(id$1, promise$1);
|
|
2726
2716
|
try {
|
|
2727
|
-
await context.load(id$1,
|
|
2717
|
+
await context.load(id$1, options.moduleSideEffects ?? void 0);
|
|
2728
2718
|
} catch (e$1) {
|
|
2729
2719
|
data.loadModulePromiseMap.delete(id$1);
|
|
2730
2720
|
data.loadModulePromiseResolveFnMap.delete(id$1);
|
|
@@ -2744,6 +2734,7 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
|
2744
2734
|
}, void 0);
|
|
2745
2735
|
const res = await this.context.resolve(source, importer, {
|
|
2746
2736
|
custom: receipt,
|
|
2737
|
+
isEntry: options?.isEntry,
|
|
2747
2738
|
skipSelf: options?.skipSelf,
|
|
2748
2739
|
vitePluginCustom
|
|
2749
2740
|
});
|
|
@@ -2753,7 +2744,8 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
|
2753
2744
|
return {
|
|
2754
2745
|
...res,
|
|
2755
2746
|
external: res.external === "relative" ? require_dist.unreachable(`The PluginContext resolve result external couldn't be 'relative'`) : res.external,
|
|
2756
|
-
...info
|
|
2747
|
+
...info,
|
|
2748
|
+
moduleSideEffects: info.moduleSideEffects ?? res.moduleSideEffects ?? null
|
|
2757
2749
|
};
|
|
2758
2750
|
}
|
|
2759
2751
|
emitFile = (file) => {
|
|
@@ -2877,7 +2869,7 @@ function bindingifyResolveId(args$1) {
|
|
|
2877
2869
|
id: ret.id,
|
|
2878
2870
|
external: ret.external,
|
|
2879
2871
|
normalizeExternalId: false,
|
|
2880
|
-
|
|
2872
|
+
moduleSideEffects: exist.moduleSideEffects ?? void 0
|
|
2881
2873
|
};
|
|
2882
2874
|
},
|
|
2883
2875
|
meta: bindingifyPluginHookMeta(meta),
|
|
@@ -2901,7 +2893,7 @@ function bindingifyResolveDynamicImport(args$1) {
|
|
|
2901
2893
|
id: ret.id,
|
|
2902
2894
|
external: ret.external
|
|
2903
2895
|
};
|
|
2904
|
-
if (ret.moduleSideEffects !== null) result.
|
|
2896
|
+
if (ret.moduleSideEffects !== null) result.moduleSideEffects = ret.moduleSideEffects;
|
|
2905
2897
|
args$1.pluginContextData.updateModuleOption(ret.id, {
|
|
2906
2898
|
meta: ret.meta || {},
|
|
2907
2899
|
moduleSideEffects: ret.moduleSideEffects || null,
|
|
@@ -2929,7 +2921,7 @@ function bindingifyTransform(args$1) {
|
|
|
2929
2921
|
return {
|
|
2930
2922
|
code: ret.code,
|
|
2931
2923
|
map: bindingifySourcemap$1(normalizeTransformHookSourcemap(id$1, code$1, ret.map)),
|
|
2932
|
-
|
|
2924
|
+
moduleSideEffects: moduleOption.moduleSideEffects ?? void 0,
|
|
2933
2925
|
moduleType: ret.moduleType
|
|
2934
2926
|
};
|
|
2935
2927
|
},
|
|
@@ -2956,7 +2948,7 @@ function bindingifyLoad(args$1) {
|
|
|
2956
2948
|
code: ret.code,
|
|
2957
2949
|
map: bindingifySourcemap$1(map),
|
|
2958
2950
|
moduleType: ret.moduleType,
|
|
2959
|
-
|
|
2951
|
+
moduleSideEffects: moduleOption.moduleSideEffects ?? void 0
|
|
2960
2952
|
};
|
|
2961
2953
|
},
|
|
2962
2954
|
meta: bindingifyPluginHookMeta(meta),
|
|
@@ -3610,7 +3602,7 @@ var ChunkingContextImpl = class {
|
|
|
3610
3602
|
//#endregion
|
|
3611
3603
|
//#region src/utils/bindingify-output-options.ts
|
|
3612
3604
|
function bindingifyOutputOptions(outputOptions) {
|
|
3613
|
-
const { dir, format, exports: exports$1, hashCharacters, sourcemap, sourcemapDebugIds, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, cssEntryFileNames, cssChunkFileNames, banner, footer, intro, outro, esModule, globals, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, preserveModulesRoot, manualChunks } = outputOptions;
|
|
3605
|
+
const { dir, format, exports: exports$1, hashCharacters, sourcemap, sourcemapDebugIds, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, cssEntryFileNames, cssChunkFileNames, banner, footer, intro, outro, esModule, globals, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, preserveModulesRoot, manualChunks, topLevelVar } = outputOptions;
|
|
3614
3606
|
const advancedChunks = bindingifyAdvancedChunks(outputOptions.advancedChunks, manualChunks);
|
|
3615
3607
|
return {
|
|
3616
3608
|
dir,
|
|
@@ -3645,7 +3637,9 @@ function bindingifyOutputOptions(outputOptions) {
|
|
|
3645
3637
|
preserveModules,
|
|
3646
3638
|
virtualDirname,
|
|
3647
3639
|
legalComments,
|
|
3648
|
-
preserveModulesRoot
|
|
3640
|
+
preserveModulesRoot,
|
|
3641
|
+
topLevelVar,
|
|
3642
|
+
minifyInternalExports: outputOptions.minifyInternalExports
|
|
3649
3643
|
};
|
|
3650
3644
|
}
|
|
3651
3645
|
function bindingifyAddon(configAddon) {
|
|
@@ -3814,6 +3808,12 @@ var NormalizedOutputOptionsImpl = class {
|
|
|
3814
3808
|
get virtualDirname() {
|
|
3815
3809
|
return this.inner.virtualDirname;
|
|
3816
3810
|
}
|
|
3811
|
+
get topLevelVar() {
|
|
3812
|
+
return this.inner.topLevelVar ?? false;
|
|
3813
|
+
}
|
|
3814
|
+
get minifyInternalExports() {
|
|
3815
|
+
return this.inner.minifyInternalExports ?? false;
|
|
3816
|
+
}
|
|
3817
3817
|
};
|
|
3818
3818
|
function normalizeAddon(value) {
|
|
3819
3819
|
if (typeof value === "function") return value;
|
|
@@ -3948,14 +3948,7 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
3948
3948
|
moduleTypes: inputOptions.moduleTypes,
|
|
3949
3949
|
define: inputOptions.define ? Object.entries(inputOptions.define) : void 0,
|
|
3950
3950
|
inject: bindingifyInject(inputOptions.inject),
|
|
3951
|
-
experimental:
|
|
3952
|
-
strictExecutionOrder: inputOptions.experimental?.strictExecutionOrder,
|
|
3953
|
-
disableLiveBindings: inputOptions.experimental?.disableLiveBindings,
|
|
3954
|
-
viteMode: inputOptions.experimental?.viteMode,
|
|
3955
|
-
resolveNewUrlToAsset: inputOptions.experimental?.resolveNewUrlToAsset,
|
|
3956
|
-
hmr: bindingifyHmr(inputOptions.experimental?.hmr),
|
|
3957
|
-
attachDebugInfo: bindingifyAttachDebugInfo(inputOptions.experimental?.attachDebugInfo)
|
|
3958
|
-
},
|
|
3951
|
+
experimental: bindingifyExperimental(inputOptions.experimental),
|
|
3959
3952
|
profilerNames: inputOptions?.profilerNames,
|
|
3960
3953
|
jsx,
|
|
3961
3954
|
transform,
|
|
@@ -3968,7 +3961,7 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
3968
3961
|
pluginContextData.moduleOptionMap.forEach((value, key) => {
|
|
3969
3962
|
if (value.invalidate) ret.push({
|
|
3970
3963
|
id: key,
|
|
3971
|
-
sideEffects:
|
|
3964
|
+
sideEffects: value.moduleSideEffects ?? void 0
|
|
3972
3965
|
});
|
|
3973
3966
|
});
|
|
3974
3967
|
return ret;
|
|
@@ -4010,7 +4003,29 @@ function bindingifyExternal(external) {
|
|
|
4010
4003
|
};
|
|
4011
4004
|
}
|
|
4012
4005
|
}
|
|
4006
|
+
function bindingifyExperimental(experimental) {
|
|
4007
|
+
let chunkModulesOrder = src_rolldown_binding_wasi_cjs.BindingChunkModuleOrderBy.ExecOrder;
|
|
4008
|
+
if (experimental?.chunkModulesOrder) switch (experimental.chunkModulesOrder) {
|
|
4009
|
+
case "exec-order":
|
|
4010
|
+
chunkModulesOrder = src_rolldown_binding_wasi_cjs.BindingChunkModuleOrderBy.ExecOrder;
|
|
4011
|
+
break;
|
|
4012
|
+
case "module-id":
|
|
4013
|
+
chunkModulesOrder = src_rolldown_binding_wasi_cjs.BindingChunkModuleOrderBy.ModuleId;
|
|
4014
|
+
break;
|
|
4015
|
+
default: throw new Error(`Unexpected chunkModulesOrder: ${experimental.chunkModulesOrder}`);
|
|
4016
|
+
}
|
|
4017
|
+
return {
|
|
4018
|
+
strictExecutionOrder: experimental?.strictExecutionOrder,
|
|
4019
|
+
disableLiveBindings: experimental?.disableLiveBindings,
|
|
4020
|
+
viteMode: experimental?.viteMode,
|
|
4021
|
+
resolveNewUrlToAsset: experimental?.resolveNewUrlToAsset,
|
|
4022
|
+
hmr: bindingifyHmr(experimental?.hmr),
|
|
4023
|
+
attachDebugInfo: bindingifyAttachDebugInfo(experimental?.attachDebugInfo),
|
|
4024
|
+
chunkModulesOrder
|
|
4025
|
+
};
|
|
4026
|
+
}
|
|
4013
4027
|
function bindingifyResolve(resolve) {
|
|
4028
|
+
const yarnPnp = !!process.versions.pnp;
|
|
4014
4029
|
if (resolve) {
|
|
4015
4030
|
const { alias, extensionAlias,...rest } = resolve;
|
|
4016
4031
|
return {
|
|
@@ -4022,9 +4037,10 @@ function bindingifyResolve(resolve) {
|
|
|
4022
4037
|
target: name,
|
|
4023
4038
|
replacements: value
|
|
4024
4039
|
})) : void 0,
|
|
4040
|
+
yarnPnp,
|
|
4025
4041
|
...rest
|
|
4026
4042
|
};
|
|
4027
|
-
}
|
|
4043
|
+
} else return { yarnPnp };
|
|
4028
4044
|
}
|
|
4029
4045
|
function bindingifyInject(inject) {
|
|
4030
4046
|
if (inject) return Object.entries(inject).map(([alias, item]) => {
|
|
@@ -4278,7 +4294,7 @@ async function createBundlerImpl(bundler, inputOptions, outputOptions, isClose)
|
|
|
4278
4294
|
function transformHmrPatchOutput(output) {
|
|
4279
4295
|
handleHmrPatchOutputErrors(output);
|
|
4280
4296
|
const { patch } = output;
|
|
4281
|
-
return patch;
|
|
4297
|
+
return patch ?? void 0;
|
|
4282
4298
|
}
|
|
4283
4299
|
function handleHmrPatchOutputErrors(output) {
|
|
4284
4300
|
const rawErrors = output.errors;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BindingAttachDebugInfo, BindingBundler, BindingCallableBuiltinPlugin,
|
|
1
|
+
import { BindingAttachDebugInfo, BindingBundler, BindingCallableBuiltinPlugin, BindingChunkModuleOrderBy, BindingJsx, BindingLogLevel, BindingPluginOrder, BindingWatcher, parseSync, shutdownAsyncRuntime, startAsyncRuntime } from "./rolldown-binding.wasi-browser.js";
|
|
2
2
|
|
|
3
3
|
//#region rolldown:runtime
|
|
4
4
|
var __create = Object.create;
|
|
@@ -27,7 +27,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
|
|
28
28
|
//#endregion
|
|
29
29
|
//#region package.json
|
|
30
|
-
var version = "1.0.0-beta.
|
|
30
|
+
var version = "1.0.0-beta.25";
|
|
31
31
|
|
|
32
32
|
//#endregion
|
|
33
33
|
//#region src/utils/normalize-string-or-regex.ts
|
|
@@ -2323,7 +2323,8 @@ const ResolveOptionsSchema = strictObject({
|
|
|
2323
2323
|
mainFiles: optional(array(string())),
|
|
2324
2324
|
modules: optional(array(string())),
|
|
2325
2325
|
symlinks: optional(boolean()),
|
|
2326
|
-
tsconfigFilename: optional(string())
|
|
2326
|
+
tsconfigFilename: optional(string()),
|
|
2327
|
+
yarnPnp: optional(boolean())
|
|
2327
2328
|
});
|
|
2328
2329
|
const TreeshakingOptionsSchema = union([boolean(), looseObject({
|
|
2329
2330
|
annotations: optional(boolean()),
|
|
@@ -2373,7 +2374,8 @@ const InputOptionsSchema = strictObject({
|
|
|
2373
2374
|
literal("none"),
|
|
2374
2375
|
literal("simple"),
|
|
2375
2376
|
literal("full")
|
|
2376
|
-
]))
|
|
2377
|
+
])),
|
|
2378
|
+
chunkModulesOrder: optional(union([literal("module-id"), literal("exec-order")]))
|
|
2377
2379
|
})),
|
|
2378
2380
|
define: pipe(optional(record(string(), string())), description("Define global variables")),
|
|
2379
2381
|
inject: optional(record(string(), union([string(), tuple([string(), string()])]))),
|
|
@@ -2514,7 +2516,8 @@ const OutputOptionsSchema = strictObject({
|
|
|
2514
2516
|
}, () => `The 'true' value is not supported`)),
|
|
2515
2517
|
preserveModules: pipe(optional(boolean()), description("Preserve module structure")),
|
|
2516
2518
|
preserveModulesRoot: pipe(optional(string()), description("Put preserved modules under this path at root level")),
|
|
2517
|
-
virtualDirname: optional(string())
|
|
2519
|
+
virtualDirname: optional(string()),
|
|
2520
|
+
minifyInternalExports: pipe(optional(boolean()), description("Minify internal exports"))
|
|
2518
2521
|
});
|
|
2519
2522
|
const getAddonDescription = (placement, wrapper) => {
|
|
2520
2523
|
return `Code to insert the ${ansis_default.bold(placement)} of the bundled file (${ansis_default.bold(wrapper)} the wrapper function)`;
|
|
@@ -2667,19 +2670,6 @@ function transformModuleInfo(info, option) {
|
|
|
2667
2670
|
};
|
|
2668
2671
|
}
|
|
2669
2672
|
|
|
2670
|
-
//#endregion
|
|
2671
|
-
//#region src/utils/transform-side-effects.ts
|
|
2672
|
-
function bindingifySideEffects(sideEffects) {
|
|
2673
|
-
switch (sideEffects) {
|
|
2674
|
-
case true: return BindingHookSideEffects.True;
|
|
2675
|
-
case false: return BindingHookSideEffects.False;
|
|
2676
|
-
case "no-treeshake": return BindingHookSideEffects.NoTreeshake;
|
|
2677
|
-
case null:
|
|
2678
|
-
case void 0: return void 0;
|
|
2679
|
-
default: throw new Error(`Unexpected side effects: ${sideEffects}`);
|
|
2680
|
-
}
|
|
2681
|
-
}
|
|
2682
|
-
|
|
2683
2673
|
//#endregion
|
|
2684
2674
|
//#region src/utils/transform-sourcemap.ts
|
|
2685
2675
|
function isEmptySourcemapFiled(array$1) {
|
|
@@ -2780,7 +2770,7 @@ function exclude(expr) {
|
|
|
2780
2770
|
}
|
|
2781
2771
|
|
|
2782
2772
|
//#endregion
|
|
2783
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
2773
|
+
//#region ../../node_modules/.pnpm/remeda@2.24.0/node_modules/remeda/dist/chunk-D6FCK2GA.js
|
|
2784
2774
|
function u$1(o$1, n$1, a$2) {
|
|
2785
2775
|
let t$1 = (r$1) => o$1(r$1, ...n$1);
|
|
2786
2776
|
return a$2 === void 0 ? t$1 : Object.assign(t$1, {
|
|
@@ -2790,7 +2780,7 @@ function u$1(o$1, n$1, a$2) {
|
|
|
2790
2780
|
}
|
|
2791
2781
|
|
|
2792
2782
|
//#endregion
|
|
2793
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
2783
|
+
//#region ../../node_modules/.pnpm/remeda@2.24.0/node_modules/remeda/dist/chunk-WIMGWYZL.js
|
|
2794
2784
|
function u(r$1, n$1, o$1) {
|
|
2795
2785
|
let a$2 = r$1.length - n$1.length;
|
|
2796
2786
|
if (a$2 === 0) return r$1(...n$1);
|
|
@@ -2799,7 +2789,7 @@ function u(r$1, n$1, o$1) {
|
|
|
2799
2789
|
}
|
|
2800
2790
|
|
|
2801
2791
|
//#endregion
|
|
2802
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
2792
|
+
//#region ../../node_modules/.pnpm/remeda@2.24.0/node_modules/remeda/dist/chunk-3IFJP4R5.js
|
|
2803
2793
|
function d(...r$1) {
|
|
2804
2794
|
return u(i, r$1);
|
|
2805
2795
|
}
|
|
@@ -2966,7 +2956,7 @@ function bindingPluginOrder(order) {
|
|
|
2966
2956
|
}
|
|
2967
2957
|
|
|
2968
2958
|
//#endregion
|
|
2969
|
-
//#region ../../node_modules/.pnpm/oxc-parser@0.
|
|
2959
|
+
//#region ../../node_modules/.pnpm/oxc-parser@0.76.0/node_modules/oxc-parser/wrap.mjs
|
|
2970
2960
|
function wrap$1(result) {
|
|
2971
2961
|
let program, module$1, comments, errors;
|
|
2972
2962
|
return {
|
|
@@ -3077,7 +3067,7 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
|
3077
3067
|
});
|
|
3078
3068
|
data.loadModulePromiseMap.set(id$1, promise$1);
|
|
3079
3069
|
try {
|
|
3080
|
-
await context.load(id$1,
|
|
3070
|
+
await context.load(id$1, options.moduleSideEffects ?? void 0);
|
|
3081
3071
|
} catch (e$1) {
|
|
3082
3072
|
data.loadModulePromiseMap.delete(id$1);
|
|
3083
3073
|
data.loadModulePromiseResolveFnMap.delete(id$1);
|
|
@@ -3097,6 +3087,7 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
|
3097
3087
|
}, void 0);
|
|
3098
3088
|
const res = await this.context.resolve(source, importer, {
|
|
3099
3089
|
custom: receipt,
|
|
3090
|
+
isEntry: options?.isEntry,
|
|
3100
3091
|
skipSelf: options?.skipSelf,
|
|
3101
3092
|
vitePluginCustom
|
|
3102
3093
|
});
|
|
@@ -3106,7 +3097,8 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
|
3106
3097
|
return {
|
|
3107
3098
|
...res,
|
|
3108
3099
|
external: res.external === "relative" ? unreachable(`The PluginContext resolve result external couldn't be 'relative'`) : res.external,
|
|
3109
|
-
...info
|
|
3100
|
+
...info,
|
|
3101
|
+
moduleSideEffects: info.moduleSideEffects ?? res.moduleSideEffects ?? null
|
|
3110
3102
|
};
|
|
3111
3103
|
}
|
|
3112
3104
|
emitFile = (file) => {
|
|
@@ -3230,7 +3222,7 @@ function bindingifyResolveId(args$1) {
|
|
|
3230
3222
|
id: ret.id,
|
|
3231
3223
|
external: ret.external,
|
|
3232
3224
|
normalizeExternalId: false,
|
|
3233
|
-
|
|
3225
|
+
moduleSideEffects: exist.moduleSideEffects ?? void 0
|
|
3234
3226
|
};
|
|
3235
3227
|
},
|
|
3236
3228
|
meta: bindingifyPluginHookMeta(meta),
|
|
@@ -3254,7 +3246,7 @@ function bindingifyResolveDynamicImport(args$1) {
|
|
|
3254
3246
|
id: ret.id,
|
|
3255
3247
|
external: ret.external
|
|
3256
3248
|
};
|
|
3257
|
-
if (ret.moduleSideEffects !== null) result.
|
|
3249
|
+
if (ret.moduleSideEffects !== null) result.moduleSideEffects = ret.moduleSideEffects;
|
|
3258
3250
|
args$1.pluginContextData.updateModuleOption(ret.id, {
|
|
3259
3251
|
meta: ret.meta || {},
|
|
3260
3252
|
moduleSideEffects: ret.moduleSideEffects || null,
|
|
@@ -3282,7 +3274,7 @@ function bindingifyTransform(args$1) {
|
|
|
3282
3274
|
return {
|
|
3283
3275
|
code: ret.code,
|
|
3284
3276
|
map: bindingifySourcemap$1(normalizeTransformHookSourcemap(id$1, code$1, ret.map)),
|
|
3285
|
-
|
|
3277
|
+
moduleSideEffects: moduleOption.moduleSideEffects ?? void 0,
|
|
3286
3278
|
moduleType: ret.moduleType
|
|
3287
3279
|
};
|
|
3288
3280
|
},
|
|
@@ -3309,7 +3301,7 @@ function bindingifyLoad(args$1) {
|
|
|
3309
3301
|
code: ret.code,
|
|
3310
3302
|
map: bindingifySourcemap$1(map),
|
|
3311
3303
|
moduleType: ret.moduleType,
|
|
3312
|
-
|
|
3304
|
+
moduleSideEffects: moduleOption.moduleSideEffects ?? void 0
|
|
3313
3305
|
};
|
|
3314
3306
|
},
|
|
3315
3307
|
meta: bindingifyPluginHookMeta(meta),
|
|
@@ -3963,7 +3955,7 @@ var ChunkingContextImpl = class {
|
|
|
3963
3955
|
//#endregion
|
|
3964
3956
|
//#region src/utils/bindingify-output-options.ts
|
|
3965
3957
|
function bindingifyOutputOptions(outputOptions) {
|
|
3966
|
-
const { dir, format: format$1, exports, hashCharacters, sourcemap, sourcemapDebugIds, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, cssEntryFileNames, cssChunkFileNames, banner, footer, intro, outro, esModule, globals, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, preserveModulesRoot, manualChunks } = outputOptions;
|
|
3958
|
+
const { dir, format: format$1, exports, hashCharacters, sourcemap, sourcemapDebugIds, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, cssEntryFileNames, cssChunkFileNames, banner, footer, intro, outro, esModule, globals, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, preserveModulesRoot, manualChunks, topLevelVar } = outputOptions;
|
|
3967
3959
|
const advancedChunks = bindingifyAdvancedChunks(outputOptions.advancedChunks, manualChunks);
|
|
3968
3960
|
return {
|
|
3969
3961
|
dir,
|
|
@@ -3998,7 +3990,9 @@ function bindingifyOutputOptions(outputOptions) {
|
|
|
3998
3990
|
preserveModules,
|
|
3999
3991
|
virtualDirname,
|
|
4000
3992
|
legalComments,
|
|
4001
|
-
preserveModulesRoot
|
|
3993
|
+
preserveModulesRoot,
|
|
3994
|
+
topLevelVar,
|
|
3995
|
+
minifyInternalExports: outputOptions.minifyInternalExports
|
|
4002
3996
|
};
|
|
4003
3997
|
}
|
|
4004
3998
|
function bindingifyAddon(configAddon) {
|
|
@@ -4167,6 +4161,12 @@ var NormalizedOutputOptionsImpl = class {
|
|
|
4167
4161
|
get virtualDirname() {
|
|
4168
4162
|
return this.inner.virtualDirname;
|
|
4169
4163
|
}
|
|
4164
|
+
get topLevelVar() {
|
|
4165
|
+
return this.inner.topLevelVar ?? false;
|
|
4166
|
+
}
|
|
4167
|
+
get minifyInternalExports() {
|
|
4168
|
+
return this.inner.minifyInternalExports ?? false;
|
|
4169
|
+
}
|
|
4170
4170
|
};
|
|
4171
4171
|
function normalizeAddon(value) {
|
|
4172
4172
|
if (typeof value === "function") return value;
|
|
@@ -4301,14 +4301,7 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
4301
4301
|
moduleTypes: inputOptions.moduleTypes,
|
|
4302
4302
|
define: inputOptions.define ? Object.entries(inputOptions.define) : void 0,
|
|
4303
4303
|
inject: bindingifyInject(inputOptions.inject),
|
|
4304
|
-
experimental:
|
|
4305
|
-
strictExecutionOrder: inputOptions.experimental?.strictExecutionOrder,
|
|
4306
|
-
disableLiveBindings: inputOptions.experimental?.disableLiveBindings,
|
|
4307
|
-
viteMode: inputOptions.experimental?.viteMode,
|
|
4308
|
-
resolveNewUrlToAsset: inputOptions.experimental?.resolveNewUrlToAsset,
|
|
4309
|
-
hmr: bindingifyHmr(inputOptions.experimental?.hmr),
|
|
4310
|
-
attachDebugInfo: bindingifyAttachDebugInfo(inputOptions.experimental?.attachDebugInfo)
|
|
4311
|
-
},
|
|
4304
|
+
experimental: bindingifyExperimental(inputOptions.experimental),
|
|
4312
4305
|
profilerNames: inputOptions?.profilerNames,
|
|
4313
4306
|
jsx,
|
|
4314
4307
|
transform,
|
|
@@ -4321,7 +4314,7 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
4321
4314
|
pluginContextData.moduleOptionMap.forEach((value, key) => {
|
|
4322
4315
|
if (value.invalidate) ret.push({
|
|
4323
4316
|
id: key,
|
|
4324
|
-
sideEffects:
|
|
4317
|
+
sideEffects: value.moduleSideEffects ?? void 0
|
|
4325
4318
|
});
|
|
4326
4319
|
});
|
|
4327
4320
|
return ret;
|
|
@@ -4363,7 +4356,29 @@ function bindingifyExternal(external) {
|
|
|
4363
4356
|
};
|
|
4364
4357
|
}
|
|
4365
4358
|
}
|
|
4359
|
+
function bindingifyExperimental(experimental) {
|
|
4360
|
+
let chunkModulesOrder = BindingChunkModuleOrderBy.ExecOrder;
|
|
4361
|
+
if (experimental?.chunkModulesOrder) switch (experimental.chunkModulesOrder) {
|
|
4362
|
+
case "exec-order":
|
|
4363
|
+
chunkModulesOrder = BindingChunkModuleOrderBy.ExecOrder;
|
|
4364
|
+
break;
|
|
4365
|
+
case "module-id":
|
|
4366
|
+
chunkModulesOrder = BindingChunkModuleOrderBy.ModuleId;
|
|
4367
|
+
break;
|
|
4368
|
+
default: throw new Error(`Unexpected chunkModulesOrder: ${experimental.chunkModulesOrder}`);
|
|
4369
|
+
}
|
|
4370
|
+
return {
|
|
4371
|
+
strictExecutionOrder: experimental?.strictExecutionOrder,
|
|
4372
|
+
disableLiveBindings: experimental?.disableLiveBindings,
|
|
4373
|
+
viteMode: experimental?.viteMode,
|
|
4374
|
+
resolveNewUrlToAsset: experimental?.resolveNewUrlToAsset,
|
|
4375
|
+
hmr: bindingifyHmr(experimental?.hmr),
|
|
4376
|
+
attachDebugInfo: bindingifyAttachDebugInfo(experimental?.attachDebugInfo),
|
|
4377
|
+
chunkModulesOrder
|
|
4378
|
+
};
|
|
4379
|
+
}
|
|
4366
4380
|
function bindingifyResolve(resolve$1) {
|
|
4381
|
+
const yarnPnp = !!process.versions.pnp;
|
|
4367
4382
|
if (resolve$1) {
|
|
4368
4383
|
const { alias, extensionAlias,...rest } = resolve$1;
|
|
4369
4384
|
return {
|
|
@@ -4375,9 +4390,10 @@ function bindingifyResolve(resolve$1) {
|
|
|
4375
4390
|
target: name,
|
|
4376
4391
|
replacements: value
|
|
4377
4392
|
})) : void 0,
|
|
4393
|
+
yarnPnp,
|
|
4378
4394
|
...rest
|
|
4379
4395
|
};
|
|
4380
|
-
}
|
|
4396
|
+
} else return { yarnPnp };
|
|
4381
4397
|
}
|
|
4382
4398
|
function bindingifyInject(inject) {
|
|
4383
4399
|
if (inject) return Object.entries(inject).map(([alias, item]) => {
|
|
@@ -4569,7 +4585,7 @@ async function createBundlerImpl(bundler, inputOptions, outputOptions, isClose)
|
|
|
4569
4585
|
function transformHmrPatchOutput(output) {
|
|
4570
4586
|
handleHmrPatchOutputErrors(output);
|
|
4571
4587
|
const { patch } = output;
|
|
4572
|
-
return patch;
|
|
4588
|
+
return patch ?? void 0;
|
|
4573
4589
|
}
|
|
4574
4590
|
function handleHmrPatchOutputErrors(output) {
|
|
4575
4591
|
const rawErrors = output.errors;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rolldown/browser",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.25",
|
|
4
4
|
"description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
|
|
5
5
|
"homepage": "https://rolldown.rs/",
|
|
6
6
|
"type": "module",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@napi-rs/wasm-runtime": "^0.2.10",
|
|
59
|
-
"@oxc-project/runtime": "=0.
|
|
59
|
+
"@oxc-project/runtime": "=0.76.0"
|
|
60
60
|
},
|
|
61
61
|
"scripts": {
|
|
62
62
|
"build": "pnpm run build:debug",
|