@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,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,18 @@ 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
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/utils/normalize-string-or-regex.ts
|
|
34
|
+
function normalizedStringOrRegex(pattern) {
|
|
35
|
+
if (!pattern) return void 0;
|
|
36
|
+
if (!isReadonlyArray(pattern)) return [pattern];
|
|
37
|
+
return pattern;
|
|
38
|
+
}
|
|
39
|
+
function isReadonlyArray(input) {
|
|
40
|
+
return Array.isArray(input);
|
|
41
|
+
}
|
|
31
42
|
|
|
32
43
|
//#endregion
|
|
33
44
|
//#region src/builtin-plugin/utils.ts
|
|
@@ -58,6 +69,10 @@ function modulePreloadPolyfillPlugin(config) {
|
|
|
58
69
|
return new BuiltinPlugin("builtin:module-preload-polyfill", config);
|
|
59
70
|
}
|
|
60
71
|
function dynamicImportVarsPlugin(config) {
|
|
72
|
+
if (config) {
|
|
73
|
+
config.include = normalizedStringOrRegex(config.include);
|
|
74
|
+
config.exclude = normalizedStringOrRegex(config.exclude);
|
|
75
|
+
}
|
|
61
76
|
return new BuiltinPlugin("builtin:dynamic-import-vars", config);
|
|
62
77
|
}
|
|
63
78
|
function importGlobPlugin(config) {
|
|
@@ -709,7 +724,7 @@ function locate(source, search, options) {
|
|
|
709
724
|
|
|
710
725
|
//#endregion
|
|
711
726
|
//#region src/log/logs.ts
|
|
712
|
-
const INVALID_LOG_POSITION = "INVALID_LOG_POSITION", PLUGIN_ERROR = "PLUGIN_ERROR", INPUT_HOOK_IN_OUTPUT_PLUGIN = "INPUT_HOOK_IN_OUTPUT_PLUGIN", CYCLE_LOADING = "CYCLE_LOADING", MULTIPLY_NOTIFY_OPTION = "MULTIPLY_NOTIFY_OPTION", PARSE_ERROR = "PARSE_ERROR";
|
|
727
|
+
const INVALID_LOG_POSITION = "INVALID_LOG_POSITION", PLUGIN_ERROR = "PLUGIN_ERROR", INPUT_HOOK_IN_OUTPUT_PLUGIN = "INPUT_HOOK_IN_OUTPUT_PLUGIN", CYCLE_LOADING = "CYCLE_LOADING", MULTIPLY_NOTIFY_OPTION = "MULTIPLY_NOTIFY_OPTION", PARSE_ERROR = "PARSE_ERROR", DUPLICATE_JSX_CONFIG = "DUPLICATE_JSX_CONFIG";
|
|
713
728
|
function logParseError(message) {
|
|
714
729
|
return {
|
|
715
730
|
code: PARSE_ERROR,
|
|
@@ -740,6 +755,12 @@ function logMultiplyNotifyOption() {
|
|
|
740
755
|
message: `Found multiply notify option at watch options, using first one to start notify watcher.`
|
|
741
756
|
};
|
|
742
757
|
}
|
|
758
|
+
function logDuplicateJsxConfig() {
|
|
759
|
+
return {
|
|
760
|
+
code: DUPLICATE_JSX_CONFIG,
|
|
761
|
+
message: "Both `options.jsx` and `options.transform.jsx` are set so `options.jsx` is ignored"
|
|
762
|
+
};
|
|
763
|
+
}
|
|
743
764
|
function logPluginError(error$1, plugin, { hook, id: id$1 } = {}) {
|
|
744
765
|
try {
|
|
745
766
|
const code$1 = error$1.code;
|
|
@@ -2302,7 +2323,8 @@ const ResolveOptionsSchema = strictObject({
|
|
|
2302
2323
|
mainFiles: optional(array(string())),
|
|
2303
2324
|
modules: optional(array(string())),
|
|
2304
2325
|
symlinks: optional(boolean()),
|
|
2305
|
-
tsconfigFilename: optional(string())
|
|
2326
|
+
tsconfigFilename: optional(string()),
|
|
2327
|
+
yarnPnp: optional(boolean())
|
|
2306
2328
|
});
|
|
2307
2329
|
const TreeshakingOptionsSchema = union([boolean(), looseObject({
|
|
2308
2330
|
annotations: optional(boolean()),
|
|
@@ -2310,6 +2332,7 @@ const TreeshakingOptionsSchema = union([boolean(), looseObject({
|
|
|
2310
2332
|
unknownGlobalSideEffects: optional(boolean()),
|
|
2311
2333
|
commonjs: optional(boolean())
|
|
2312
2334
|
})]);
|
|
2335
|
+
const OptimizationOptionsSchema = strictObject({ inlineConst: pipe(optional(boolean()), description("Enable crossmodule constant inlining")) });
|
|
2313
2336
|
const OnLogSchema = pipe(function_(), args(tuple([
|
|
2314
2337
|
LogLevelSchema,
|
|
2315
2338
|
RollupLogSchema,
|
|
@@ -2335,6 +2358,7 @@ const InputOptionsSchema = strictObject({
|
|
|
2335
2358
|
])), description(`Platform for which the code should be generated (node, ${ansis_default.underline("browser")}, neutral)`)),
|
|
2336
2359
|
shimMissingExports: pipe(optional(boolean()), description("Create shim variables for missing exports")),
|
|
2337
2360
|
treeshake: optional(TreeshakingOptionsSchema),
|
|
2361
|
+
optimization: optional(OptimizationOptionsSchema),
|
|
2338
2362
|
logLevel: pipe(optional(LogLevelOptionSchema), description(`Log level (${ansis_default.dim("silent")}, ${ansis_default.underline(ansis_default.gray("info"))}, debug, ${ansis_default.yellow("warn")})`)),
|
|
2339
2363
|
onLog: optional(OnLogSchema),
|
|
2340
2364
|
onwarn: optional(OnwarnSchema),
|
|
@@ -2350,7 +2374,8 @@ const InputOptionsSchema = strictObject({
|
|
|
2350
2374
|
literal("none"),
|
|
2351
2375
|
literal("simple"),
|
|
2352
2376
|
literal("full")
|
|
2353
|
-
]))
|
|
2377
|
+
])),
|
|
2378
|
+
chunkModulesOrder: optional(union([literal("module-id"), literal("exec-order")]))
|
|
2354
2379
|
})),
|
|
2355
2380
|
define: pipe(optional(record(string(), string())), description("Define global variables")),
|
|
2356
2381
|
inject: optional(record(string(), union([string(), tuple([string(), string()])]))),
|
|
@@ -2491,7 +2516,8 @@ const OutputOptionsSchema = strictObject({
|
|
|
2491
2516
|
}, () => `The 'true' value is not supported`)),
|
|
2492
2517
|
preserveModules: pipe(optional(boolean()), description("Preserve module structure")),
|
|
2493
2518
|
preserveModulesRoot: pipe(optional(string()), description("Put preserved modules under this path at root level")),
|
|
2494
|
-
virtualDirname: optional(string())
|
|
2519
|
+
virtualDirname: optional(string()),
|
|
2520
|
+
minifyInternalExports: pipe(optional(boolean()), description("Minify internal exports"))
|
|
2495
2521
|
});
|
|
2496
2522
|
const getAddonDescription = (placement, wrapper) => {
|
|
2497
2523
|
return `Code to insert the ${ansis_default.bold(placement)} of the bundled file (${ansis_default.bold(wrapper)} the wrapper function)`;
|
|
@@ -2644,19 +2670,6 @@ function transformModuleInfo(info, option) {
|
|
|
2644
2670
|
};
|
|
2645
2671
|
}
|
|
2646
2672
|
|
|
2647
|
-
//#endregion
|
|
2648
|
-
//#region src/utils/transform-side-effects.ts
|
|
2649
|
-
function bindingifySideEffects(sideEffects) {
|
|
2650
|
-
switch (sideEffects) {
|
|
2651
|
-
case true: return BindingHookSideEffects.True;
|
|
2652
|
-
case false: return BindingHookSideEffects.False;
|
|
2653
|
-
case "no-treeshake": return BindingHookSideEffects.NoTreeshake;
|
|
2654
|
-
case null:
|
|
2655
|
-
case void 0: return void 0;
|
|
2656
|
-
default: throw new Error(`Unexpected side effects: ${sideEffects}`);
|
|
2657
|
-
}
|
|
2658
|
-
}
|
|
2659
|
-
|
|
2660
2673
|
//#endregion
|
|
2661
2674
|
//#region src/utils/transform-sourcemap.ts
|
|
2662
2675
|
function isEmptySourcemapFiled(array$1) {
|
|
@@ -2757,7 +2770,7 @@ function exclude(expr) {
|
|
|
2757
2770
|
}
|
|
2758
2771
|
|
|
2759
2772
|
//#endregion
|
|
2760
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
2773
|
+
//#region ../../node_modules/.pnpm/remeda@2.24.0/node_modules/remeda/dist/chunk-D6FCK2GA.js
|
|
2761
2774
|
function u$1(o$1, n$1, a$2) {
|
|
2762
2775
|
let t$1 = (r$1) => o$1(r$1, ...n$1);
|
|
2763
2776
|
return a$2 === void 0 ? t$1 : Object.assign(t$1, {
|
|
@@ -2767,7 +2780,7 @@ function u$1(o$1, n$1, a$2) {
|
|
|
2767
2780
|
}
|
|
2768
2781
|
|
|
2769
2782
|
//#endregion
|
|
2770
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
2783
|
+
//#region ../../node_modules/.pnpm/remeda@2.24.0/node_modules/remeda/dist/chunk-WIMGWYZL.js
|
|
2771
2784
|
function u(r$1, n$1, o$1) {
|
|
2772
2785
|
let a$2 = r$1.length - n$1.length;
|
|
2773
2786
|
if (a$2 === 0) return r$1(...n$1);
|
|
@@ -2776,7 +2789,7 @@ function u(r$1, n$1, o$1) {
|
|
|
2776
2789
|
}
|
|
2777
2790
|
|
|
2778
2791
|
//#endregion
|
|
2779
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
2792
|
+
//#region ../../node_modules/.pnpm/remeda@2.24.0/node_modules/remeda/dist/chunk-3IFJP4R5.js
|
|
2780
2793
|
function d(...r$1) {
|
|
2781
2794
|
return u(i, r$1);
|
|
2782
2795
|
}
|
|
@@ -2943,7 +2956,7 @@ function bindingPluginOrder(order) {
|
|
|
2943
2956
|
}
|
|
2944
2957
|
|
|
2945
2958
|
//#endregion
|
|
2946
|
-
//#region ../../node_modules/.pnpm/oxc-parser@0.
|
|
2959
|
+
//#region ../../node_modules/.pnpm/oxc-parser@0.76.0/node_modules/oxc-parser/wrap.mjs
|
|
2947
2960
|
function wrap$1(result) {
|
|
2948
2961
|
let program, module$1, comments, errors;
|
|
2949
2962
|
return {
|
|
@@ -3054,7 +3067,7 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
|
3054
3067
|
});
|
|
3055
3068
|
data.loadModulePromiseMap.set(id$1, promise$1);
|
|
3056
3069
|
try {
|
|
3057
|
-
await context.load(id$1,
|
|
3070
|
+
await context.load(id$1, options.moduleSideEffects ?? void 0);
|
|
3058
3071
|
} catch (e$1) {
|
|
3059
3072
|
data.loadModulePromiseMap.delete(id$1);
|
|
3060
3073
|
data.loadModulePromiseResolveFnMap.delete(id$1);
|
|
@@ -3074,6 +3087,7 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
|
3074
3087
|
}, void 0);
|
|
3075
3088
|
const res = await this.context.resolve(source, importer, {
|
|
3076
3089
|
custom: receipt,
|
|
3090
|
+
isEntry: options?.isEntry,
|
|
3077
3091
|
skipSelf: options?.skipSelf,
|
|
3078
3092
|
vitePluginCustom
|
|
3079
3093
|
});
|
|
@@ -3083,7 +3097,8 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
|
3083
3097
|
return {
|
|
3084
3098
|
...res,
|
|
3085
3099
|
external: res.external === "relative" ? unreachable(`The PluginContext resolve result external couldn't be 'relative'`) : res.external,
|
|
3086
|
-
...info
|
|
3100
|
+
...info,
|
|
3101
|
+
moduleSideEffects: info.moduleSideEffects ?? res.moduleSideEffects ?? null
|
|
3087
3102
|
};
|
|
3088
3103
|
}
|
|
3089
3104
|
emitFile = (file) => {
|
|
@@ -3207,7 +3222,7 @@ function bindingifyResolveId(args$1) {
|
|
|
3207
3222
|
id: ret.id,
|
|
3208
3223
|
external: ret.external,
|
|
3209
3224
|
normalizeExternalId: false,
|
|
3210
|
-
|
|
3225
|
+
moduleSideEffects: exist.moduleSideEffects ?? void 0
|
|
3211
3226
|
};
|
|
3212
3227
|
},
|
|
3213
3228
|
meta: bindingifyPluginHookMeta(meta),
|
|
@@ -3231,7 +3246,7 @@ function bindingifyResolveDynamicImport(args$1) {
|
|
|
3231
3246
|
id: ret.id,
|
|
3232
3247
|
external: ret.external
|
|
3233
3248
|
};
|
|
3234
|
-
if (ret.moduleSideEffects !== null) result.
|
|
3249
|
+
if (ret.moduleSideEffects !== null) result.moduleSideEffects = ret.moduleSideEffects;
|
|
3235
3250
|
args$1.pluginContextData.updateModuleOption(ret.id, {
|
|
3236
3251
|
meta: ret.meta || {},
|
|
3237
3252
|
moduleSideEffects: ret.moduleSideEffects || null,
|
|
@@ -3259,7 +3274,7 @@ function bindingifyTransform(args$1) {
|
|
|
3259
3274
|
return {
|
|
3260
3275
|
code: ret.code,
|
|
3261
3276
|
map: bindingifySourcemap$1(normalizeTransformHookSourcemap(id$1, code$1, ret.map)),
|
|
3262
|
-
|
|
3277
|
+
moduleSideEffects: moduleOption.moduleSideEffects ?? void 0,
|
|
3263
3278
|
moduleType: ret.moduleType
|
|
3264
3279
|
};
|
|
3265
3280
|
},
|
|
@@ -3286,7 +3301,7 @@ function bindingifyLoad(args$1) {
|
|
|
3286
3301
|
code: ret.code,
|
|
3287
3302
|
map: bindingifySourcemap$1(map),
|
|
3288
3303
|
moduleType: ret.moduleType,
|
|
3289
|
-
|
|
3304
|
+
moduleSideEffects: moduleOption.moduleSideEffects ?? void 0
|
|
3290
3305
|
};
|
|
3291
3306
|
},
|
|
3292
3307
|
meta: bindingifyPluginHookMeta(meta),
|
|
@@ -3940,7 +3955,7 @@ var ChunkingContextImpl = class {
|
|
|
3940
3955
|
//#endregion
|
|
3941
3956
|
//#region src/utils/bindingify-output-options.ts
|
|
3942
3957
|
function bindingifyOutputOptions(outputOptions) {
|
|
3943
|
-
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;
|
|
3944
3959
|
const advancedChunks = bindingifyAdvancedChunks(outputOptions.advancedChunks, manualChunks);
|
|
3945
3960
|
return {
|
|
3946
3961
|
dir,
|
|
@@ -3975,7 +3990,9 @@ function bindingifyOutputOptions(outputOptions) {
|
|
|
3975
3990
|
preserveModules,
|
|
3976
3991
|
virtualDirname,
|
|
3977
3992
|
legalComments,
|
|
3978
|
-
preserveModulesRoot
|
|
3993
|
+
preserveModulesRoot,
|
|
3994
|
+
topLevelVar,
|
|
3995
|
+
minifyInternalExports: outputOptions.minifyInternalExports
|
|
3979
3996
|
};
|
|
3980
3997
|
}
|
|
3981
3998
|
function bindingifyAddon(configAddon) {
|
|
@@ -4144,6 +4161,12 @@ var NormalizedOutputOptionsImpl = class {
|
|
|
4144
4161
|
get virtualDirname() {
|
|
4145
4162
|
return this.inner.virtualDirname;
|
|
4146
4163
|
}
|
|
4164
|
+
get topLevelVar() {
|
|
4165
|
+
return this.inner.topLevelVar ?? false;
|
|
4166
|
+
}
|
|
4167
|
+
get minifyInternalExports() {
|
|
4168
|
+
return this.inner.minifyInternalExports ?? false;
|
|
4169
|
+
}
|
|
4147
4170
|
};
|
|
4148
4171
|
function normalizeAddon(value) {
|
|
4149
4172
|
if (typeof value === "function") return value;
|
|
@@ -4254,17 +4277,6 @@ var PluginContextData = class {
|
|
|
4254
4277
|
}
|
|
4255
4278
|
};
|
|
4256
4279
|
|
|
4257
|
-
//#endregion
|
|
4258
|
-
//#region src/utils/normalize-string-or-regex.ts
|
|
4259
|
-
function normalizedStringOrRegex(pattern) {
|
|
4260
|
-
if (!pattern) return void 0;
|
|
4261
|
-
if (!isReadonlyArray(pattern)) return [pattern];
|
|
4262
|
-
return pattern;
|
|
4263
|
-
}
|
|
4264
|
-
function isReadonlyArray(input) {
|
|
4265
|
-
return Array.isArray(input);
|
|
4266
|
-
}
|
|
4267
|
-
|
|
4268
4280
|
//#endregion
|
|
4269
4281
|
//#region src/utils/bindingify-input-options.ts
|
|
4270
4282
|
function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normalizedOutputPlugins, onLog, logLevel, watchMode) {
|
|
@@ -4274,8 +4286,7 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
4274
4286
|
if (plugin instanceof BuiltinPlugin) return bindingifyBuiltInPlugin(plugin);
|
|
4275
4287
|
return bindingifyPlugin(plugin, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode);
|
|
4276
4288
|
});
|
|
4277
|
-
const { jsx,
|
|
4278
|
-
const transform = inputOptions.transform || jsxTransform;
|
|
4289
|
+
const { jsx, transform } = bindingifyJsx(onLog, inputOptions.jsx, inputOptions.transform);
|
|
4279
4290
|
return {
|
|
4280
4291
|
input: bindingifyInput(inputOptions.input),
|
|
4281
4292
|
plugins,
|
|
@@ -4290,14 +4301,7 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
4290
4301
|
moduleTypes: inputOptions.moduleTypes,
|
|
4291
4302
|
define: inputOptions.define ? Object.entries(inputOptions.define) : void 0,
|
|
4292
4303
|
inject: bindingifyInject(inputOptions.inject),
|
|
4293
|
-
experimental:
|
|
4294
|
-
strictExecutionOrder: inputOptions.experimental?.strictExecutionOrder,
|
|
4295
|
-
disableLiveBindings: inputOptions.experimental?.disableLiveBindings,
|
|
4296
|
-
viteMode: inputOptions.experimental?.viteMode,
|
|
4297
|
-
resolveNewUrlToAsset: inputOptions.experimental?.resolveNewUrlToAsset,
|
|
4298
|
-
hmr: bindingifyHmr(inputOptions.experimental?.hmr),
|
|
4299
|
-
attachDebugInfo: bindingifyAttachDebugInfo(inputOptions.experimental?.attachDebugInfo)
|
|
4300
|
-
},
|
|
4304
|
+
experimental: bindingifyExperimental(inputOptions.experimental),
|
|
4301
4305
|
profilerNames: inputOptions?.profilerNames,
|
|
4302
4306
|
jsx,
|
|
4303
4307
|
transform,
|
|
@@ -4310,7 +4314,7 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
4310
4314
|
pluginContextData.moduleOptionMap.forEach((value, key) => {
|
|
4311
4315
|
if (value.invalidate) ret.push({
|
|
4312
4316
|
id: key,
|
|
4313
|
-
sideEffects:
|
|
4317
|
+
sideEffects: value.moduleSideEffects ?? void 0
|
|
4314
4318
|
});
|
|
4315
4319
|
});
|
|
4316
4320
|
return ret;
|
|
@@ -4319,7 +4323,8 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
4319
4323
|
debug: inputOptions.debug,
|
|
4320
4324
|
invalidateJsSideCache: pluginContextData.clear.bind(pluginContextData),
|
|
4321
4325
|
markModuleLoaded: pluginContextData.markModuleLoaded.bind(pluginContextData),
|
|
4322
|
-
preserveEntrySignatures: bindingifyPreserveEntrySignatures(inputOptions.preserveEntrySignatures)
|
|
4326
|
+
preserveEntrySignatures: bindingifyPreserveEntrySignatures(inputOptions.preserveEntrySignatures),
|
|
4327
|
+
optimization: inputOptions.optimization
|
|
4323
4328
|
};
|
|
4324
4329
|
}
|
|
4325
4330
|
function bindingifyHmr(hmr) {
|
|
@@ -4351,7 +4356,29 @@ function bindingifyExternal(external) {
|
|
|
4351
4356
|
};
|
|
4352
4357
|
}
|
|
4353
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
|
+
}
|
|
4354
4380
|
function bindingifyResolve(resolve$1) {
|
|
4381
|
+
const yarnPnp = !!process.versions.pnp;
|
|
4355
4382
|
if (resolve$1) {
|
|
4356
4383
|
const { alias, extensionAlias,...rest } = resolve$1;
|
|
4357
4384
|
return {
|
|
@@ -4363,9 +4390,10 @@ function bindingifyResolve(resolve$1) {
|
|
|
4363
4390
|
target: name,
|
|
4364
4391
|
replacements: value
|
|
4365
4392
|
})) : void 0,
|
|
4393
|
+
yarnPnp,
|
|
4366
4394
|
...rest
|
|
4367
4395
|
};
|
|
4368
|
-
}
|
|
4396
|
+
} else return { yarnPnp };
|
|
4369
4397
|
}
|
|
4370
4398
|
function bindingifyInject(inject) {
|
|
4371
4399
|
if (inject) return Object.entries(inject).map(([alias, item]) => {
|
|
@@ -4409,24 +4437,45 @@ function bindingifyInput(input) {
|
|
|
4409
4437
|
};
|
|
4410
4438
|
});
|
|
4411
4439
|
}
|
|
4412
|
-
function bindingifyJsx(input) {
|
|
4440
|
+
function bindingifyJsx(onLog, input, transform) {
|
|
4441
|
+
if (transform?.jsx) {
|
|
4442
|
+
if (input !== void 0) onLog(LOG_LEVEL_WARN, logDuplicateJsxConfig());
|
|
4443
|
+
return { transform };
|
|
4444
|
+
}
|
|
4413
4445
|
if (typeof input === "object") {
|
|
4414
|
-
if (input.mode === "preserve") return {
|
|
4446
|
+
if (input.mode === "preserve") return {
|
|
4447
|
+
jsx: BindingJsx.Preserve,
|
|
4448
|
+
transform
|
|
4449
|
+
};
|
|
4415
4450
|
const mode = input.mode ?? "automatic";
|
|
4416
|
-
|
|
4451
|
+
transform ??= {};
|
|
4452
|
+
transform.jsx = {
|
|
4417
4453
|
runtime: mode,
|
|
4418
4454
|
pragma: input.factory,
|
|
4419
4455
|
pragmaFrag: input.fragment,
|
|
4420
4456
|
importSource: mode === "classic" ? input.importSource : mode === "automatic" ? input.jsxImportSource : void 0
|
|
4421
|
-
}
|
|
4457
|
+
};
|
|
4458
|
+
return { transform };
|
|
4422
4459
|
}
|
|
4460
|
+
let jsx;
|
|
4423
4461
|
switch (input) {
|
|
4424
|
-
case false:
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
case "
|
|
4428
|
-
|
|
4462
|
+
case false:
|
|
4463
|
+
jsx = BindingJsx.Disable;
|
|
4464
|
+
break;
|
|
4465
|
+
case "react":
|
|
4466
|
+
jsx = BindingJsx.React;
|
|
4467
|
+
break;
|
|
4468
|
+
case "react-jsx":
|
|
4469
|
+
jsx = BindingJsx.ReactJsx;
|
|
4470
|
+
break;
|
|
4471
|
+
case "preserve":
|
|
4472
|
+
jsx = BindingJsx.Preserve;
|
|
4473
|
+
break;
|
|
4429
4474
|
}
|
|
4475
|
+
return {
|
|
4476
|
+
jsx,
|
|
4477
|
+
transform
|
|
4478
|
+
};
|
|
4430
4479
|
}
|
|
4431
4480
|
function bindingifyWatch(watch$1) {
|
|
4432
4481
|
if (watch$1) return {
|
|
@@ -4536,7 +4585,7 @@ async function createBundlerImpl(bundler, inputOptions, outputOptions, isClose)
|
|
|
4536
4585
|
function transformHmrPatchOutput(output) {
|
|
4537
4586
|
handleHmrPatchOutputErrors(output);
|
|
4538
4587
|
const { patch } = output;
|
|
4539
|
-
return patch;
|
|
4588
|
+
return patch ?? void 0;
|
|
4540
4589
|
}
|
|
4541
4590
|
function handleHmrPatchOutputErrors(output) {
|
|
4542
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",
|