rolldown 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.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.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/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-DM79zlkB.d.mts} +37 -32
- package/dist/shared/{define-config-CyRbZDRR.d.mts → define-config-ZN70csxk.d.cts} +37 -32
- package/dist/shared/{load-config-n-iiDvYj.cjs → load-config-CTkl_gvX.cjs} +1 -1
- package/dist/shared/{load-config-CTdjFUJH.mjs → load-config-FeIDZeND.mjs} +1 -1
- package/dist/shared/{parse-ast-index-DDMiEgyY.cjs → parse-ast-index-BZPHquvf.cjs} +17 -5
- package/dist/shared/{parse-ast-index-DmWy-n6o.mjs → parse-ast-index-BztFsVUE.mjs} +10 -4
- package/dist/shared/{src-DgdMNl-3.mjs → src-BS7SHs-K.mjs} +106 -63
- package/dist/shared/{src-D6QrbVqq.cjs → src-CKVDAG8j.cjs} +106 -63
- package/package.json +19 -19
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-DDkG_k5U.cjs');
|
|
2
|
-
const require_parse_ast_index = require('./parse-ast-index-
|
|
2
|
+
const require_parse_ast_index = require('./parse-ast-index-BZPHquvf.cjs');
|
|
3
3
|
const require_misc = require('./misc-DksvspN4.cjs');
|
|
4
4
|
const node_path = require_chunk.__toESM(require("node:path"));
|
|
5
5
|
const node_url = require_chunk.__toESM(require("node:url"));
|
|
@@ -9,9 +9,20 @@ const node_os = require_chunk.__toESM(require("node:os"));
|
|
|
9
9
|
const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
|
|
10
10
|
|
|
11
11
|
//#region package.json
|
|
12
|
-
var version = "1.0.0-beta.
|
|
12
|
+
var version = "1.0.0-beta.25";
|
|
13
13
|
var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
14
14
|
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/utils/normalize-string-or-regex.ts
|
|
17
|
+
function normalizedStringOrRegex(pattern) {
|
|
18
|
+
if (!pattern) return void 0;
|
|
19
|
+
if (!isReadonlyArray(pattern)) return [pattern];
|
|
20
|
+
return pattern;
|
|
21
|
+
}
|
|
22
|
+
function isReadonlyArray(input) {
|
|
23
|
+
return Array.isArray(input);
|
|
24
|
+
}
|
|
25
|
+
|
|
15
26
|
//#endregion
|
|
16
27
|
//#region src/builtin-plugin/utils.ts
|
|
17
28
|
function makeBuiltinPluginCallable(plugin) {
|
|
@@ -41,6 +52,10 @@ function modulePreloadPolyfillPlugin(config) {
|
|
|
41
52
|
return new BuiltinPlugin("builtin:module-preload-polyfill", config);
|
|
42
53
|
}
|
|
43
54
|
function dynamicImportVarsPlugin(config) {
|
|
55
|
+
if (config) {
|
|
56
|
+
config.include = normalizedStringOrRegex(config.include);
|
|
57
|
+
config.exclude = normalizedStringOrRegex(config.exclude);
|
|
58
|
+
}
|
|
44
59
|
return new BuiltinPlugin("builtin:dynamic-import-vars", config);
|
|
45
60
|
}
|
|
46
61
|
function importGlobPlugin(config) {
|
|
@@ -1984,7 +1999,8 @@ const ResolveOptionsSchema = strictObject({
|
|
|
1984
1999
|
mainFiles: optional(array(string())),
|
|
1985
2000
|
modules: optional(array(string())),
|
|
1986
2001
|
symlinks: optional(boolean()),
|
|
1987
|
-
tsconfigFilename: optional(string())
|
|
2002
|
+
tsconfigFilename: optional(string()),
|
|
2003
|
+
yarnPnp: optional(boolean())
|
|
1988
2004
|
});
|
|
1989
2005
|
const TreeshakingOptionsSchema = union([boolean(), looseObject({
|
|
1990
2006
|
annotations: optional(boolean()),
|
|
@@ -1992,6 +2008,7 @@ const TreeshakingOptionsSchema = union([boolean(), looseObject({
|
|
|
1992
2008
|
unknownGlobalSideEffects: optional(boolean()),
|
|
1993
2009
|
commonjs: optional(boolean())
|
|
1994
2010
|
})]);
|
|
2011
|
+
const OptimizationOptionsSchema = strictObject({ inlineConst: pipe(optional(boolean()), description("Enable crossmodule constant inlining")) });
|
|
1995
2012
|
const OnLogSchema = pipe(function_(), args(tuple([
|
|
1996
2013
|
LogLevelSchema,
|
|
1997
2014
|
RollupLogSchema,
|
|
@@ -2017,6 +2034,7 @@ const InputOptionsSchema = strictObject({
|
|
|
2017
2034
|
])), description(`Platform for which the code should be generated (node, ${ansis.default.underline("browser")}, neutral)`)),
|
|
2018
2035
|
shimMissingExports: pipe(optional(boolean()), description("Create shim variables for missing exports")),
|
|
2019
2036
|
treeshake: optional(TreeshakingOptionsSchema),
|
|
2037
|
+
optimization: optional(OptimizationOptionsSchema),
|
|
2020
2038
|
logLevel: pipe(optional(LogLevelOptionSchema), description(`Log level (${ansis.default.dim("silent")}, ${ansis.default.underline(ansis.default.gray("info"))}, debug, ${ansis.default.yellow("warn")})`)),
|
|
2021
2039
|
onLog: optional(OnLogSchema),
|
|
2022
2040
|
onwarn: optional(OnwarnSchema),
|
|
@@ -2032,7 +2050,8 @@ const InputOptionsSchema = strictObject({
|
|
|
2032
2050
|
literal("none"),
|
|
2033
2051
|
literal("simple"),
|
|
2034
2052
|
literal("full")
|
|
2035
|
-
]))
|
|
2053
|
+
])),
|
|
2054
|
+
chunkModulesOrder: optional(union([literal("module-id"), literal("exec-order")]))
|
|
2036
2055
|
})),
|
|
2037
2056
|
define: pipe(optional(record(string(), string())), description("Define global variables")),
|
|
2038
2057
|
inject: optional(record(string(), union([string(), tuple([string(), string()])]))),
|
|
@@ -2173,7 +2192,8 @@ const OutputOptionsSchema = strictObject({
|
|
|
2173
2192
|
}, () => `The 'true' value is not supported`)),
|
|
2174
2193
|
preserveModules: pipe(optional(boolean()), description("Preserve module structure")),
|
|
2175
2194
|
preserveModulesRoot: pipe(optional(string()), description("Put preserved modules under this path at root level")),
|
|
2176
|
-
virtualDirname: optional(string())
|
|
2195
|
+
virtualDirname: optional(string()),
|
|
2196
|
+
minifyInternalExports: pipe(optional(boolean()), description("Minify internal exports"))
|
|
2177
2197
|
});
|
|
2178
2198
|
const getAddonDescription = (placement, wrapper) => {
|
|
2179
2199
|
return `Code to insert the ${ansis.default.bold(placement)} of the bundled file (${ansis.default.bold(wrapper)} the wrapper function)`;
|
|
@@ -2342,19 +2362,6 @@ function transformModuleInfo(info, option) {
|
|
|
2342
2362
|
};
|
|
2343
2363
|
}
|
|
2344
2364
|
|
|
2345
|
-
//#endregion
|
|
2346
|
-
//#region src/utils/transform-side-effects.ts
|
|
2347
|
-
function bindingifySideEffects(sideEffects) {
|
|
2348
|
-
switch (sideEffects) {
|
|
2349
|
-
case true: return require_parse_ast_index.BindingHookSideEffects.True;
|
|
2350
|
-
case false: return require_parse_ast_index.BindingHookSideEffects.False;
|
|
2351
|
-
case "no-treeshake": return require_parse_ast_index.BindingHookSideEffects.NoTreeshake;
|
|
2352
|
-
case null:
|
|
2353
|
-
case void 0: return void 0;
|
|
2354
|
-
default: throw new Error(`Unexpected side effects: ${sideEffects}`);
|
|
2355
|
-
}
|
|
2356
|
-
}
|
|
2357
|
-
|
|
2358
2365
|
//#endregion
|
|
2359
2366
|
//#region src/utils/transform-sourcemap.ts
|
|
2360
2367
|
function isEmptySourcemapFiled(array$1) {
|
|
@@ -2371,7 +2378,7 @@ function normalizeTransformHookSourcemap(id, originalCode, rawMap) {
|
|
|
2371
2378
|
}
|
|
2372
2379
|
|
|
2373
2380
|
//#endregion
|
|
2374
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
2381
|
+
//#region ../../node_modules/.pnpm/remeda@2.24.0/node_modules/remeda/dist/chunk-D6FCK2GA.js
|
|
2375
2382
|
function u$1(o, n, a) {
|
|
2376
2383
|
let t = (r) => o(r, ...n);
|
|
2377
2384
|
return a === void 0 ? t : Object.assign(t, {
|
|
@@ -2381,7 +2388,7 @@ function u$1(o, n, a) {
|
|
|
2381
2388
|
}
|
|
2382
2389
|
|
|
2383
2390
|
//#endregion
|
|
2384
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
2391
|
+
//#region ../../node_modules/.pnpm/remeda@2.24.0/node_modules/remeda/dist/chunk-WIMGWYZL.js
|
|
2385
2392
|
function u(r, n, o) {
|
|
2386
2393
|
let a = r.length - n.length;
|
|
2387
2394
|
if (a === 0) return r(...n);
|
|
@@ -2390,7 +2397,7 @@ function u(r, n, o) {
|
|
|
2390
2397
|
}
|
|
2391
2398
|
|
|
2392
2399
|
//#endregion
|
|
2393
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
2400
|
+
//#region ../../node_modules/.pnpm/remeda@2.24.0/node_modules/remeda/dist/chunk-3IFJP4R5.js
|
|
2394
2401
|
function d(...r) {
|
|
2395
2402
|
return u(i, r);
|
|
2396
2403
|
}
|
|
@@ -2597,7 +2604,7 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
|
2597
2604
|
});
|
|
2598
2605
|
data.loadModulePromiseMap.set(id, promise$1);
|
|
2599
2606
|
try {
|
|
2600
|
-
await context.load(id,
|
|
2607
|
+
await context.load(id, options.moduleSideEffects ?? void 0);
|
|
2601
2608
|
} catch (e) {
|
|
2602
2609
|
data.loadModulePromiseMap.delete(id);
|
|
2603
2610
|
data.loadModulePromiseResolveFnMap.delete(id);
|
|
@@ -2617,6 +2624,7 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
|
2617
2624
|
}, void 0);
|
|
2618
2625
|
const res = await this.context.resolve(source, importer, {
|
|
2619
2626
|
custom: receipt,
|
|
2627
|
+
isEntry: options?.isEntry,
|
|
2620
2628
|
skipSelf: options?.skipSelf,
|
|
2621
2629
|
vitePluginCustom
|
|
2622
2630
|
});
|
|
@@ -2626,7 +2634,8 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
|
2626
2634
|
return {
|
|
2627
2635
|
...res,
|
|
2628
2636
|
external: res.external === "relative" ? require_misc.unreachable(`The PluginContext resolve result external couldn't be 'relative'`) : res.external,
|
|
2629
|
-
...info
|
|
2637
|
+
...info,
|
|
2638
|
+
moduleSideEffects: info.moduleSideEffects ?? res.moduleSideEffects ?? null
|
|
2630
2639
|
};
|
|
2631
2640
|
}
|
|
2632
2641
|
emitFile = (file) => {
|
|
@@ -2750,7 +2759,7 @@ function bindingifyResolveId(args$1) {
|
|
|
2750
2759
|
id: ret.id,
|
|
2751
2760
|
external: ret.external,
|
|
2752
2761
|
normalizeExternalId: false,
|
|
2753
|
-
|
|
2762
|
+
moduleSideEffects: exist.moduleSideEffects ?? void 0
|
|
2754
2763
|
};
|
|
2755
2764
|
},
|
|
2756
2765
|
meta: bindingifyPluginHookMeta(meta),
|
|
@@ -2774,7 +2783,7 @@ function bindingifyResolveDynamicImport(args$1) {
|
|
|
2774
2783
|
id: ret.id,
|
|
2775
2784
|
external: ret.external
|
|
2776
2785
|
};
|
|
2777
|
-
if (ret.moduleSideEffects !== null) result.
|
|
2786
|
+
if (ret.moduleSideEffects !== null) result.moduleSideEffects = ret.moduleSideEffects;
|
|
2778
2787
|
args$1.pluginContextData.updateModuleOption(ret.id, {
|
|
2779
2788
|
meta: ret.meta || {},
|
|
2780
2789
|
moduleSideEffects: ret.moduleSideEffects || null,
|
|
@@ -2802,7 +2811,7 @@ function bindingifyTransform(args$1) {
|
|
|
2802
2811
|
return {
|
|
2803
2812
|
code: ret.code,
|
|
2804
2813
|
map: bindingifySourcemap$1(normalizeTransformHookSourcemap(id, code, ret.map)),
|
|
2805
|
-
|
|
2814
|
+
moduleSideEffects: moduleOption.moduleSideEffects ?? void 0,
|
|
2806
2815
|
moduleType: ret.moduleType
|
|
2807
2816
|
};
|
|
2808
2817
|
},
|
|
@@ -2829,7 +2838,7 @@ function bindingifyLoad(args$1) {
|
|
|
2829
2838
|
code: ret.code,
|
|
2830
2839
|
map: bindingifySourcemap$1(map),
|
|
2831
2840
|
moduleType: ret.moduleType,
|
|
2832
|
-
|
|
2841
|
+
moduleSideEffects: moduleOption.moduleSideEffects ?? void 0
|
|
2833
2842
|
};
|
|
2834
2843
|
},
|
|
2835
2844
|
meta: bindingifyPluginHookMeta(meta),
|
|
@@ -3483,7 +3492,7 @@ var ChunkingContextImpl = class {
|
|
|
3483
3492
|
//#endregion
|
|
3484
3493
|
//#region src/utils/bindingify-output-options.ts
|
|
3485
3494
|
function bindingifyOutputOptions(outputOptions) {
|
|
3486
|
-
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;
|
|
3495
|
+
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;
|
|
3487
3496
|
const advancedChunks = bindingifyAdvancedChunks(outputOptions.advancedChunks, manualChunks);
|
|
3488
3497
|
return {
|
|
3489
3498
|
dir,
|
|
@@ -3518,7 +3527,9 @@ function bindingifyOutputOptions(outputOptions) {
|
|
|
3518
3527
|
preserveModules,
|
|
3519
3528
|
virtualDirname,
|
|
3520
3529
|
legalComments,
|
|
3521
|
-
preserveModulesRoot
|
|
3530
|
+
preserveModulesRoot,
|
|
3531
|
+
topLevelVar,
|
|
3532
|
+
minifyInternalExports: outputOptions.minifyInternalExports
|
|
3522
3533
|
};
|
|
3523
3534
|
}
|
|
3524
3535
|
function bindingifyAddon(configAddon) {
|
|
@@ -3687,6 +3698,12 @@ var NormalizedOutputOptionsImpl = class {
|
|
|
3687
3698
|
get virtualDirname() {
|
|
3688
3699
|
return this.inner.virtualDirname;
|
|
3689
3700
|
}
|
|
3701
|
+
get topLevelVar() {
|
|
3702
|
+
return this.inner.topLevelVar ?? false;
|
|
3703
|
+
}
|
|
3704
|
+
get minifyInternalExports() {
|
|
3705
|
+
return this.inner.minifyInternalExports ?? false;
|
|
3706
|
+
}
|
|
3690
3707
|
};
|
|
3691
3708
|
function normalizeAddon(value) {
|
|
3692
3709
|
if (typeof value === "function") return value;
|
|
@@ -3797,17 +3814,6 @@ var PluginContextData = class {
|
|
|
3797
3814
|
}
|
|
3798
3815
|
};
|
|
3799
3816
|
|
|
3800
|
-
//#endregion
|
|
3801
|
-
//#region src/utils/normalize-string-or-regex.ts
|
|
3802
|
-
function normalizedStringOrRegex(pattern) {
|
|
3803
|
-
if (!pattern) return void 0;
|
|
3804
|
-
if (!isReadonlyArray(pattern)) return [pattern];
|
|
3805
|
-
return pattern;
|
|
3806
|
-
}
|
|
3807
|
-
function isReadonlyArray(input) {
|
|
3808
|
-
return Array.isArray(input);
|
|
3809
|
-
}
|
|
3810
|
-
|
|
3811
3817
|
//#endregion
|
|
3812
3818
|
//#region src/utils/bindingify-input-options.ts
|
|
3813
3819
|
function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normalizedOutputPlugins, onLog, logLevel, watchMode) {
|
|
@@ -3817,8 +3823,7 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
3817
3823
|
if (plugin instanceof BuiltinPlugin) return bindingifyBuiltInPlugin(plugin);
|
|
3818
3824
|
return bindingifyPlugin(plugin, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode);
|
|
3819
3825
|
});
|
|
3820
|
-
const { jsx,
|
|
3821
|
-
const transform = inputOptions.transform || jsxTransform;
|
|
3826
|
+
const { jsx, transform } = bindingifyJsx(onLog, inputOptions.jsx, inputOptions.transform);
|
|
3822
3827
|
return {
|
|
3823
3828
|
input: bindingifyInput(inputOptions.input),
|
|
3824
3829
|
plugins,
|
|
@@ -3833,14 +3838,7 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
3833
3838
|
moduleTypes: inputOptions.moduleTypes,
|
|
3834
3839
|
define: inputOptions.define ? Object.entries(inputOptions.define) : void 0,
|
|
3835
3840
|
inject: bindingifyInject(inputOptions.inject),
|
|
3836
|
-
experimental:
|
|
3837
|
-
strictExecutionOrder: inputOptions.experimental?.strictExecutionOrder,
|
|
3838
|
-
disableLiveBindings: inputOptions.experimental?.disableLiveBindings,
|
|
3839
|
-
viteMode: inputOptions.experimental?.viteMode,
|
|
3840
|
-
resolveNewUrlToAsset: inputOptions.experimental?.resolveNewUrlToAsset,
|
|
3841
|
-
hmr: bindingifyHmr(inputOptions.experimental?.hmr),
|
|
3842
|
-
attachDebugInfo: bindingifyAttachDebugInfo(inputOptions.experimental?.attachDebugInfo)
|
|
3843
|
-
},
|
|
3841
|
+
experimental: bindingifyExperimental(inputOptions.experimental),
|
|
3844
3842
|
profilerNames: inputOptions?.profilerNames,
|
|
3845
3843
|
jsx,
|
|
3846
3844
|
transform,
|
|
@@ -3853,7 +3851,7 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
3853
3851
|
pluginContextData.moduleOptionMap.forEach((value, key) => {
|
|
3854
3852
|
if (value.invalidate) ret.push({
|
|
3855
3853
|
id: key,
|
|
3856
|
-
sideEffects:
|
|
3854
|
+
sideEffects: value.moduleSideEffects ?? void 0
|
|
3857
3855
|
});
|
|
3858
3856
|
});
|
|
3859
3857
|
return ret;
|
|
@@ -3862,7 +3860,8 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
3862
3860
|
debug: inputOptions.debug,
|
|
3863
3861
|
invalidateJsSideCache: pluginContextData.clear.bind(pluginContextData),
|
|
3864
3862
|
markModuleLoaded: pluginContextData.markModuleLoaded.bind(pluginContextData),
|
|
3865
|
-
preserveEntrySignatures: bindingifyPreserveEntrySignatures(inputOptions.preserveEntrySignatures)
|
|
3863
|
+
preserveEntrySignatures: bindingifyPreserveEntrySignatures(inputOptions.preserveEntrySignatures),
|
|
3864
|
+
optimization: inputOptions.optimization
|
|
3866
3865
|
};
|
|
3867
3866
|
}
|
|
3868
3867
|
function bindingifyHmr(hmr) {
|
|
@@ -3894,7 +3893,29 @@ function bindingifyExternal(external) {
|
|
|
3894
3893
|
};
|
|
3895
3894
|
}
|
|
3896
3895
|
}
|
|
3896
|
+
function bindingifyExperimental(experimental) {
|
|
3897
|
+
let chunkModulesOrder = require_parse_ast_index.BindingChunkModuleOrderBy.ExecOrder;
|
|
3898
|
+
if (experimental?.chunkModulesOrder) switch (experimental.chunkModulesOrder) {
|
|
3899
|
+
case "exec-order":
|
|
3900
|
+
chunkModulesOrder = require_parse_ast_index.BindingChunkModuleOrderBy.ExecOrder;
|
|
3901
|
+
break;
|
|
3902
|
+
case "module-id":
|
|
3903
|
+
chunkModulesOrder = require_parse_ast_index.BindingChunkModuleOrderBy.ModuleId;
|
|
3904
|
+
break;
|
|
3905
|
+
default: throw new Error(`Unexpected chunkModulesOrder: ${experimental.chunkModulesOrder}`);
|
|
3906
|
+
}
|
|
3907
|
+
return {
|
|
3908
|
+
strictExecutionOrder: experimental?.strictExecutionOrder,
|
|
3909
|
+
disableLiveBindings: experimental?.disableLiveBindings,
|
|
3910
|
+
viteMode: experimental?.viteMode,
|
|
3911
|
+
resolveNewUrlToAsset: experimental?.resolveNewUrlToAsset,
|
|
3912
|
+
hmr: bindingifyHmr(experimental?.hmr),
|
|
3913
|
+
attachDebugInfo: bindingifyAttachDebugInfo(experimental?.attachDebugInfo),
|
|
3914
|
+
chunkModulesOrder
|
|
3915
|
+
};
|
|
3916
|
+
}
|
|
3897
3917
|
function bindingifyResolve(resolve) {
|
|
3918
|
+
const yarnPnp = !!process.versions.pnp;
|
|
3898
3919
|
if (resolve) {
|
|
3899
3920
|
const { alias, extensionAlias,...rest } = resolve;
|
|
3900
3921
|
return {
|
|
@@ -3906,9 +3927,10 @@ function bindingifyResolve(resolve) {
|
|
|
3906
3927
|
target: name,
|
|
3907
3928
|
replacements: value
|
|
3908
3929
|
})) : void 0,
|
|
3930
|
+
yarnPnp,
|
|
3909
3931
|
...rest
|
|
3910
3932
|
};
|
|
3911
|
-
}
|
|
3933
|
+
} else return { yarnPnp };
|
|
3912
3934
|
}
|
|
3913
3935
|
function bindingifyInject(inject) {
|
|
3914
3936
|
if (inject) return Object.entries(inject).map(([alias, item]) => {
|
|
@@ -3952,24 +3974,45 @@ function bindingifyInput(input) {
|
|
|
3952
3974
|
};
|
|
3953
3975
|
});
|
|
3954
3976
|
}
|
|
3955
|
-
function bindingifyJsx(input) {
|
|
3977
|
+
function bindingifyJsx(onLog, input, transform) {
|
|
3978
|
+
if (transform?.jsx) {
|
|
3979
|
+
if (input !== void 0) onLog(LOG_LEVEL_WARN, require_parse_ast_index.logDuplicateJsxConfig());
|
|
3980
|
+
return { transform };
|
|
3981
|
+
}
|
|
3956
3982
|
if (typeof input === "object") {
|
|
3957
|
-
if (input.mode === "preserve") return {
|
|
3983
|
+
if (input.mode === "preserve") return {
|
|
3984
|
+
jsx: require_parse_ast_index.BindingJsx.Preserve,
|
|
3985
|
+
transform
|
|
3986
|
+
};
|
|
3958
3987
|
const mode = input.mode ?? "automatic";
|
|
3959
|
-
|
|
3988
|
+
transform ??= {};
|
|
3989
|
+
transform.jsx = {
|
|
3960
3990
|
runtime: mode,
|
|
3961
3991
|
pragma: input.factory,
|
|
3962
3992
|
pragmaFrag: input.fragment,
|
|
3963
3993
|
importSource: mode === "classic" ? input.importSource : mode === "automatic" ? input.jsxImportSource : void 0
|
|
3964
|
-
}
|
|
3994
|
+
};
|
|
3995
|
+
return { transform };
|
|
3965
3996
|
}
|
|
3997
|
+
let jsx;
|
|
3966
3998
|
switch (input) {
|
|
3967
|
-
case false:
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
case "
|
|
3971
|
-
|
|
3999
|
+
case false:
|
|
4000
|
+
jsx = require_parse_ast_index.BindingJsx.Disable;
|
|
4001
|
+
break;
|
|
4002
|
+
case "react":
|
|
4003
|
+
jsx = require_parse_ast_index.BindingJsx.React;
|
|
4004
|
+
break;
|
|
4005
|
+
case "react-jsx":
|
|
4006
|
+
jsx = require_parse_ast_index.BindingJsx.ReactJsx;
|
|
4007
|
+
break;
|
|
4008
|
+
case "preserve":
|
|
4009
|
+
jsx = require_parse_ast_index.BindingJsx.Preserve;
|
|
4010
|
+
break;
|
|
3972
4011
|
}
|
|
4012
|
+
return {
|
|
4013
|
+
jsx,
|
|
4014
|
+
transform
|
|
4015
|
+
};
|
|
3973
4016
|
}
|
|
3974
4017
|
function bindingifyWatch(watch$1) {
|
|
3975
4018
|
if (watch$1) return {
|
|
@@ -4141,7 +4184,7 @@ async function createBundlerImpl(bundler, inputOptions, outputOptions, isClose)
|
|
|
4141
4184
|
function transformHmrPatchOutput(output) {
|
|
4142
4185
|
handleHmrPatchOutputErrors(output);
|
|
4143
4186
|
const { patch } = output;
|
|
4144
|
-
return patch;
|
|
4187
|
+
return patch ?? void 0;
|
|
4145
4188
|
}
|
|
4146
4189
|
function handleHmrPatchOutputErrors(output) {
|
|
4147
4190
|
const rawErrors = output.errors;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rolldown",
|
|
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
|
"type": "module",
|
|
6
6
|
"homepage": "https://rolldown.rs/",
|
|
@@ -90,13 +90,13 @@
|
|
|
90
90
|
"dtsHeader": "type MaybePromise<T> = T | Promise<T>\ntype Nullable<T> = T | null | undefined\ntype VoidNullable<T = void> = T | null | undefined | void\nexport type BindingStringOrRegex = string | RegExp\n\n"
|
|
91
91
|
},
|
|
92
92
|
"dependencies": {
|
|
93
|
-
"@oxc-project/runtime": "=0.
|
|
94
|
-
"@oxc-project/types": "=0.
|
|
93
|
+
"@oxc-project/runtime": "=0.76.0",
|
|
94
|
+
"@oxc-project/types": "=0.76.0",
|
|
95
95
|
"ansis": "^4.0.0",
|
|
96
|
-
"@rolldown/pluginutils": "1.0.0-beta.
|
|
96
|
+
"@rolldown/pluginutils": "1.0.0-beta.25"
|
|
97
97
|
},
|
|
98
98
|
"devDependencies": {
|
|
99
|
-
"@napi-rs/cli": "3.0.0-alpha.
|
|
99
|
+
"@napi-rs/cli": "3.0.0-alpha.92",
|
|
100
100
|
"@napi-rs/wasm-runtime": "^0.2.10",
|
|
101
101
|
"@oxc-node/cli": "^0.0.29",
|
|
102
102
|
"@rollup/plugin-json": "^6.1.0",
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"emnapi": "^1.2.0",
|
|
107
107
|
"execa": "^9.2.0",
|
|
108
108
|
"glob": "^11.0.0",
|
|
109
|
-
"oxc-parser": "=0.
|
|
109
|
+
"oxc-parser": "=0.76.0",
|
|
110
110
|
"pathe": "^2.0.3",
|
|
111
111
|
"remeda": "^2.10.0",
|
|
112
112
|
"rolldown-plugin-dts": "^0.13.6",
|
|
@@ -118,21 +118,21 @@
|
|
|
118
118
|
"typescript": "^5.7.3",
|
|
119
119
|
"valibot": "1.1.0",
|
|
120
120
|
"@rolldown/testing": "0.0.1",
|
|
121
|
-
"rolldown": "1.0.0-beta.
|
|
121
|
+
"rolldown": "1.0.0-beta.25"
|
|
122
122
|
},
|
|
123
123
|
"optionalDependencies": {
|
|
124
|
-
"@rolldown/binding-darwin-arm64": "1.0.0-beta.
|
|
125
|
-
"@rolldown/binding-
|
|
126
|
-
"@rolldown/binding-
|
|
127
|
-
"@rolldown/binding-linux-
|
|
128
|
-
"@rolldown/binding-linux-arm64-
|
|
129
|
-
"@rolldown/binding-linux-
|
|
130
|
-
"@rolldown/binding-linux-x64-gnu": "1.0.0-beta.
|
|
131
|
-
"@rolldown/binding-
|
|
132
|
-
"@rolldown/binding-
|
|
133
|
-
"@rolldown/binding-win32-
|
|
134
|
-
"@rolldown/binding-win32-
|
|
135
|
-
"@rolldown/binding-win32-x64-msvc": "1.0.0-beta.
|
|
124
|
+
"@rolldown/binding-darwin-arm64": "1.0.0-beta.25",
|
|
125
|
+
"@rolldown/binding-darwin-x64": "1.0.0-beta.25",
|
|
126
|
+
"@rolldown/binding-freebsd-x64": "1.0.0-beta.25",
|
|
127
|
+
"@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.25",
|
|
128
|
+
"@rolldown/binding-linux-arm64-musl": "1.0.0-beta.25",
|
|
129
|
+
"@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.25",
|
|
130
|
+
"@rolldown/binding-linux-x64-gnu": "1.0.0-beta.25",
|
|
131
|
+
"@rolldown/binding-wasm32-wasi": "1.0.0-beta.25",
|
|
132
|
+
"@rolldown/binding-linux-x64-musl": "1.0.0-beta.25",
|
|
133
|
+
"@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.25",
|
|
134
|
+
"@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.25",
|
|
135
|
+
"@rolldown/binding-win32-x64-msvc": "1.0.0-beta.25"
|
|
136
136
|
},
|
|
137
137
|
"scripts": {
|
|
138
138
|
"# Scrips for binding #": "_",
|