@rolldown/browser 1.0.0-beta.23 → 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 +7 -7
- package/dist/cli.mjs +7 -7
- 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 +3 -2
- 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 +3 -3
- package/dist/index.d.mts +3 -3
- 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 -4
- package/dist/rolldown-binding.wasi.cjs +24 -4
- package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
- package/dist/shared/{binding-CMKStSph.d.cts → binding-B9-3a5q4.d.cts} +0 -10
- package/dist/shared/{binding-DB58iXP8.d.mts → binding-DQYRWAqj.d.mts} +0 -10
- package/dist/shared/{define-config-BRkYSF9E.d.cts → define-config-BtEiHmBk.d.mts} +36 -31
- package/dist/shared/{define-config-CqVfqfZQ.d.mts → define-config-ZN70csxk.d.cts} +36 -31
- package/dist/shared/{load-config-BWbXOTbl.mjs → load-config-B_r5s5Sw.mjs} +1 -1
- package/dist/shared/{load-config-Bh2dNRk9.cjs → load-config-CbbGAxoK.cjs} +1 -1
- package/dist/shared/{parse-ast-index-CGTVCgvx.cjs → parse-ast-index-80TSV2Ni.cjs} +14 -2
- package/dist/shared/{parse-ast-index-BzdtcWzA.mjs → parse-ast-index-Bo5jcF9A.mjs} +9 -3
- package/dist/shared/{src-BA5CL--T.mjs → src-DgEwyn6q.mjs} +107 -64
- package/dist/shared/{src-Co_Bf7DL.cjs → src-Dtgcnc61.cjs} +106 -63
- package/dist/{src-C1KTaRyZ.js → src-nDvl0w95.js} +114 -65
- 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,9 +8,20 @@ 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
|
+
//#endregion
|
|
15
|
+
//#region src/utils/normalize-string-or-regex.ts
|
|
16
|
+
function normalizedStringOrRegex(pattern) {
|
|
17
|
+
if (!pattern) return void 0;
|
|
18
|
+
if (!isReadonlyArray(pattern)) return [pattern];
|
|
19
|
+
return pattern;
|
|
20
|
+
}
|
|
21
|
+
function isReadonlyArray(input) {
|
|
22
|
+
return Array.isArray(input);
|
|
23
|
+
}
|
|
24
|
+
|
|
14
25
|
//#endregion
|
|
15
26
|
//#region src/builtin-plugin/utils.ts
|
|
16
27
|
function makeBuiltinPluginCallable(plugin) {
|
|
@@ -40,6 +51,10 @@ function modulePreloadPolyfillPlugin(config) {
|
|
|
40
51
|
return new BuiltinPlugin("builtin:module-preload-polyfill", config);
|
|
41
52
|
}
|
|
42
53
|
function dynamicImportVarsPlugin(config) {
|
|
54
|
+
if (config) {
|
|
55
|
+
config.include = normalizedStringOrRegex(config.include);
|
|
56
|
+
config.exclude = normalizedStringOrRegex(config.exclude);
|
|
57
|
+
}
|
|
43
58
|
return new BuiltinPlugin("builtin:dynamic-import-vars", config);
|
|
44
59
|
}
|
|
45
60
|
function importGlobPlugin(config) {
|
|
@@ -2094,7 +2109,8 @@ const ResolveOptionsSchema = strictObject({
|
|
|
2094
2109
|
mainFiles: optional(array(string())),
|
|
2095
2110
|
modules: optional(array(string())),
|
|
2096
2111
|
symlinks: optional(boolean()),
|
|
2097
|
-
tsconfigFilename: optional(string())
|
|
2112
|
+
tsconfigFilename: optional(string()),
|
|
2113
|
+
yarnPnp: optional(boolean())
|
|
2098
2114
|
});
|
|
2099
2115
|
const TreeshakingOptionsSchema = union([boolean(), looseObject({
|
|
2100
2116
|
annotations: optional(boolean()),
|
|
@@ -2102,6 +2118,7 @@ const TreeshakingOptionsSchema = union([boolean(), looseObject({
|
|
|
2102
2118
|
unknownGlobalSideEffects: optional(boolean()),
|
|
2103
2119
|
commonjs: optional(boolean())
|
|
2104
2120
|
})]);
|
|
2121
|
+
const OptimizationOptionsSchema = strictObject({ inlineConst: pipe(optional(boolean()), description("Enable crossmodule constant inlining")) });
|
|
2105
2122
|
const OnLogSchema = pipe(function_(), args(tuple([
|
|
2106
2123
|
LogLevelSchema,
|
|
2107
2124
|
RollupLogSchema,
|
|
@@ -2127,6 +2144,7 @@ const InputOptionsSchema = strictObject({
|
|
|
2127
2144
|
])), description(`Platform for which the code should be generated (node, ${ansis_default.underline("browser")}, neutral)`)),
|
|
2128
2145
|
shimMissingExports: pipe(optional(boolean()), description("Create shim variables for missing exports")),
|
|
2129
2146
|
treeshake: optional(TreeshakingOptionsSchema),
|
|
2147
|
+
optimization: optional(OptimizationOptionsSchema),
|
|
2130
2148
|
logLevel: pipe(optional(LogLevelOptionSchema), description(`Log level (${ansis_default.dim("silent")}, ${ansis_default.underline(ansis_default.gray("info"))}, debug, ${ansis_default.yellow("warn")})`)),
|
|
2131
2149
|
onLog: optional(OnLogSchema),
|
|
2132
2150
|
onwarn: optional(OnwarnSchema),
|
|
@@ -2142,7 +2160,8 @@ const InputOptionsSchema = strictObject({
|
|
|
2142
2160
|
literal("none"),
|
|
2143
2161
|
literal("simple"),
|
|
2144
2162
|
literal("full")
|
|
2145
|
-
]))
|
|
2163
|
+
])),
|
|
2164
|
+
chunkModulesOrder: optional(union([literal("module-id"), literal("exec-order")]))
|
|
2146
2165
|
})),
|
|
2147
2166
|
define: pipe(optional(record(string(), string())), description("Define global variables")),
|
|
2148
2167
|
inject: optional(record(string(), union([string(), tuple([string(), string()])]))),
|
|
@@ -2283,7 +2302,8 @@ const OutputOptionsSchema = strictObject({
|
|
|
2283
2302
|
}, () => `The 'true' value is not supported`)),
|
|
2284
2303
|
preserveModules: pipe(optional(boolean()), description("Preserve module structure")),
|
|
2285
2304
|
preserveModulesRoot: pipe(optional(string()), description("Put preserved modules under this path at root level")),
|
|
2286
|
-
virtualDirname: optional(string())
|
|
2305
|
+
virtualDirname: optional(string()),
|
|
2306
|
+
minifyInternalExports: pipe(optional(boolean()), description("Minify internal exports"))
|
|
2287
2307
|
});
|
|
2288
2308
|
const getAddonDescription = (placement, wrapper) => {
|
|
2289
2309
|
return `Code to insert the ${ansis_default.bold(placement)} of the bundled file (${ansis_default.bold(wrapper)} the wrapper function)`;
|
|
@@ -2452,19 +2472,6 @@ function transformModuleInfo(info, option) {
|
|
|
2452
2472
|
};
|
|
2453
2473
|
}
|
|
2454
2474
|
|
|
2455
|
-
//#endregion
|
|
2456
|
-
//#region src/utils/transform-side-effects.ts
|
|
2457
|
-
function bindingifySideEffects(sideEffects) {
|
|
2458
|
-
switch (sideEffects) {
|
|
2459
|
-
case true: return src_rolldown_binding_wasi_cjs.BindingHookSideEffects.True;
|
|
2460
|
-
case false: return src_rolldown_binding_wasi_cjs.BindingHookSideEffects.False;
|
|
2461
|
-
case "no-treeshake": return src_rolldown_binding_wasi_cjs.BindingHookSideEffects.NoTreeshake;
|
|
2462
|
-
case null:
|
|
2463
|
-
case void 0: return void 0;
|
|
2464
|
-
default: throw new Error(`Unexpected side effects: ${sideEffects}`);
|
|
2465
|
-
}
|
|
2466
|
-
}
|
|
2467
|
-
|
|
2468
2475
|
//#endregion
|
|
2469
2476
|
//#region src/utils/transform-sourcemap.ts
|
|
2470
2477
|
function isEmptySourcemapFiled(array$1) {
|
|
@@ -2481,7 +2488,7 @@ function normalizeTransformHookSourcemap(id$1, originalCode, rawMap) {
|
|
|
2481
2488
|
}
|
|
2482
2489
|
|
|
2483
2490
|
//#endregion
|
|
2484
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
2491
|
+
//#region ../../node_modules/.pnpm/remeda@2.24.0/node_modules/remeda/dist/chunk-D6FCK2GA.js
|
|
2485
2492
|
function u$1(o$1, n$1, a$2) {
|
|
2486
2493
|
let t$1 = (r$1) => o$1(r$1, ...n$1);
|
|
2487
2494
|
return a$2 === void 0 ? t$1 : Object.assign(t$1, {
|
|
@@ -2491,7 +2498,7 @@ function u$1(o$1, n$1, a$2) {
|
|
|
2491
2498
|
}
|
|
2492
2499
|
|
|
2493
2500
|
//#endregion
|
|
2494
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
2501
|
+
//#region ../../node_modules/.pnpm/remeda@2.24.0/node_modules/remeda/dist/chunk-WIMGWYZL.js
|
|
2495
2502
|
function u(r$1, n$1, o$1) {
|
|
2496
2503
|
let a$2 = r$1.length - n$1.length;
|
|
2497
2504
|
if (a$2 === 0) return r$1(...n$1);
|
|
@@ -2500,7 +2507,7 @@ function u(r$1, n$1, o$1) {
|
|
|
2500
2507
|
}
|
|
2501
2508
|
|
|
2502
2509
|
//#endregion
|
|
2503
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
2510
|
+
//#region ../../node_modules/.pnpm/remeda@2.24.0/node_modules/remeda/dist/chunk-3IFJP4R5.js
|
|
2504
2511
|
function d(...r$1) {
|
|
2505
2512
|
return u(i, r$1);
|
|
2506
2513
|
}
|
|
@@ -2707,7 +2714,7 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
|
2707
2714
|
});
|
|
2708
2715
|
data.loadModulePromiseMap.set(id$1, promise$1);
|
|
2709
2716
|
try {
|
|
2710
|
-
await context.load(id$1,
|
|
2717
|
+
await context.load(id$1, options.moduleSideEffects ?? void 0);
|
|
2711
2718
|
} catch (e$1) {
|
|
2712
2719
|
data.loadModulePromiseMap.delete(id$1);
|
|
2713
2720
|
data.loadModulePromiseResolveFnMap.delete(id$1);
|
|
@@ -2727,6 +2734,7 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
|
2727
2734
|
}, void 0);
|
|
2728
2735
|
const res = await this.context.resolve(source, importer, {
|
|
2729
2736
|
custom: receipt,
|
|
2737
|
+
isEntry: options?.isEntry,
|
|
2730
2738
|
skipSelf: options?.skipSelf,
|
|
2731
2739
|
vitePluginCustom
|
|
2732
2740
|
});
|
|
@@ -2736,7 +2744,8 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
|
2736
2744
|
return {
|
|
2737
2745
|
...res,
|
|
2738
2746
|
external: res.external === "relative" ? require_dist.unreachable(`The PluginContext resolve result external couldn't be 'relative'`) : res.external,
|
|
2739
|
-
...info
|
|
2747
|
+
...info,
|
|
2748
|
+
moduleSideEffects: info.moduleSideEffects ?? res.moduleSideEffects ?? null
|
|
2740
2749
|
};
|
|
2741
2750
|
}
|
|
2742
2751
|
emitFile = (file) => {
|
|
@@ -2860,7 +2869,7 @@ function bindingifyResolveId(args$1) {
|
|
|
2860
2869
|
id: ret.id,
|
|
2861
2870
|
external: ret.external,
|
|
2862
2871
|
normalizeExternalId: false,
|
|
2863
|
-
|
|
2872
|
+
moduleSideEffects: exist.moduleSideEffects ?? void 0
|
|
2864
2873
|
};
|
|
2865
2874
|
},
|
|
2866
2875
|
meta: bindingifyPluginHookMeta(meta),
|
|
@@ -2884,7 +2893,7 @@ function bindingifyResolveDynamicImport(args$1) {
|
|
|
2884
2893
|
id: ret.id,
|
|
2885
2894
|
external: ret.external
|
|
2886
2895
|
};
|
|
2887
|
-
if (ret.moduleSideEffects !== null) result.
|
|
2896
|
+
if (ret.moduleSideEffects !== null) result.moduleSideEffects = ret.moduleSideEffects;
|
|
2888
2897
|
args$1.pluginContextData.updateModuleOption(ret.id, {
|
|
2889
2898
|
meta: ret.meta || {},
|
|
2890
2899
|
moduleSideEffects: ret.moduleSideEffects || null,
|
|
@@ -2912,7 +2921,7 @@ function bindingifyTransform(args$1) {
|
|
|
2912
2921
|
return {
|
|
2913
2922
|
code: ret.code,
|
|
2914
2923
|
map: bindingifySourcemap$1(normalizeTransformHookSourcemap(id$1, code$1, ret.map)),
|
|
2915
|
-
|
|
2924
|
+
moduleSideEffects: moduleOption.moduleSideEffects ?? void 0,
|
|
2916
2925
|
moduleType: ret.moduleType
|
|
2917
2926
|
};
|
|
2918
2927
|
},
|
|
@@ -2939,7 +2948,7 @@ function bindingifyLoad(args$1) {
|
|
|
2939
2948
|
code: ret.code,
|
|
2940
2949
|
map: bindingifySourcemap$1(map),
|
|
2941
2950
|
moduleType: ret.moduleType,
|
|
2942
|
-
|
|
2951
|
+
moduleSideEffects: moduleOption.moduleSideEffects ?? void 0
|
|
2943
2952
|
};
|
|
2944
2953
|
},
|
|
2945
2954
|
meta: bindingifyPluginHookMeta(meta),
|
|
@@ -3593,7 +3602,7 @@ var ChunkingContextImpl = class {
|
|
|
3593
3602
|
//#endregion
|
|
3594
3603
|
//#region src/utils/bindingify-output-options.ts
|
|
3595
3604
|
function bindingifyOutputOptions(outputOptions) {
|
|
3596
|
-
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;
|
|
3597
3606
|
const advancedChunks = bindingifyAdvancedChunks(outputOptions.advancedChunks, manualChunks);
|
|
3598
3607
|
return {
|
|
3599
3608
|
dir,
|
|
@@ -3628,7 +3637,9 @@ function bindingifyOutputOptions(outputOptions) {
|
|
|
3628
3637
|
preserveModules,
|
|
3629
3638
|
virtualDirname,
|
|
3630
3639
|
legalComments,
|
|
3631
|
-
preserveModulesRoot
|
|
3640
|
+
preserveModulesRoot,
|
|
3641
|
+
topLevelVar,
|
|
3642
|
+
minifyInternalExports: outputOptions.minifyInternalExports
|
|
3632
3643
|
};
|
|
3633
3644
|
}
|
|
3634
3645
|
function bindingifyAddon(configAddon) {
|
|
@@ -3797,6 +3808,12 @@ var NormalizedOutputOptionsImpl = class {
|
|
|
3797
3808
|
get virtualDirname() {
|
|
3798
3809
|
return this.inner.virtualDirname;
|
|
3799
3810
|
}
|
|
3811
|
+
get topLevelVar() {
|
|
3812
|
+
return this.inner.topLevelVar ?? false;
|
|
3813
|
+
}
|
|
3814
|
+
get minifyInternalExports() {
|
|
3815
|
+
return this.inner.minifyInternalExports ?? false;
|
|
3816
|
+
}
|
|
3800
3817
|
};
|
|
3801
3818
|
function normalizeAddon(value) {
|
|
3802
3819
|
if (typeof value === "function") return value;
|
|
@@ -3907,17 +3924,6 @@ var PluginContextData = class {
|
|
|
3907
3924
|
}
|
|
3908
3925
|
};
|
|
3909
3926
|
|
|
3910
|
-
//#endregion
|
|
3911
|
-
//#region src/utils/normalize-string-or-regex.ts
|
|
3912
|
-
function normalizedStringOrRegex(pattern) {
|
|
3913
|
-
if (!pattern) return void 0;
|
|
3914
|
-
if (!isReadonlyArray(pattern)) return [pattern];
|
|
3915
|
-
return pattern;
|
|
3916
|
-
}
|
|
3917
|
-
function isReadonlyArray(input) {
|
|
3918
|
-
return Array.isArray(input);
|
|
3919
|
-
}
|
|
3920
|
-
|
|
3921
3927
|
//#endregion
|
|
3922
3928
|
//#region src/utils/bindingify-input-options.ts
|
|
3923
3929
|
function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normalizedOutputPlugins, onLog, logLevel, watchMode) {
|
|
@@ -3927,8 +3933,7 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
3927
3933
|
if (plugin instanceof BuiltinPlugin) return bindingifyBuiltInPlugin(plugin);
|
|
3928
3934
|
return bindingifyPlugin(plugin, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode);
|
|
3929
3935
|
});
|
|
3930
|
-
const { jsx,
|
|
3931
|
-
const transform = inputOptions.transform || jsxTransform;
|
|
3936
|
+
const { jsx, transform } = bindingifyJsx(onLog, inputOptions.jsx, inputOptions.transform);
|
|
3932
3937
|
return {
|
|
3933
3938
|
input: bindingifyInput(inputOptions.input),
|
|
3934
3939
|
plugins,
|
|
@@ -3943,14 +3948,7 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
3943
3948
|
moduleTypes: inputOptions.moduleTypes,
|
|
3944
3949
|
define: inputOptions.define ? Object.entries(inputOptions.define) : void 0,
|
|
3945
3950
|
inject: bindingifyInject(inputOptions.inject),
|
|
3946
|
-
experimental:
|
|
3947
|
-
strictExecutionOrder: inputOptions.experimental?.strictExecutionOrder,
|
|
3948
|
-
disableLiveBindings: inputOptions.experimental?.disableLiveBindings,
|
|
3949
|
-
viteMode: inputOptions.experimental?.viteMode,
|
|
3950
|
-
resolveNewUrlToAsset: inputOptions.experimental?.resolveNewUrlToAsset,
|
|
3951
|
-
hmr: bindingifyHmr(inputOptions.experimental?.hmr),
|
|
3952
|
-
attachDebugInfo: bindingifyAttachDebugInfo(inputOptions.experimental?.attachDebugInfo)
|
|
3953
|
-
},
|
|
3951
|
+
experimental: bindingifyExperimental(inputOptions.experimental),
|
|
3954
3952
|
profilerNames: inputOptions?.profilerNames,
|
|
3955
3953
|
jsx,
|
|
3956
3954
|
transform,
|
|
@@ -3963,7 +3961,7 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
3963
3961
|
pluginContextData.moduleOptionMap.forEach((value, key) => {
|
|
3964
3962
|
if (value.invalidate) ret.push({
|
|
3965
3963
|
id: key,
|
|
3966
|
-
sideEffects:
|
|
3964
|
+
sideEffects: value.moduleSideEffects ?? void 0
|
|
3967
3965
|
});
|
|
3968
3966
|
});
|
|
3969
3967
|
return ret;
|
|
@@ -3972,7 +3970,8 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
3972
3970
|
debug: inputOptions.debug,
|
|
3973
3971
|
invalidateJsSideCache: pluginContextData.clear.bind(pluginContextData),
|
|
3974
3972
|
markModuleLoaded: pluginContextData.markModuleLoaded.bind(pluginContextData),
|
|
3975
|
-
preserveEntrySignatures: bindingifyPreserveEntrySignatures(inputOptions.preserveEntrySignatures)
|
|
3973
|
+
preserveEntrySignatures: bindingifyPreserveEntrySignatures(inputOptions.preserveEntrySignatures),
|
|
3974
|
+
optimization: inputOptions.optimization
|
|
3976
3975
|
};
|
|
3977
3976
|
}
|
|
3978
3977
|
function bindingifyHmr(hmr) {
|
|
@@ -4004,7 +4003,29 @@ function bindingifyExternal(external) {
|
|
|
4004
4003
|
};
|
|
4005
4004
|
}
|
|
4006
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
|
+
}
|
|
4007
4027
|
function bindingifyResolve(resolve) {
|
|
4028
|
+
const yarnPnp = !!process.versions.pnp;
|
|
4008
4029
|
if (resolve) {
|
|
4009
4030
|
const { alias, extensionAlias,...rest } = resolve;
|
|
4010
4031
|
return {
|
|
@@ -4016,9 +4037,10 @@ function bindingifyResolve(resolve) {
|
|
|
4016
4037
|
target: name,
|
|
4017
4038
|
replacements: value
|
|
4018
4039
|
})) : void 0,
|
|
4040
|
+
yarnPnp,
|
|
4019
4041
|
...rest
|
|
4020
4042
|
};
|
|
4021
|
-
}
|
|
4043
|
+
} else return { yarnPnp };
|
|
4022
4044
|
}
|
|
4023
4045
|
function bindingifyInject(inject) {
|
|
4024
4046
|
if (inject) return Object.entries(inject).map(([alias, item]) => {
|
|
@@ -4062,24 +4084,45 @@ function bindingifyInput(input) {
|
|
|
4062
4084
|
};
|
|
4063
4085
|
});
|
|
4064
4086
|
}
|
|
4065
|
-
function bindingifyJsx(input) {
|
|
4087
|
+
function bindingifyJsx(onLog, input, transform) {
|
|
4088
|
+
if (transform?.jsx) {
|
|
4089
|
+
if (input !== void 0) onLog(LOG_LEVEL_WARN, require_parse_ast_index.logDuplicateJsxConfig());
|
|
4090
|
+
return { transform };
|
|
4091
|
+
}
|
|
4066
4092
|
if (typeof input === "object") {
|
|
4067
|
-
if (input.mode === "preserve") return {
|
|
4093
|
+
if (input.mode === "preserve") return {
|
|
4094
|
+
jsx: src_rolldown_binding_wasi_cjs.BindingJsx.Preserve,
|
|
4095
|
+
transform
|
|
4096
|
+
};
|
|
4068
4097
|
const mode = input.mode ?? "automatic";
|
|
4069
|
-
|
|
4098
|
+
transform ??= {};
|
|
4099
|
+
transform.jsx = {
|
|
4070
4100
|
runtime: mode,
|
|
4071
4101
|
pragma: input.factory,
|
|
4072
4102
|
pragmaFrag: input.fragment,
|
|
4073
4103
|
importSource: mode === "classic" ? input.importSource : mode === "automatic" ? input.jsxImportSource : void 0
|
|
4074
|
-
}
|
|
4104
|
+
};
|
|
4105
|
+
return { transform };
|
|
4075
4106
|
}
|
|
4107
|
+
let jsx;
|
|
4076
4108
|
switch (input) {
|
|
4077
|
-
case false:
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
case "
|
|
4081
|
-
|
|
4109
|
+
case false:
|
|
4110
|
+
jsx = src_rolldown_binding_wasi_cjs.BindingJsx.Disable;
|
|
4111
|
+
break;
|
|
4112
|
+
case "react":
|
|
4113
|
+
jsx = src_rolldown_binding_wasi_cjs.BindingJsx.React;
|
|
4114
|
+
break;
|
|
4115
|
+
case "react-jsx":
|
|
4116
|
+
jsx = src_rolldown_binding_wasi_cjs.BindingJsx.ReactJsx;
|
|
4117
|
+
break;
|
|
4118
|
+
case "preserve":
|
|
4119
|
+
jsx = src_rolldown_binding_wasi_cjs.BindingJsx.Preserve;
|
|
4120
|
+
break;
|
|
4082
4121
|
}
|
|
4122
|
+
return {
|
|
4123
|
+
jsx,
|
|
4124
|
+
transform
|
|
4125
|
+
};
|
|
4083
4126
|
}
|
|
4084
4127
|
function bindingifyWatch(watch$1) {
|
|
4085
4128
|
if (watch$1) return {
|
|
@@ -4251,7 +4294,7 @@ async function createBundlerImpl(bundler, inputOptions, outputOptions, isClose)
|
|
|
4251
4294
|
function transformHmrPatchOutput(output) {
|
|
4252
4295
|
handleHmrPatchOutputErrors(output);
|
|
4253
4296
|
const { patch } = output;
|
|
4254
|
-
return patch;
|
|
4297
|
+
return patch ?? void 0;
|
|
4255
4298
|
}
|
|
4256
4299
|
function handleHmrPatchOutputErrors(output) {
|
|
4257
4300
|
const rawErrors = output.errors;
|