rolldown 1.0.0-beta.33 → 1.0.0-beta.35
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 +219 -213
- package/dist/cli.mjs +206 -206
- 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 +55 -6
- package/dist/experimental-index.d.cts +45 -4
- package/dist/experimental-index.d.mts +45 -4
- package/dist/experimental-index.mjs +51 -6
- package/dist/filter-index.cjs +2 -1
- 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 +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/parallel-plugin-worker.cjs +4 -3
- 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 -1
- package/dist/parse-ast-index.d.mts +1 -1
- package/dist/parse-ast-index.mjs +1 -1
- package/dist/shared/{binding-CFhvYkVn.d.mts → binding-9k0egz6L.d.mts} +107 -7
- package/dist/shared/{binding-DQk9TN_A.d.cts → binding-D13M6Llu.d.cts} +107 -7
- package/dist/shared/{define-config-B3QOs3Kt.d.cts → define-config-3arq8OPE.d.mts} +91 -25
- package/dist/shared/{define-config-DtlZ1GSS.d.mts → define-config-DhrkZ_o7.d.cts} +91 -25
- package/dist/shared/{load-config-C00QU0Nl.mjs → load-config-C93_L4MP.mjs} +1 -1
- package/dist/shared/{load-config-B-y3XROZ.cjs → load-config-S_ofSLrj.cjs} +11 -6
- package/dist/shared/{parse-ast-index-BsbuAWqn.mjs → parse-ast-index-BadydpMA.mjs} +26 -26
- package/dist/shared/{parse-ast-index-DBzcfyxO.cjs → parse-ast-index-cePJvlvW.cjs} +43 -25
- package/dist/shared/{prompt-QNI93ne7.cjs → prompt-Q05EYrFb.cjs} +8 -4
- package/dist/shared/{src-DZTBSVJk.cjs → src-BBMxhaqf.cjs} +182 -105
- package/dist/shared/{src-D1dc6nJr.mjs → src-D954P1TH.mjs} +152 -94
- package/package.json +21 -22
|
@@ -1,30 +1,33 @@
|
|
|
1
|
-
import { BindingAttachDebugInfo, BindingBundler, BindingCallableBuiltinPlugin, BindingChunkModuleOrderBy, BindingJsx, BindingLogLevel, BindingPluginOrder, 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-BadydpMA.mjs";
|
|
2
2
|
import { arraify, noop, unimplemented, unreachable, unsupported } from "./misc-CQeo-AFx.mjs";
|
|
3
|
+
import { Worker } from "node:worker_threads";
|
|
3
4
|
import path from "node:path";
|
|
4
5
|
import { fileURLToPath } from "node:url";
|
|
5
6
|
import colors from "ansis";
|
|
6
7
|
import * as filter from "@rolldown/pluginutils";
|
|
7
8
|
import fsp from "node:fs/promises";
|
|
8
9
|
import os from "node:os";
|
|
9
|
-
import { Worker } from "node:worker_threads";
|
|
10
10
|
|
|
11
11
|
//#region package.json
|
|
12
|
-
var version = "1.0.0-beta.
|
|
12
|
+
var version = "1.0.0-beta.35";
|
|
13
13
|
var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
14
14
|
|
|
15
15
|
//#endregion
|
|
16
|
-
//#region src/utils
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
//#region src/builtin-plugin/utils.ts
|
|
17
|
+
const BuiltinClassSymbol = Symbol.for("__RolldownBuiltinPlugin__");
|
|
18
|
+
var BuiltinPlugin = class {
|
|
19
|
+
constructor(name, _options) {
|
|
20
|
+
this.name = name;
|
|
21
|
+
this._options = _options;
|
|
22
|
+
this[BuiltinClassSymbol] = true;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
function isBuiltinPlugin(obj) {
|
|
26
|
+
return obj && obj[BuiltinClassSymbol] === true;
|
|
21
27
|
}
|
|
22
|
-
function
|
|
23
|
-
return
|
|
28
|
+
function createBuiltinPlugin(name, options) {
|
|
29
|
+
return new BuiltinPlugin(name, options);
|
|
24
30
|
}
|
|
25
|
-
|
|
26
|
-
//#endregion
|
|
27
|
-
//#region src/builtin-plugin/utils.ts
|
|
28
31
|
function makeBuiltinPluginCallable(plugin) {
|
|
29
32
|
let callablePlugin = new BindingCallableBuiltinPlugin(bindingifyBuiltInPlugin(plugin));
|
|
30
33
|
const wrappedPlugin = plugin;
|
|
@@ -48,67 +51,6 @@ function bindingifyBuiltInPlugin(plugin) {
|
|
|
48
51
|
};
|
|
49
52
|
}
|
|
50
53
|
|
|
51
|
-
//#endregion
|
|
52
|
-
//#region src/builtin-plugin/constructors.ts
|
|
53
|
-
var BuiltinPlugin = class {
|
|
54
|
-
constructor(name, _options) {
|
|
55
|
-
this.name = name;
|
|
56
|
-
this._options = _options;
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
function modulePreloadPolyfillPlugin(config) {
|
|
60
|
-
return new BuiltinPlugin("builtin:module-preload-polyfill", config);
|
|
61
|
-
}
|
|
62
|
-
function dynamicImportVarsPlugin(config) {
|
|
63
|
-
if (config) {
|
|
64
|
-
config.include = normalizedStringOrRegex(config.include);
|
|
65
|
-
config.exclude = normalizedStringOrRegex(config.exclude);
|
|
66
|
-
}
|
|
67
|
-
return new BuiltinPlugin("builtin:dynamic-import-vars", config);
|
|
68
|
-
}
|
|
69
|
-
function importGlobPlugin(config) {
|
|
70
|
-
return new BuiltinPlugin("builtin:import-glob", config);
|
|
71
|
-
}
|
|
72
|
-
function reporterPlugin(config) {
|
|
73
|
-
return new BuiltinPlugin("builtin:reporter", config);
|
|
74
|
-
}
|
|
75
|
-
function manifestPlugin(config) {
|
|
76
|
-
return new BuiltinPlugin("builtin:manifest", config);
|
|
77
|
-
}
|
|
78
|
-
function wasmHelperPlugin(config) {
|
|
79
|
-
return new BuiltinPlugin("builtin:wasm-helper", config);
|
|
80
|
-
}
|
|
81
|
-
function wasmFallbackPlugin() {
|
|
82
|
-
const builtinPlugin = new BuiltinPlugin("builtin:wasm-fallback");
|
|
83
|
-
return makeBuiltinPluginCallable(builtinPlugin);
|
|
84
|
-
}
|
|
85
|
-
function loadFallbackPlugin() {
|
|
86
|
-
return new BuiltinPlugin("builtin:load-fallback");
|
|
87
|
-
}
|
|
88
|
-
function jsonPlugin(config) {
|
|
89
|
-
const builtinPlugin = new BuiltinPlugin("builtin:json", config);
|
|
90
|
-
return makeBuiltinPluginCallable(builtinPlugin);
|
|
91
|
-
}
|
|
92
|
-
function buildImportAnalysisPlugin(config) {
|
|
93
|
-
return new BuiltinPlugin("builtin:build-import-analysis", config);
|
|
94
|
-
}
|
|
95
|
-
function viteResolvePlugin(config) {
|
|
96
|
-
const builtinPlugin = new BuiltinPlugin("builtin:vite-resolve", config);
|
|
97
|
-
return makeBuiltinPluginCallable(builtinPlugin);
|
|
98
|
-
}
|
|
99
|
-
function isolatedDeclarationPlugin(config) {
|
|
100
|
-
return new BuiltinPlugin("builtin:isolated-declaration", config);
|
|
101
|
-
}
|
|
102
|
-
function assetPlugin(config) {
|
|
103
|
-
return new BuiltinPlugin("builtin:asset", config);
|
|
104
|
-
}
|
|
105
|
-
function webWorkerPostPlugin() {
|
|
106
|
-
return new BuiltinPlugin("builtin:web-worker-post");
|
|
107
|
-
}
|
|
108
|
-
function oxcRuntimePlugin(config) {
|
|
109
|
-
return new BuiltinPlugin("builtin:oxc-runtime", config);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
54
|
//#endregion
|
|
113
55
|
//#region src/log/logging.ts
|
|
114
56
|
const LOG_LEVEL_SILENT = "silent";
|
|
@@ -233,6 +175,75 @@ function normalizeHook(hook) {
|
|
|
233
175
|
unreachable("Invalid hook type");
|
|
234
176
|
}
|
|
235
177
|
|
|
178
|
+
//#endregion
|
|
179
|
+
//#region src/utils/normalize-string-or-regex.ts
|
|
180
|
+
function normalizedStringOrRegex(pattern) {
|
|
181
|
+
if (!pattern) return void 0;
|
|
182
|
+
if (!isReadonlyArray(pattern)) return [pattern];
|
|
183
|
+
return pattern;
|
|
184
|
+
}
|
|
185
|
+
function isReadonlyArray(input) {
|
|
186
|
+
return Array.isArray(input);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
//#endregion
|
|
190
|
+
//#region src/builtin-plugin/constructors.ts
|
|
191
|
+
function modulePreloadPolyfillPlugin(config) {
|
|
192
|
+
return createBuiltinPlugin("builtin:module-preload-polyfill", config);
|
|
193
|
+
}
|
|
194
|
+
function dynamicImportVarsPlugin(config) {
|
|
195
|
+
if (config) {
|
|
196
|
+
config.include = normalizedStringOrRegex(config.include);
|
|
197
|
+
config.exclude = normalizedStringOrRegex(config.exclude);
|
|
198
|
+
}
|
|
199
|
+
return createBuiltinPlugin("builtin:dynamic-import-vars", config);
|
|
200
|
+
}
|
|
201
|
+
function importGlobPlugin(config) {
|
|
202
|
+
return createBuiltinPlugin("builtin:import-glob", config);
|
|
203
|
+
}
|
|
204
|
+
function reporterPlugin(config) {
|
|
205
|
+
return createBuiltinPlugin("builtin:reporter", config);
|
|
206
|
+
}
|
|
207
|
+
function manifestPlugin(config) {
|
|
208
|
+
return createBuiltinPlugin("builtin:manifest", config);
|
|
209
|
+
}
|
|
210
|
+
function wasmHelperPlugin(config) {
|
|
211
|
+
return createBuiltinPlugin("builtin:wasm-helper", config);
|
|
212
|
+
}
|
|
213
|
+
function wasmFallbackPlugin() {
|
|
214
|
+
const builtinPlugin = createBuiltinPlugin("builtin:wasm-fallback");
|
|
215
|
+
return makeBuiltinPluginCallable(builtinPlugin);
|
|
216
|
+
}
|
|
217
|
+
function loadFallbackPlugin() {
|
|
218
|
+
return createBuiltinPlugin("builtin:load-fallback");
|
|
219
|
+
}
|
|
220
|
+
function jsonPlugin(config) {
|
|
221
|
+
const builtinPlugin = createBuiltinPlugin("builtin:json", config);
|
|
222
|
+
return makeBuiltinPluginCallable(builtinPlugin);
|
|
223
|
+
}
|
|
224
|
+
function buildImportAnalysisPlugin(config) {
|
|
225
|
+
return createBuiltinPlugin("builtin:build-import-analysis", config);
|
|
226
|
+
}
|
|
227
|
+
function viteResolvePlugin(config) {
|
|
228
|
+
const builtinPlugin = createBuiltinPlugin("builtin:vite-resolve", config);
|
|
229
|
+
return makeBuiltinPluginCallable(builtinPlugin);
|
|
230
|
+
}
|
|
231
|
+
function isolatedDeclarationPlugin(config) {
|
|
232
|
+
return createBuiltinPlugin("builtin:isolated-declaration", config);
|
|
233
|
+
}
|
|
234
|
+
function assetPlugin(config) {
|
|
235
|
+
return createBuiltinPlugin("builtin:asset", config);
|
|
236
|
+
}
|
|
237
|
+
function webWorkerPostPlugin() {
|
|
238
|
+
return createBuiltinPlugin("builtin:web-worker-post");
|
|
239
|
+
}
|
|
240
|
+
function oxcRuntimePlugin(config) {
|
|
241
|
+
return createBuiltinPlugin("builtin:oxc-runtime", config);
|
|
242
|
+
}
|
|
243
|
+
function esmExternalRequirePlugin(config) {
|
|
244
|
+
return createBuiltinPlugin("builtin:esm-external-require", config);
|
|
245
|
+
}
|
|
246
|
+
|
|
236
247
|
//#endregion
|
|
237
248
|
//#region src/constants/plugin.ts
|
|
238
249
|
const ENUMERATED_INPUT_PLUGIN_HOOK_NAMES = [
|
|
@@ -324,7 +335,7 @@ function checkOutputPluginOption(plugins, onLog) {
|
|
|
324
335
|
function normalizePlugins(plugins, anonymousPrefix) {
|
|
325
336
|
for (const [index, plugin] of plugins.entries()) {
|
|
326
337
|
if ("_parallel" in plugin) continue;
|
|
327
|
-
if (plugin
|
|
338
|
+
if (isBuiltinPlugin(plugin)) continue;
|
|
328
339
|
if (!plugin.name) plugin.name = `${anonymousPrefix}${index + 1}`;
|
|
329
340
|
}
|
|
330
341
|
return plugins;
|
|
@@ -393,7 +404,7 @@ function getObjectPlugins(plugins) {
|
|
|
393
404
|
return plugins.filter((plugin) => {
|
|
394
405
|
if (!plugin) return void 0;
|
|
395
406
|
if ("_parallel" in plugin) return void 0;
|
|
396
|
-
if (plugin
|
|
407
|
+
if (isBuiltinPlugin(plugin)) return void 0;
|
|
397
408
|
return plugin;
|
|
398
409
|
});
|
|
399
410
|
}
|
|
@@ -1900,7 +1911,7 @@ const TransformOptionsSchema = object({
|
|
|
1900
1911
|
typescript: optional(TypescriptSchema),
|
|
1901
1912
|
helpers: optional(HelpersSchema),
|
|
1902
1913
|
decorators: optional(DecoratorOptionSchema),
|
|
1903
|
-
jsx: optional(JsxOptionsSchema),
|
|
1914
|
+
jsx: optional(union([literal("preserve"), JsxOptionsSchema])),
|
|
1904
1915
|
target: pipe(optional(union([string(), array(string())])), description("The JavaScript target environment"))
|
|
1905
1916
|
});
|
|
1906
1917
|
const WatchOptionsSchema = strictObject({
|
|
@@ -1928,7 +1939,8 @@ const ChecksOptionsSchema = strictObject({
|
|
|
1928
1939
|
commonJsVariableInEsm: pipe(optional(boolean()), description("Whether to emit warning when detecting common js variable in esm")),
|
|
1929
1940
|
importIsUndefined: pipe(optional(boolean()), description("Whether to emit warning when detecting import is undefined")),
|
|
1930
1941
|
emptyImportMeta: pipe(optional(boolean()), description("Whether to emit warning when detecting empty import meta")),
|
|
1931
|
-
configurationFieldConflict: pipe(optional(boolean()), description("Whether to emit warning when detecting configuration field conflict"))
|
|
1942
|
+
configurationFieldConflict: pipe(optional(boolean()), description("Whether to emit warning when detecting configuration field conflict")),
|
|
1943
|
+
preferBuiltinFeature: pipe(optional(boolean()), description("Whether to emit warning when detecting prefer builtin feature"))
|
|
1932
1944
|
});
|
|
1933
1945
|
const MinifyOptionsSchema = strictObject({
|
|
1934
1946
|
mangle: optional(boolean()),
|
|
@@ -1946,17 +1958,25 @@ const ResolveOptionsSchema = strictObject({
|
|
|
1946
1958
|
mainFiles: optional(array(string())),
|
|
1947
1959
|
modules: optional(array(string())),
|
|
1948
1960
|
symlinks: optional(boolean()),
|
|
1949
|
-
tsconfigFilename: optional(string()),
|
|
1950
1961
|
yarnPnp: optional(boolean())
|
|
1951
1962
|
});
|
|
1952
1963
|
const TreeshakingOptionsSchema = union([boolean(), looseObject({
|
|
1953
1964
|
annotations: optional(boolean()),
|
|
1954
1965
|
manualPureFunctions: optional(array(string())),
|
|
1955
1966
|
unknownGlobalSideEffects: optional(boolean()),
|
|
1956
|
-
commonjs: optional(boolean())
|
|
1967
|
+
commonjs: optional(boolean()),
|
|
1968
|
+
propertyReadSideEffects: optional(union([literal(false), literal("always")])),
|
|
1969
|
+
propertyWriteSideEffects: optional(union([literal(false), literal("always")]))
|
|
1957
1970
|
})]);
|
|
1958
1971
|
const OptimizationOptionsSchema = strictObject({
|
|
1959
|
-
inlineConst: pipe(optional(
|
|
1972
|
+
inlineConst: pipe(optional(union([
|
|
1973
|
+
boolean(),
|
|
1974
|
+
literal("smart"),
|
|
1975
|
+
strictObject({
|
|
1976
|
+
mode: optional(union([literal("all"), literal("smart")])),
|
|
1977
|
+
pass: optional(number())
|
|
1978
|
+
})
|
|
1979
|
+
])), description("Enable crossmodule constant inlining")),
|
|
1960
1980
|
pifeForModuleWrappers: pipe(optional(boolean()), description("Use PIFE pattern for module wrappers"))
|
|
1961
1981
|
});
|
|
1962
1982
|
const OnLogSchema = pipe(function_(), args(tuple([
|
|
@@ -1966,6 +1986,7 @@ const OnLogSchema = pipe(function_(), args(tuple([
|
|
|
1966
1986
|
])));
|
|
1967
1987
|
const OnwarnSchema = pipe(function_(), args(tuple([RollupLogSchema, pipe(function_(), args(tuple([union([RollupLogWithStringSchema, pipe(function_(), returns(RollupLogWithStringSchema))])])))])));
|
|
1968
1988
|
const HmrSchema = union([boolean(), strictObject({
|
|
1989
|
+
new: optional(boolean()),
|
|
1969
1990
|
port: optional(number()),
|
|
1970
1991
|
host: optional(string()),
|
|
1971
1992
|
implement: optional(string())
|
|
@@ -2030,7 +2051,8 @@ const InputOptionsSchema = strictObject({
|
|
|
2030
2051
|
literal("allow-extension"),
|
|
2031
2052
|
literal("exports-only"),
|
|
2032
2053
|
literal(false)
|
|
2033
|
-
])))
|
|
2054
|
+
]))),
|
|
2055
|
+
tsconfig: pipe(optional(string()), description("Path to the tsconfig.json file."))
|
|
2034
2056
|
});
|
|
2035
2057
|
const InputCliOverrideSchema = strictObject({
|
|
2036
2058
|
input: pipe(optional(array(string())), description("Entry file")),
|
|
@@ -2152,7 +2174,8 @@ const OutputOptionsSchema = strictObject({
|
|
|
2152
2174
|
preserveModules: pipe(optional(boolean()), description("Preserve module structure")),
|
|
2153
2175
|
preserveModulesRoot: pipe(optional(string()), description("Put preserved modules under this path at root level")),
|
|
2154
2176
|
virtualDirname: optional(string()),
|
|
2155
|
-
minifyInternalExports: pipe(optional(boolean()), description("Minify internal exports"))
|
|
2177
|
+
minifyInternalExports: pipe(optional(boolean()), description("Minify internal exports")),
|
|
2178
|
+
topLevelVar: pipe(optional(boolean()), description("Rewrite top-level declarations to use `var`."))
|
|
2156
2179
|
});
|
|
2157
2180
|
const getAddonDescription = (placement, wrapper) => {
|
|
2158
2181
|
return `Code to insert the ${colors.bold(placement)} of the bundled file (${colors.bold(wrapper)} the wrapper function)`;
|
|
@@ -2200,15 +2223,19 @@ function validateCliOptions(options) {
|
|
|
2200
2223
|
return `Invalid value for option ${option}: ${issue.message}`;
|
|
2201
2224
|
})];
|
|
2202
2225
|
}
|
|
2203
|
-
const inputHelperMsgRecord = {
|
|
2226
|
+
const inputHelperMsgRecord = {
|
|
2227
|
+
output: { ignored: true },
|
|
2228
|
+
"resolve.tsconfigFilename": { issueMsg: "It is deprecated. Please use the top-level `tsconfig` option instead." }
|
|
2229
|
+
};
|
|
2204
2230
|
const outputHelperMsgRecord = {};
|
|
2205
2231
|
function validateOption(key, options) {
|
|
2232
|
+
if (typeof options !== "object") throw new Error(`Invalid ${key} options. Expected an Object but received ${JSON.stringify(options)}.`);
|
|
2206
2233
|
if (globalThis.process?.env?.ROLLUP_TEST) return;
|
|
2207
2234
|
let parsed = safeParse(key === "input" ? InputOptionsSchema : OutputOptionsSchema, options);
|
|
2208
2235
|
if (!parsed.success) {
|
|
2209
2236
|
const errors = parsed.issues.map((issue) => {
|
|
2210
|
-
const issuePaths = issue.path.map((path$1) => path$1.key);
|
|
2211
2237
|
let issueMsg = issue.message;
|
|
2238
|
+
const issuePaths = issue.path.map((path$1) => path$1.key);
|
|
2212
2239
|
if (issue.type === "union") {
|
|
2213
2240
|
const subIssue = issue.issues?.find((i) => !(i.type !== issue.received && i.input === issue.input));
|
|
2214
2241
|
if (subIssue) {
|
|
@@ -2219,9 +2246,9 @@ function validateOption(key, options) {
|
|
|
2219
2246
|
const stringPath = issuePaths.join(".");
|
|
2220
2247
|
const helper = key === "input" ? inputHelperMsgRecord[stringPath] : outputHelperMsgRecord[stringPath];
|
|
2221
2248
|
if (helper && helper.ignored) return "";
|
|
2222
|
-
return `- For the "${stringPath}". ${issueMsg}
|
|
2249
|
+
return `- For the "${stringPath}". ${helper?.issueMsg || issueMsg + "."} ${helper?.help ? `\n Help: ${helper.help}` : ""}`;
|
|
2223
2250
|
}).filter(Boolean);
|
|
2224
|
-
if (errors.length) console.warn(
|
|
2251
|
+
if (errors.length) console.warn(`\x1b[33mWarning: Invalid ${key} options (${errors.length} issue${errors.length === 1 ? "" : "s"} found)\n${errors.join("\n")}\x1b[0m`);
|
|
2225
2252
|
}
|
|
2226
2253
|
}
|
|
2227
2254
|
function getInputCliKeys() {
|
|
@@ -2294,6 +2321,10 @@ function getErrorMessage(e$1) {
|
|
|
2294
2321
|
s += message;
|
|
2295
2322
|
if (e$1.frame) s = joinNewLine(s, e$1.frame);
|
|
2296
2323
|
if (e$1.stack) s = joinNewLine(s, e$1.stack.replace(message, ""));
|
|
2324
|
+
if (e$1.cause) {
|
|
2325
|
+
s = joinNewLine(s, "Caused by:");
|
|
2326
|
+
s = joinNewLine(s, getErrorMessage(e$1.cause).split("\n").map((line) => " " + line).join("\n"));
|
|
2327
|
+
}
|
|
2297
2328
|
return s;
|
|
2298
2329
|
}
|
|
2299
2330
|
function joinNewLine(s1, s2) {
|
|
@@ -2606,7 +2637,8 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
|
2606
2637
|
...res,
|
|
2607
2638
|
external: res.external === "relative" ? unreachable(`The PluginContext resolve result external couldn't be 'relative'`) : res.external,
|
|
2608
2639
|
...info,
|
|
2609
|
-
moduleSideEffects: info.moduleSideEffects ?? res.moduleSideEffects ?? null
|
|
2640
|
+
moduleSideEffects: info.moduleSideEffects ?? res.moduleSideEffects ?? null,
|
|
2641
|
+
packageJsonPath: res.packageJsonPath
|
|
2610
2642
|
};
|
|
2611
2643
|
}
|
|
2612
2644
|
emitFile = (file) => {
|
|
@@ -2732,7 +2764,8 @@ function bindingifyResolveId(args$1) {
|
|
|
2732
2764
|
id: ret.id,
|
|
2733
2765
|
external: ret.external,
|
|
2734
2766
|
normalizeExternalId: false,
|
|
2735
|
-
moduleSideEffects: exist.moduleSideEffects ?? void 0
|
|
2767
|
+
moduleSideEffects: exist.moduleSideEffects ?? void 0,
|
|
2768
|
+
packageJsonPath: ret.packageJsonPath
|
|
2736
2769
|
};
|
|
2737
2770
|
},
|
|
2738
2771
|
meta: bindingifyPluginHookMeta(meta),
|
|
@@ -3658,7 +3691,13 @@ var NormalizedOutputOptionsImpl = class {
|
|
|
3658
3691
|
return this.outputOptions.sourcemapPathTransform;
|
|
3659
3692
|
}
|
|
3660
3693
|
get minify() {
|
|
3661
|
-
|
|
3694
|
+
let ret = this.inner.minify;
|
|
3695
|
+
if (typeof ret === "object" && ret !== null) {
|
|
3696
|
+
delete ret["codegen"];
|
|
3697
|
+
delete ret["module"];
|
|
3698
|
+
delete ret["sourcemap"];
|
|
3699
|
+
}
|
|
3700
|
+
return ret;
|
|
3662
3701
|
}
|
|
3663
3702
|
get legalComments() {
|
|
3664
3703
|
return this.inner.legalComments;
|
|
@@ -3800,7 +3839,7 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
3800
3839
|
const pluginContextData = new PluginContextData(onLog, outputOptions, normalizedOutputPlugins);
|
|
3801
3840
|
const plugins = rawPlugins.map((plugin) => {
|
|
3802
3841
|
if ("_parallel" in plugin) return void 0;
|
|
3803
|
-
if (plugin
|
|
3842
|
+
if (isBuiltinPlugin(plugin)) return bindingifyBuiltInPlugin(plugin);
|
|
3804
3843
|
return bindingifyPlugin(plugin, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode);
|
|
3805
3844
|
});
|
|
3806
3845
|
const { jsx, transform } = bindingifyJsx(onLog, inputOptions.jsx, inputOptions.transform);
|
|
@@ -3813,7 +3852,7 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
3813
3852
|
platform: inputOptions.platform,
|
|
3814
3853
|
shimMissingExports: inputOptions.shimMissingExports,
|
|
3815
3854
|
logLevel: bindingifyLogLevel(logLevel),
|
|
3816
|
-
onLog,
|
|
3855
|
+
onLog: async (level, log) => onLog(level, log),
|
|
3817
3856
|
treeshake: bindingifyTreeshakeOptions(inputOptions.treeshake),
|
|
3818
3857
|
moduleTypes: inputOptions.moduleTypes,
|
|
3819
3858
|
define: inputOptions.define ? Object.entries(inputOptions.define) : void 0,
|
|
@@ -3842,7 +3881,8 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
3842
3881
|
markModuleLoaded: pluginContextData.markModuleLoaded.bind(pluginContextData),
|
|
3843
3882
|
preserveEntrySignatures: bindingifyPreserveEntrySignatures(inputOptions.preserveEntrySignatures),
|
|
3844
3883
|
optimization: inputOptions.optimization,
|
|
3845
|
-
context: inputOptions.context
|
|
3884
|
+
context: inputOptions.context,
|
|
3885
|
+
tsconfig: inputOptions.resolve?.tsconfigFilename ?? inputOptions.tsconfig
|
|
3846
3886
|
};
|
|
3847
3887
|
}
|
|
3848
3888
|
function bindingifyHmr(hmr) {
|
|
@@ -4017,6 +4057,24 @@ function bindingifyTreeshakeOptions(config) {
|
|
|
4017
4057
|
unknownGlobalSideEffects: config.unknownGlobalSideEffects,
|
|
4018
4058
|
commonjs: config.commonjs
|
|
4019
4059
|
};
|
|
4060
|
+
switch (config.propertyReadSideEffects) {
|
|
4061
|
+
case "always":
|
|
4062
|
+
normalizedConfig.propertyReadSideEffects = BindingPropertyReadSideEffects.Always;
|
|
4063
|
+
break;
|
|
4064
|
+
case false:
|
|
4065
|
+
normalizedConfig.propertyReadSideEffects = BindingPropertyReadSideEffects.False;
|
|
4066
|
+
break;
|
|
4067
|
+
default:
|
|
4068
|
+
}
|
|
4069
|
+
switch (config.propertyWriteSideEffects) {
|
|
4070
|
+
case "always":
|
|
4071
|
+
normalizedConfig.propertyWriteSideEffects = BindingPropertyWriteSideEffects.Always;
|
|
4072
|
+
break;
|
|
4073
|
+
case false:
|
|
4074
|
+
normalizedConfig.propertyWriteSideEffects = BindingPropertyWriteSideEffects.False;
|
|
4075
|
+
break;
|
|
4076
|
+
default:
|
|
4077
|
+
}
|
|
4020
4078
|
if (config.moduleSideEffects === void 0) normalizedConfig.moduleSideEffects = true;
|
|
4021
4079
|
else if (config.moduleSideEffects === "no-external") normalizedConfig.moduleSideEffects = [{
|
|
4022
4080
|
external: true,
|
|
@@ -4401,4 +4459,4 @@ function defineConfig(config) {
|
|
|
4401
4459
|
const VERSION = version;
|
|
4402
4460
|
|
|
4403
4461
|
//#endregion
|
|
4404
|
-
export {
|
|
4462
|
+
export { PluginContextData, PluginDriver, VERSION, assetPlugin, bindingifyPlugin, build, buildImportAnalysisPlugin, createBuiltinPlugin, 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.35",
|
|
4
4
|
"description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"homepage": "https://rolldown.rs/",
|
|
@@ -92,10 +92,10 @@
|
|
|
92
92
|
"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
93
|
},
|
|
94
94
|
"dependencies": {
|
|
95
|
-
"@oxc-project/runtime": "=0.82.
|
|
96
|
-
"@oxc-project/types": "=0.82.
|
|
95
|
+
"@oxc-project/runtime": "=0.82.3",
|
|
96
|
+
"@oxc-project/types": "=0.82.3",
|
|
97
97
|
"ansis": "^4.0.0",
|
|
98
|
-
"@rolldown/pluginutils": "1.0.0-beta.
|
|
98
|
+
"@rolldown/pluginutils": "1.0.0-beta.35"
|
|
99
99
|
},
|
|
100
100
|
"devDependencies": {
|
|
101
101
|
"@napi-rs/cli": "^3.1.2",
|
|
@@ -108,10 +108,10 @@
|
|
|
108
108
|
"emnapi": "^1.2.0",
|
|
109
109
|
"execa": "^9.2.0",
|
|
110
110
|
"glob": "^11.0.0",
|
|
111
|
-
"oxc-parser": "=0.82.
|
|
111
|
+
"oxc-parser": "=0.82.3",
|
|
112
112
|
"pathe": "^2.0.3",
|
|
113
113
|
"remeda": "^2.10.0",
|
|
114
|
-
"rolldown-plugin-dts": "^0.
|
|
114
|
+
"rolldown-plugin-dts": "^0.16.0",
|
|
115
115
|
"rollup": "^4.18.0",
|
|
116
116
|
"signal-exit": "4.1.0",
|
|
117
117
|
"source-map": "^0.7.4",
|
|
@@ -119,24 +119,23 @@
|
|
|
119
119
|
"typedoc": "^0.28.0",
|
|
120
120
|
"typescript": "^5.7.3",
|
|
121
121
|
"valibot": "1.1.0",
|
|
122
|
-
"rolldown": "1.0.0-beta.
|
|
123
|
-
"@rolldown/testing": "0.0.1"
|
|
122
|
+
"rolldown": "1.0.0-beta.35"
|
|
124
123
|
},
|
|
125
124
|
"optionalDependencies": {
|
|
126
|
-
"@rolldown/binding-darwin-x64": "1.0.0-beta.
|
|
127
|
-
"@rolldown/binding-win32-x64-msvc": "1.0.0-beta.
|
|
128
|
-
"@rolldown/binding-linux-x64-gnu": "1.0.0-beta.
|
|
129
|
-
"@rolldown/binding-linux-x64-musl": "1.0.0-beta.
|
|
130
|
-
"@rolldown/binding-freebsd-x64": "1.0.0-beta.
|
|
131
|
-
"@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.
|
|
132
|
-
"@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.
|
|
133
|
-
"@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.
|
|
134
|
-
"@rolldown/binding-darwin-arm64": "1.0.0-beta.
|
|
135
|
-
"@rolldown/binding-linux-arm64-musl": "1.0.0-beta.
|
|
136
|
-
"@rolldown/binding-openharmony-arm64": "1.0.0-beta.
|
|
137
|
-
"@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.
|
|
138
|
-
"@rolldown/binding-android-arm64": "1.0.0-beta.
|
|
139
|
-
"@rolldown/binding-wasm32-wasi": "1.0.0-beta.
|
|
125
|
+
"@rolldown/binding-darwin-x64": "1.0.0-beta.35",
|
|
126
|
+
"@rolldown/binding-win32-x64-msvc": "1.0.0-beta.35",
|
|
127
|
+
"@rolldown/binding-linux-x64-gnu": "1.0.0-beta.35",
|
|
128
|
+
"@rolldown/binding-linux-x64-musl": "1.0.0-beta.35",
|
|
129
|
+
"@rolldown/binding-freebsd-x64": "1.0.0-beta.35",
|
|
130
|
+
"@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.35",
|
|
131
|
+
"@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.35",
|
|
132
|
+
"@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.35",
|
|
133
|
+
"@rolldown/binding-darwin-arm64": "1.0.0-beta.35",
|
|
134
|
+
"@rolldown/binding-linux-arm64-musl": "1.0.0-beta.35",
|
|
135
|
+
"@rolldown/binding-openharmony-arm64": "1.0.0-beta.35",
|
|
136
|
+
"@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.35",
|
|
137
|
+
"@rolldown/binding-android-arm64": "1.0.0-beta.35",
|
|
138
|
+
"@rolldown/binding-wasm32-wasi": "1.0.0-beta.35"
|
|
140
139
|
},
|
|
141
140
|
"scripts": {
|
|
142
141
|
"# Scrips for binding #": "_",
|