rolldown 1.0.0-beta.35 → 1.0.0-beta.37
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.mjs +95 -1068
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +3 -3
- package/dist/experimental-index.d.mts +43 -5
- package/dist/experimental-index.mjs +31 -8
- package/dist/filter-index.d.mts +2 -2
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +2 -2
- package/dist/parallel-plugin-worker.mjs +3 -4
- package/dist/parallel-plugin.d.mts +2 -2
- package/dist/parse-ast-index.d.mts +1 -1
- package/dist/parse-ast-index.mjs +1 -1
- package/dist/shared/{binding-9k0egz6L.d.mts → binding-Cjs27cfu.d.mts} +1 -0
- package/dist/shared/{define-config-DhrkZ_o7.d.cts → define-config-CV3aiNwN.d.mts} +9 -9
- package/dist/shared/{load-config-C93_L4MP.mjs → load-config-BOVuTpJm.mjs} +4 -6
- package/dist/{cli.cjs → shared/logger-CiCY7ucm.mjs} +44 -829
- package/dist/shared/parse-ast-index-B5HcAOhq.mjs +10847 -0
- package/dist/shared/{prompt-C5jz26Zn.mjs → prompt-D2FxOcB5.mjs} +4 -7
- package/dist/shared/{src-D954P1TH.mjs → src-BtNlw_84.mjs} +88 -69
- package/package.json +32 -46
- package/dist/cli.d.cts +0 -1
- package/dist/config.cjs +0 -12
- package/dist/config.d.cts +0 -10
- package/dist/experimental-index.cjs +0 -154
- package/dist/experimental-index.d.cts +0 -99
- package/dist/filter-index.cjs +0 -106
- package/dist/filter-index.d.cts +0 -4
- package/dist/index.cjs +0 -9
- package/dist/index.d.cts +0 -3
- package/dist/parallel-plugin-worker.cjs +0 -33
- package/dist/parallel-plugin-worker.d.cts +0 -1
- package/dist/parallel-plugin.cjs +0 -8
- package/dist/parallel-plugin.d.cts +0 -14
- package/dist/parse-ast-index.cjs +0 -4
- package/dist/parse-ast-index.d.cts +0 -8
- package/dist/shared/binding-D13M6Llu.d.cts +0 -1425
- package/dist/shared/chunk-DDkG_k5U.cjs +0 -39
- package/dist/shared/define-config-3arq8OPE.d.mts +0 -1421
- package/dist/shared/load-config-S_ofSLrj.cjs +0 -130
- package/dist/shared/misc-DksvspN4.cjs +0 -58
- package/dist/shared/parse-ast-index-BadydpMA.mjs +0 -725
- package/dist/shared/parse-ast-index-cePJvlvW.cjs +0 -871
- package/dist/shared/prompt-Q05EYrFb.cjs +0 -858
- package/dist/shared/src-BBMxhaqf.cjs +0 -4673
|
@@ -137,8 +137,7 @@ function requirePicocolors() {
|
|
|
137
137
|
picocolors.exports.createColors = createColors;
|
|
138
138
|
return picocolors.exports;
|
|
139
139
|
}
|
|
140
|
-
|
|
141
|
-
const e = /* @__PURE__ */ getDefaultExportFromCjs(picocolorsExports);
|
|
140
|
+
const e = /* @__PURE__ */ getDefaultExportFromCjs(/* @__PURE__ */ requirePicocolors());
|
|
142
141
|
function J({ onlyFirst: t = false } = {}) {
|
|
143
142
|
const F$1 = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
|
|
144
143
|
return new RegExp(F$1, t ? void 0 : "g");
|
|
@@ -596,12 +595,10 @@ let wD = class extends x {
|
|
|
596
595
|
return this.options[this.cursor].value;
|
|
597
596
|
}
|
|
598
597
|
toggleAll() {
|
|
599
|
-
|
|
600
|
-
this.value = u$1 ? [] : this.options.map((F$1) => F$1.value);
|
|
598
|
+
this.value = this.value.length === this.options.length ? [] : this.options.map((F$1) => F$1.value);
|
|
601
599
|
}
|
|
602
600
|
toggleValue() {
|
|
603
|
-
|
|
604
|
-
this.value = u$1 ? this.value.filter((F$1) => F$1 !== this._value) : [...this.value, this._value];
|
|
601
|
+
this.value = this.value.includes(this._value) ? this.value.filter((F$1) => F$1 !== this._value) : [...this.value, this._value];
|
|
605
602
|
}
|
|
606
603
|
};
|
|
607
604
|
var SD = Object.defineProperty, $D = (t, u$1, F$1) => u$1 in t ? SD(t, u$1, {
|
|
@@ -811,7 +808,7 @@ async function prompt(message, opts = {}) {
|
|
|
811
808
|
if (Error.captureStackTrace) Error.captureStackTrace(error, prompt);
|
|
812
809
|
throw error;
|
|
813
810
|
}
|
|
814
|
-
case "undefined": return
|
|
811
|
+
case "undefined": return;
|
|
815
812
|
case "null": return null;
|
|
816
813
|
case "symbol": return kCancel;
|
|
817
814
|
default:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BindingAttachDebugInfo, BindingBundler, BindingCallableBuiltinPlugin, BindingChunkModuleOrderBy, BindingJsx, BindingLogLevel, BindingPluginOrder, BindingPropertyReadSideEffects, BindingPropertyWriteSideEffects, BindingWatcher, ParallelJsPluginRegistry, augmentCodeLocation, error, logCycleLoading, logDuplicateJsxConfig, logInputHookInOutputPlugin, logInvalidLogPosition, logMultiplyNotifyOption, logPluginError, parseAst, shutdownAsyncRuntime, startAsyncRuntime } from "./parse-ast-index-
|
|
1
|
+
import { BindingAttachDebugInfo, BindingBundler, BindingCallableBuiltinPlugin, BindingChunkModuleOrderBy, BindingJsx, BindingLogLevel, BindingPluginOrder, BindingPropertyReadSideEffects, BindingPropertyWriteSideEffects, BindingWatcher, ParallelJsPluginRegistry, augmentCodeLocation, error, logCycleLoading, logDuplicateJsxConfig, logInputHookInOutputPlugin, logInvalidLogPosition, logMultiplyNotifyOption, logPluginError, parseAst, shutdownAsyncRuntime, startAsyncRuntime } from "./parse-ast-index-B5HcAOhq.mjs";
|
|
2
2
|
import { arraify, noop, unimplemented, unreachable, unsupported } from "./misc-CQeo-AFx.mjs";
|
|
3
3
|
import { Worker } from "node:worker_threads";
|
|
4
4
|
import path from "node:path";
|
|
@@ -9,25 +9,17 @@ import fsp from "node:fs/promises";
|
|
|
9
9
|
import os from "node:os";
|
|
10
10
|
|
|
11
11
|
//#region package.json
|
|
12
|
-
var version = "1.0.0-beta.
|
|
12
|
+
var version = "1.0.0-beta.37";
|
|
13
13
|
var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
14
14
|
|
|
15
15
|
//#endregion
|
|
16
16
|
//#region src/builtin-plugin/utils.ts
|
|
17
|
-
const BuiltinClassSymbol = Symbol.for("__RolldownBuiltinPlugin__");
|
|
18
17
|
var BuiltinPlugin = class {
|
|
19
18
|
constructor(name, _options) {
|
|
20
19
|
this.name = name;
|
|
21
20
|
this._options = _options;
|
|
22
|
-
this[BuiltinClassSymbol] = true;
|
|
23
21
|
}
|
|
24
22
|
};
|
|
25
|
-
function isBuiltinPlugin(obj) {
|
|
26
|
-
return obj && obj[BuiltinClassSymbol] === true;
|
|
27
|
-
}
|
|
28
|
-
function createBuiltinPlugin(name, options) {
|
|
29
|
-
return new BuiltinPlugin(name, options);
|
|
30
|
-
}
|
|
31
23
|
function makeBuiltinPluginCallable(plugin) {
|
|
32
24
|
let callablePlugin = new BindingCallableBuiltinPlugin(bindingifyBuiltInPlugin(plugin));
|
|
33
25
|
const wrappedPlugin = plugin;
|
|
@@ -85,8 +77,7 @@ function getLogHandler(level, code, logger, pluginName, logLevel) {
|
|
|
85
77
|
function getLogger(plugins, onLog, logLevel, watchMode) {
|
|
86
78
|
const minimalPriority = logLevelPriority[logLevel];
|
|
87
79
|
const logger = (level, log, skipped = /* @__PURE__ */ new Set()) => {
|
|
88
|
-
|
|
89
|
-
if (logPriority < minimalPriority) return;
|
|
80
|
+
if (logLevelPriority[level] < minimalPriority) return;
|
|
90
81
|
for (const plugin of getSortedPlugins("onLog", plugins)) {
|
|
91
82
|
if (skipped.has(plugin)) continue;
|
|
92
83
|
const { onLog: pluginOnLog } = plugin;
|
|
@@ -95,8 +86,7 @@ function getLogger(plugins, onLog, logLevel, watchMode) {
|
|
|
95
86
|
if (logLevelPriority[level$1] < minimalPriority) return () => {};
|
|
96
87
|
return (log$1) => logger(level$1, normalizeLog(log$1), new Set(skipped).add(plugin));
|
|
97
88
|
};
|
|
98
|
-
|
|
99
|
-
if (handler.call({
|
|
89
|
+
if (("handler" in pluginOnLog ? pluginOnLog.handler : pluginOnLog).call({
|
|
100
90
|
debug: getLogHandler$1(LOG_LEVEL_DEBUG),
|
|
101
91
|
error: (log$1) => error(normalizeLog(log$1)),
|
|
102
92
|
info: getLogHandler$1(LOG_LEVEL_INFO),
|
|
@@ -178,7 +168,7 @@ function normalizeHook(hook) {
|
|
|
178
168
|
//#endregion
|
|
179
169
|
//#region src/utils/normalize-string-or-regex.ts
|
|
180
170
|
function normalizedStringOrRegex(pattern) {
|
|
181
|
-
if (!pattern) return
|
|
171
|
+
if (!pattern) return;
|
|
182
172
|
if (!isReadonlyArray(pattern)) return [pattern];
|
|
183
173
|
return pattern;
|
|
184
174
|
}
|
|
@@ -189,59 +179,59 @@ function isReadonlyArray(input) {
|
|
|
189
179
|
//#endregion
|
|
190
180
|
//#region src/builtin-plugin/constructors.ts
|
|
191
181
|
function modulePreloadPolyfillPlugin(config) {
|
|
192
|
-
return
|
|
182
|
+
return new BuiltinPlugin("builtin:module-preload-polyfill", config);
|
|
193
183
|
}
|
|
194
184
|
function dynamicImportVarsPlugin(config) {
|
|
195
185
|
if (config) {
|
|
196
186
|
config.include = normalizedStringOrRegex(config.include);
|
|
197
187
|
config.exclude = normalizedStringOrRegex(config.exclude);
|
|
198
188
|
}
|
|
199
|
-
return
|
|
189
|
+
return new BuiltinPlugin("builtin:dynamic-import-vars", config);
|
|
200
190
|
}
|
|
201
191
|
function importGlobPlugin(config) {
|
|
202
|
-
return
|
|
192
|
+
return new BuiltinPlugin("builtin:import-glob", config);
|
|
203
193
|
}
|
|
204
194
|
function reporterPlugin(config) {
|
|
205
|
-
return
|
|
195
|
+
return new BuiltinPlugin("builtin:reporter", config);
|
|
206
196
|
}
|
|
207
197
|
function manifestPlugin(config) {
|
|
208
|
-
return
|
|
198
|
+
return new BuiltinPlugin("builtin:manifest", config);
|
|
209
199
|
}
|
|
210
200
|
function wasmHelperPlugin(config) {
|
|
211
|
-
return
|
|
201
|
+
return new BuiltinPlugin("builtin:wasm-helper", config);
|
|
212
202
|
}
|
|
213
203
|
function wasmFallbackPlugin() {
|
|
214
|
-
const builtinPlugin =
|
|
204
|
+
const builtinPlugin = new BuiltinPlugin("builtin:wasm-fallback");
|
|
215
205
|
return makeBuiltinPluginCallable(builtinPlugin);
|
|
216
206
|
}
|
|
217
207
|
function loadFallbackPlugin() {
|
|
218
|
-
return
|
|
208
|
+
return new BuiltinPlugin("builtin:load-fallback");
|
|
219
209
|
}
|
|
220
210
|
function jsonPlugin(config) {
|
|
221
|
-
const builtinPlugin =
|
|
211
|
+
const builtinPlugin = new BuiltinPlugin("builtin:json", config);
|
|
222
212
|
return makeBuiltinPluginCallable(builtinPlugin);
|
|
223
213
|
}
|
|
224
214
|
function buildImportAnalysisPlugin(config) {
|
|
225
|
-
return
|
|
215
|
+
return new BuiltinPlugin("builtin:build-import-analysis", config);
|
|
226
216
|
}
|
|
227
217
|
function viteResolvePlugin(config) {
|
|
228
|
-
const builtinPlugin =
|
|
218
|
+
const builtinPlugin = new BuiltinPlugin("builtin:vite-resolve", config);
|
|
229
219
|
return makeBuiltinPluginCallable(builtinPlugin);
|
|
230
220
|
}
|
|
231
221
|
function isolatedDeclarationPlugin(config) {
|
|
232
|
-
return
|
|
222
|
+
return new BuiltinPlugin("builtin:isolated-declaration", config);
|
|
233
223
|
}
|
|
234
224
|
function assetPlugin(config) {
|
|
235
|
-
return
|
|
225
|
+
return new BuiltinPlugin("builtin:asset", config);
|
|
236
226
|
}
|
|
237
227
|
function webWorkerPostPlugin() {
|
|
238
|
-
return
|
|
228
|
+
return new BuiltinPlugin("builtin:web-worker-post");
|
|
239
229
|
}
|
|
240
230
|
function oxcRuntimePlugin(config) {
|
|
241
|
-
return
|
|
231
|
+
return new BuiltinPlugin("builtin:oxc-runtime", config);
|
|
242
232
|
}
|
|
243
233
|
function esmExternalRequirePlugin(config) {
|
|
244
|
-
return
|
|
234
|
+
return new BuiltinPlugin("builtin:esm-external-require", config);
|
|
245
235
|
}
|
|
246
236
|
|
|
247
237
|
//#endregion
|
|
@@ -335,7 +325,7 @@ function checkOutputPluginOption(plugins, onLog) {
|
|
|
335
325
|
function normalizePlugins(plugins, anonymousPrefix) {
|
|
336
326
|
for (const [index, plugin] of plugins.entries()) {
|
|
337
327
|
if ("_parallel" in plugin) continue;
|
|
338
|
-
if (
|
|
328
|
+
if (plugin instanceof BuiltinPlugin) continue;
|
|
339
329
|
if (!plugin.name) plugin.name = `${anonymousPrefix}${index + 1}`;
|
|
340
330
|
}
|
|
341
331
|
return plugins;
|
|
@@ -402,9 +392,9 @@ var PluginDriver = class {
|
|
|
402
392
|
};
|
|
403
393
|
function getObjectPlugins(plugins) {
|
|
404
394
|
return plugins.filter((plugin) => {
|
|
405
|
-
if (!plugin) return
|
|
406
|
-
if ("_parallel" in plugin) return
|
|
407
|
-
if (
|
|
395
|
+
if (!plugin) return;
|
|
396
|
+
if ("_parallel" in plugin) return;
|
|
397
|
+
if (plugin instanceof BuiltinPlugin) return;
|
|
408
398
|
return plugin;
|
|
409
399
|
});
|
|
410
400
|
}
|
|
@@ -1942,10 +1932,43 @@ const ChecksOptionsSchema = strictObject({
|
|
|
1942
1932
|
configurationFieldConflict: pipe(optional(boolean()), description("Whether to emit warning when detecting configuration field conflict")),
|
|
1943
1933
|
preferBuiltinFeature: pipe(optional(boolean()), description("Whether to emit warning when detecting prefer builtin feature"))
|
|
1944
1934
|
});
|
|
1935
|
+
const CompressOptionsKeepNamesSchema = strictObject({
|
|
1936
|
+
function: optional(boolean()),
|
|
1937
|
+
class: optional(boolean())
|
|
1938
|
+
});
|
|
1939
|
+
const CompressOptionsSchema = strictObject({
|
|
1940
|
+
target: optional(union([
|
|
1941
|
+
literal("esnext"),
|
|
1942
|
+
literal("es2015"),
|
|
1943
|
+
literal("es2016"),
|
|
1944
|
+
literal("es2017"),
|
|
1945
|
+
literal("es2018"),
|
|
1946
|
+
literal("es2019"),
|
|
1947
|
+
literal("es2020"),
|
|
1948
|
+
literal("es2021"),
|
|
1949
|
+
literal("es2022"),
|
|
1950
|
+
literal("es2023"),
|
|
1951
|
+
literal("es2024")
|
|
1952
|
+
])),
|
|
1953
|
+
dropConsole: optional(boolean()),
|
|
1954
|
+
dropDebugger: optional(boolean()),
|
|
1955
|
+
keepNames: optional(CompressOptionsKeepNamesSchema),
|
|
1956
|
+
unused: optional(union([boolean(), literal("keep_assign")]))
|
|
1957
|
+
});
|
|
1958
|
+
const MangleOptionsKeepNamesSchema = strictObject({
|
|
1959
|
+
function: optional(boolean()),
|
|
1960
|
+
class: optional(boolean())
|
|
1961
|
+
});
|
|
1962
|
+
const MangleOptionsSchema = strictObject({
|
|
1963
|
+
toplevel: optional(boolean()),
|
|
1964
|
+
keepNames: optional(union([boolean(), MangleOptionsKeepNamesSchema])),
|
|
1965
|
+
debug: optional(boolean())
|
|
1966
|
+
});
|
|
1967
|
+
const CodegenOptionsSchema = strictObject({ removeWhitespace: optional(boolean()) });
|
|
1945
1968
|
const MinifyOptionsSchema = strictObject({
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1969
|
+
compress: optional(union([boolean(), CompressOptionsSchema])),
|
|
1970
|
+
mangle: optional(union([boolean(), MangleOptionsSchema])),
|
|
1971
|
+
codegen: optional(union([boolean(), CodegenOptionsSchema]))
|
|
1949
1972
|
});
|
|
1950
1973
|
const ResolveOptionsSchema = strictObject({
|
|
1951
1974
|
alias: optional(record(string(), union([string(), array(string())]))),
|
|
@@ -2219,8 +2242,7 @@ const CliOptionsSchema = strictObject({
|
|
|
2219
2242
|
function validateCliOptions(options) {
|
|
2220
2243
|
let parsed = safeParse(CliOptionsSchema, options);
|
|
2221
2244
|
return [parsed.output, parsed.issues?.map((issue) => {
|
|
2222
|
-
|
|
2223
|
-
return `Invalid value for option ${option}: ${issue.message}`;
|
|
2245
|
+
return `Invalid value for option ${issue.path?.map((pathItem) => pathItem.key).join(" ")}: ${issue.message}`;
|
|
2224
2246
|
})];
|
|
2225
2247
|
}
|
|
2226
2248
|
const inputHelperMsgRecord = {
|
|
@@ -2411,7 +2433,7 @@ function generateAtomMatcher(kind, matcher) {
|
|
|
2411
2433
|
return kind === "code" ? filter.code(matcher) : filter.id(matcher);
|
|
2412
2434
|
}
|
|
2413
2435
|
function transformFilterMatcherToFilterExprs(filterOption) {
|
|
2414
|
-
if (!filterOption) return
|
|
2436
|
+
if (!filterOption) return;
|
|
2415
2437
|
if (Array.isArray(filterOption)) return filterOption;
|
|
2416
2438
|
const { id, code, moduleType } = filterOption;
|
|
2417
2439
|
let ret = [];
|
|
@@ -2509,24 +2531,24 @@ function bindingifyFilterExprImpl(expr, list) {
|
|
|
2509
2531
|
}
|
|
2510
2532
|
}
|
|
2511
2533
|
function bindingifyResolveIdFilter(filterOption) {
|
|
2512
|
-
if (!filterOption) return
|
|
2534
|
+
if (!filterOption) return;
|
|
2513
2535
|
if (Array.isArray(filterOption)) return { value: filterOption.map(bindingifyFilterExpr) };
|
|
2514
2536
|
return filterOption.id ? bindingifyGeneralHookFilter("id", filterOption.id) : void 0;
|
|
2515
2537
|
}
|
|
2516
2538
|
function bindingifyLoadFilter(filterOption) {
|
|
2517
|
-
if (!filterOption) return
|
|
2539
|
+
if (!filterOption) return;
|
|
2518
2540
|
if (Array.isArray(filterOption)) return { value: filterOption.map(bindingifyFilterExpr) };
|
|
2519
2541
|
return filterOption.id ? bindingifyGeneralHookFilter("id", filterOption.id) : void 0;
|
|
2520
2542
|
}
|
|
2521
2543
|
function bindingifyTransformFilter(filterOption) {
|
|
2522
|
-
if (!filterOption) return
|
|
2544
|
+
if (!filterOption) return;
|
|
2523
2545
|
let filterExprs = transformFilterMatcherToFilterExprs(filterOption);
|
|
2524
2546
|
let ret = [];
|
|
2525
2547
|
if (filterExprs) ret = filterExprs.map(bindingifyFilterExpr);
|
|
2526
2548
|
return { value: ret.length > 0 ? ret : void 0 };
|
|
2527
2549
|
}
|
|
2528
2550
|
function bindingifyRenderChunkFilter(filterOption) {
|
|
2529
|
-
if (!filterOption) return
|
|
2551
|
+
if (!filterOption) return;
|
|
2530
2552
|
if (Array.isArray(filterOption)) return { value: filterOption.map(bindingifyFilterExpr) };
|
|
2531
2553
|
return filterOption.code ? bindingifyGeneralHookFilter("code", filterOption.code) : void 0;
|
|
2532
2554
|
}
|
|
@@ -2541,7 +2563,7 @@ function bindingPluginOrder(order) {
|
|
|
2541
2563
|
case "post": return BindingPluginOrder.Post;
|
|
2542
2564
|
case "pre": return BindingPluginOrder.Pre;
|
|
2543
2565
|
case null:
|
|
2544
|
-
case void 0: return
|
|
2566
|
+
case void 0: return;
|
|
2545
2567
|
default: throw new Error(`Unknown plugin order: ${order}`);
|
|
2546
2568
|
}
|
|
2547
2569
|
}
|
|
@@ -2708,6 +2730,9 @@ var TransformPluginContextImpl = class extends PluginContextImpl {
|
|
|
2708
2730
|
getCombinedSourcemap() {
|
|
2709
2731
|
return JSON.parse(this.inner.getCombinedSourcemap());
|
|
2710
2732
|
}
|
|
2733
|
+
addWatchFile(id) {
|
|
2734
|
+
this.inner.addWatchFile(id);
|
|
2735
|
+
}
|
|
2711
2736
|
};
|
|
2712
2737
|
|
|
2713
2738
|
//#endregion
|
|
@@ -2807,7 +2832,7 @@ function bindingifyTransform(args$1) {
|
|
|
2807
2832
|
return {
|
|
2808
2833
|
plugin: async (ctx, code, id, meta$1) => {
|
|
2809
2834
|
const ret = await handler.call(new TransformPluginContextImpl(args$1.outputOptions, ctx.inner(), args$1.plugin, args$1.pluginContextData, ctx, id, code, args$1.onLog, args$1.logLevel, args$1.watchMode), code, id, meta$1);
|
|
2810
|
-
if (ret == null) return
|
|
2835
|
+
if (ret == null) return;
|
|
2811
2836
|
if (typeof ret === "string") return { code: ret };
|
|
2812
2837
|
let moduleOption = args$1.pluginContextData.updateModuleOption(id, {
|
|
2813
2838
|
meta: ret.meta ?? {},
|
|
@@ -2941,9 +2966,8 @@ function transformChunkModules(modules) {
|
|
|
2941
2966
|
//#endregion
|
|
2942
2967
|
//#region src/utils/transform-to-rollup-output.ts
|
|
2943
2968
|
function transformToRollupSourceMap(map) {
|
|
2944
|
-
const parsed = JSON.parse(map);
|
|
2945
2969
|
const obj = {
|
|
2946
|
-
...
|
|
2970
|
+
...JSON.parse(map),
|
|
2947
2971
|
toString() {
|
|
2948
2972
|
return JSON.stringify(obj);
|
|
2949
2973
|
},
|
|
@@ -3485,13 +3509,10 @@ var ChunkingContextImpl = class {
|
|
|
3485
3509
|
}
|
|
3486
3510
|
getModuleInfo(moduleId) {
|
|
3487
3511
|
const bindingInfo = this.context.getModuleInfo(moduleId);
|
|
3488
|
-
if (bindingInfo) {
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
});
|
|
3493
|
-
return info;
|
|
3494
|
-
}
|
|
3512
|
+
if (bindingInfo) return transformModuleInfo(bindingInfo, {
|
|
3513
|
+
moduleSideEffects: null,
|
|
3514
|
+
meta: {}
|
|
3515
|
+
});
|
|
3495
3516
|
return null;
|
|
3496
3517
|
}
|
|
3497
3518
|
};
|
|
@@ -3564,7 +3585,7 @@ function bindingifySourcemap(sourcemap) {
|
|
|
3564
3585
|
case true: return "file";
|
|
3565
3586
|
case "inline": return "inline";
|
|
3566
3587
|
case false:
|
|
3567
|
-
case void 0: return
|
|
3588
|
+
case void 0: return;
|
|
3568
3589
|
case "hidden": return "hidden";
|
|
3569
3590
|
default: throw new Error(`unknown sourcemap: ${sourcemap}`);
|
|
3570
3591
|
}
|
|
@@ -3590,7 +3611,7 @@ function bindingifyAdvancedChunks(advancedChunks, manualChunks) {
|
|
|
3590
3611
|
else if (manualChunks != null) advancedChunks = { groups: [{ name(moduleId, ctx) {
|
|
3591
3612
|
return manualChunks(moduleId, { getModuleInfo: (id) => ctx.getModuleInfo(id) });
|
|
3592
3613
|
} }] };
|
|
3593
|
-
if (advancedChunks == null) return
|
|
3614
|
+
if (advancedChunks == null) return;
|
|
3594
3615
|
const { groups,...restAdvancedChunks } = advancedChunks;
|
|
3595
3616
|
return {
|
|
3596
3617
|
...restAdvancedChunks,
|
|
@@ -3794,8 +3815,7 @@ var PluginContextData = class {
|
|
|
3794
3815
|
return info;
|
|
3795
3816
|
}
|
|
3796
3817
|
getModuleIds(context) {
|
|
3797
|
-
|
|
3798
|
-
return moduleIds.values();
|
|
3818
|
+
return context.getModuleIds().values();
|
|
3799
3819
|
}
|
|
3800
3820
|
saveResolveOptions(options) {
|
|
3801
3821
|
const index = this.resolveOptionsMap.size;
|
|
@@ -3838,8 +3858,8 @@ var PluginContextData = class {
|
|
|
3838
3858
|
function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normalizedOutputPlugins, onLog, logLevel, watchMode) {
|
|
3839
3859
|
const pluginContextData = new PluginContextData(onLog, outputOptions, normalizedOutputPlugins);
|
|
3840
3860
|
const plugins = rawPlugins.map((plugin) => {
|
|
3841
|
-
if ("_parallel" in plugin) return
|
|
3842
|
-
if (
|
|
3861
|
+
if ("_parallel" in plugin) return;
|
|
3862
|
+
if (plugin instanceof BuiltinPlugin) return bindingifyBuiltInPlugin(plugin);
|
|
3843
3863
|
return bindingifyPlugin(plugin, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode);
|
|
3844
3864
|
});
|
|
3845
3865
|
const { jsx, transform } = bindingifyJsx(onLog, inputOptions.jsx, inputOptions.transform);
|
|
@@ -3893,7 +3913,7 @@ function bindingifyHmr(hmr) {
|
|
|
3893
3913
|
}
|
|
3894
3914
|
function bindingifyAttachDebugInfo(attachDebugInfo) {
|
|
3895
3915
|
switch (attachDebugInfo) {
|
|
3896
|
-
case void 0: return
|
|
3916
|
+
case void 0: return;
|
|
3897
3917
|
case "full": return BindingAttachDebugInfo.Full;
|
|
3898
3918
|
case "simple": return BindingAttachDebugInfo.Simple;
|
|
3899
3919
|
case "none": return BindingAttachDebugInfo.None;
|
|
@@ -4048,7 +4068,7 @@ function bindingifyWatch(watch$1) {
|
|
|
4048
4068
|
};
|
|
4049
4069
|
}
|
|
4050
4070
|
function bindingifyTreeshakeOptions(config) {
|
|
4051
|
-
if (config === false) return
|
|
4071
|
+
if (config === false) return;
|
|
4052
4072
|
if (config === true || config === void 0) return { moduleSideEffects: true };
|
|
4053
4073
|
let normalizedConfig = {
|
|
4054
4074
|
moduleSideEffects: true,
|
|
@@ -4094,7 +4114,7 @@ function bindingifyMakeAbsoluteExternalsRelative(makeAbsoluteExternalsRelative)
|
|
|
4094
4114
|
};
|
|
4095
4115
|
}
|
|
4096
4116
|
function bindingifyPreserveEntrySignatures(preserveEntrySignatures) {
|
|
4097
|
-
if (preserveEntrySignatures == void 0) return
|
|
4117
|
+
if (preserveEntrySignatures == void 0) return;
|
|
4098
4118
|
else if (typeof preserveEntrySignatures === "string") return {
|
|
4099
4119
|
type: "String",
|
|
4100
4120
|
field0: preserveEntrySignatures
|
|
@@ -4117,7 +4137,7 @@ async function initializeParallelPlugins(plugins) {
|
|
|
4117
4137
|
options
|
|
4118
4138
|
});
|
|
4119
4139
|
}
|
|
4120
|
-
if (pluginInfos.length <= 0) return
|
|
4140
|
+
if (pluginInfos.length <= 0) return;
|
|
4121
4141
|
const count = availableParallelism();
|
|
4122
4142
|
const parallelJsPluginRegistry = new ParallelJsPluginRegistry(count);
|
|
4123
4143
|
const registryId = parallelJsPluginRegistry.id;
|
|
@@ -4426,8 +4446,7 @@ async function createWatcher(emitter, input) {
|
|
|
4426
4446
|
})).flat());
|
|
4427
4447
|
const notifyOptions = getValidNotifyOption(bundlerOptions);
|
|
4428
4448
|
const bindingWatcher = new BindingWatcher(bundlerOptions.map((option) => option.bundlerOptions), notifyOptions);
|
|
4429
|
-
|
|
4430
|
-
watcher.start();
|
|
4449
|
+
new Watcher(emitter, bindingWatcher, bundlerOptions.map((option) => option.stopWorkers)).start();
|
|
4431
4450
|
}
|
|
4432
4451
|
function getValidNotifyOption(bundlerOptions) {
|
|
4433
4452
|
let result;
|
|
@@ -4459,4 +4478,4 @@ function defineConfig(config) {
|
|
|
4459
4478
|
const VERSION = version;
|
|
4460
4479
|
|
|
4461
4480
|
//#endregion
|
|
4462
|
-
export { PluginContextData, PluginDriver, VERSION, assetPlugin, bindingifyPlugin, build, buildImportAnalysisPlugin,
|
|
4481
|
+
export { BuiltinPlugin, PluginContextData, PluginDriver, VERSION, assetPlugin, bindingifyPlugin, build, buildImportAnalysisPlugin, createBundlerImpl, createBundlerOptions, defineConfig, description$1 as description, dynamicImportVarsPlugin, esmExternalRequirePlugin, getInputCliKeys, getJsonSchema, getOutputCliKeys, handleOutputErrors, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, reporterPlugin, rolldown, validateCliOptions, version, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch, webWorkerPostPlugin };
|
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.37",
|
|
4
4
|
"description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"homepage": "https://rolldown.rs/",
|
|
@@ -27,33 +27,16 @@
|
|
|
27
27
|
"bin": {
|
|
28
28
|
"rolldown": "./bin/cli.mjs"
|
|
29
29
|
},
|
|
30
|
-
"main": "./dist/index.
|
|
31
|
-
"
|
|
30
|
+
"main": "./dist/index.mjs",
|
|
31
|
+
"module": "./dist/index.mjs",
|
|
32
|
+
"types": "./dist/index.d.mts",
|
|
32
33
|
"exports": {
|
|
33
|
-
".":
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"./
|
|
38
|
-
|
|
39
|
-
"require": "./dist/config.cjs"
|
|
40
|
-
},
|
|
41
|
-
"./experimental": {
|
|
42
|
-
"import": "./dist/experimental-index.mjs",
|
|
43
|
-
"require": "./dist/experimental-index.cjs"
|
|
44
|
-
},
|
|
45
|
-
"./filter": {
|
|
46
|
-
"import": "./dist/filter-index.mjs",
|
|
47
|
-
"require": "./dist/filter-index.cjs"
|
|
48
|
-
},
|
|
49
|
-
"./parallelPlugin": {
|
|
50
|
-
"import": "./dist/parallel-plugin.mjs",
|
|
51
|
-
"require": "./dist/parallel-plugin.cjs"
|
|
52
|
-
},
|
|
53
|
-
"./parseAst": {
|
|
54
|
-
"import": "./dist/parse-ast-index.mjs",
|
|
55
|
-
"require": "./dist/parse-ast-index.cjs"
|
|
56
|
-
},
|
|
34
|
+
".": "./dist/index.mjs",
|
|
35
|
+
"./config": "./dist/config.mjs",
|
|
36
|
+
"./experimental": "./dist/experimental-index.mjs",
|
|
37
|
+
"./filter": "./dist/filter-index.mjs",
|
|
38
|
+
"./parallelPlugin": "./dist/parallel-plugin.mjs",
|
|
39
|
+
"./parseAst": "./dist/parse-ast-index.mjs",
|
|
57
40
|
"./package.json": "./package.json"
|
|
58
41
|
},
|
|
59
42
|
"imports": {
|
|
@@ -92,10 +75,10 @@
|
|
|
92
75
|
"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"
|
|
93
76
|
},
|
|
94
77
|
"dependencies": {
|
|
95
|
-
"@oxc-project/runtime": "=0.
|
|
96
|
-
"@oxc-project/types": "=0.
|
|
78
|
+
"@oxc-project/runtime": "=0.87.0",
|
|
79
|
+
"@oxc-project/types": "=0.87.0",
|
|
97
80
|
"ansis": "^4.0.0",
|
|
98
|
-
"@rolldown/pluginutils": "1.0.0-beta.
|
|
81
|
+
"@rolldown/pluginutils": "1.0.0-beta.37"
|
|
99
82
|
},
|
|
100
83
|
"devDependencies": {
|
|
101
84
|
"@napi-rs/cli": "^3.1.2",
|
|
@@ -108,7 +91,7 @@
|
|
|
108
91
|
"emnapi": "^1.2.0",
|
|
109
92
|
"execa": "^9.2.0",
|
|
110
93
|
"glob": "^11.0.0",
|
|
111
|
-
"oxc-parser": "=0.
|
|
94
|
+
"oxc-parser": "=0.87.0",
|
|
112
95
|
"pathe": "^2.0.3",
|
|
113
96
|
"remeda": "^2.10.0",
|
|
114
97
|
"rolldown-plugin-dts": "^0.16.0",
|
|
@@ -119,23 +102,26 @@
|
|
|
119
102
|
"typedoc": "^0.28.0",
|
|
120
103
|
"typescript": "^5.7.3",
|
|
121
104
|
"valibot": "1.1.0",
|
|
122
|
-
"rolldown": "1.0.0-beta.
|
|
105
|
+
"rolldown": "1.0.0-beta.37"
|
|
106
|
+
},
|
|
107
|
+
"engines": {
|
|
108
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
123
109
|
},
|
|
124
110
|
"optionalDependencies": {
|
|
125
|
-
"@rolldown/binding-darwin-x64": "1.0.0-beta.
|
|
126
|
-
"@rolldown/binding-win32-x64-msvc": "1.0.0-beta.
|
|
127
|
-
"@rolldown/binding-linux-x64-gnu": "1.0.0-beta.
|
|
128
|
-
"@rolldown/binding-linux-x64-musl": "1.0.0-beta.
|
|
129
|
-
"@rolldown/binding-freebsd-x64": "1.0.0-beta.
|
|
130
|
-
"@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.
|
|
131
|
-
"@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.
|
|
132
|
-
"@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.
|
|
133
|
-
"@rolldown/binding-darwin-arm64": "1.0.0-beta.
|
|
134
|
-
"@rolldown/binding-linux-arm64-musl": "1.0.0-beta.
|
|
135
|
-
"@rolldown/binding-openharmony-arm64": "1.0.0-beta.
|
|
136
|
-
"@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.
|
|
137
|
-
"@rolldown/binding-android-arm64": "1.0.0-beta.
|
|
138
|
-
"@rolldown/binding-wasm32-wasi": "1.0.0-beta.
|
|
111
|
+
"@rolldown/binding-darwin-x64": "1.0.0-beta.37",
|
|
112
|
+
"@rolldown/binding-win32-x64-msvc": "1.0.0-beta.37",
|
|
113
|
+
"@rolldown/binding-linux-x64-gnu": "1.0.0-beta.37",
|
|
114
|
+
"@rolldown/binding-linux-x64-musl": "1.0.0-beta.37",
|
|
115
|
+
"@rolldown/binding-freebsd-x64": "1.0.0-beta.37",
|
|
116
|
+
"@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.37",
|
|
117
|
+
"@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.37",
|
|
118
|
+
"@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.37",
|
|
119
|
+
"@rolldown/binding-darwin-arm64": "1.0.0-beta.37",
|
|
120
|
+
"@rolldown/binding-linux-arm64-musl": "1.0.0-beta.37",
|
|
121
|
+
"@rolldown/binding-openharmony-arm64": "1.0.0-beta.37",
|
|
122
|
+
"@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.37",
|
|
123
|
+
"@rolldown/binding-android-arm64": "1.0.0-beta.37",
|
|
124
|
+
"@rolldown/binding-wasm32-wasi": "1.0.0-beta.37"
|
|
139
125
|
},
|
|
140
126
|
"scripts": {
|
|
141
127
|
"# Scrips for binding #": "_",
|
package/dist/cli.d.cts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/config.cjs
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
require('./shared/parse-ast-index-cePJvlvW.cjs');
|
|
2
|
-
const require_src = require('./shared/src-BBMxhaqf.cjs');
|
|
3
|
-
require('./shared/misc-DksvspN4.cjs');
|
|
4
|
-
const require_load_config = require('./shared/load-config-S_ofSLrj.cjs');
|
|
5
|
-
|
|
6
|
-
//#region src/config.ts
|
|
7
|
-
const VERSION = require_src.version;
|
|
8
|
-
|
|
9
|
-
//#endregion
|
|
10
|
-
exports.VERSION = VERSION;
|
|
11
|
-
exports.defineConfig = require_src.defineConfig;
|
|
12
|
-
exports.loadConfig = require_load_config.loadConfig;
|
package/dist/config.d.cts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import "./shared/binding-D13M6Llu.cjs";
|
|
2
|
-
import { ConfigExport, defineConfig } from "./shared/define-config-DhrkZ_o7.cjs";
|
|
3
|
-
|
|
4
|
-
//#region src/utils/load-config.d.ts
|
|
5
|
-
declare function loadConfig(configPath: string): Promise<ConfigExport>;
|
|
6
|
-
//#endregion
|
|
7
|
-
//#region src/config.d.ts
|
|
8
|
-
declare const VERSION: string;
|
|
9
|
-
//#endregion
|
|
10
|
-
export { VERSION, defineConfig, loadConfig };
|