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,31 +1,41 @@
|
|
|
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-cePJvlvW.cjs');
|
|
3
3
|
const require_misc = require('./misc-DksvspN4.cjs');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
let node_worker_threads = require("node:worker_threads");
|
|
5
|
+
node_worker_threads = require_chunk.__toESM(node_worker_threads);
|
|
6
|
+
let node_path = require("node:path");
|
|
7
|
+
node_path = require_chunk.__toESM(node_path);
|
|
8
|
+
let node_url = require("node:url");
|
|
9
|
+
node_url = require_chunk.__toESM(node_url);
|
|
10
|
+
let ansis = require("ansis");
|
|
11
|
+
ansis = require_chunk.__toESM(ansis);
|
|
12
|
+
let __rolldown_pluginutils = require("@rolldown/pluginutils");
|
|
13
|
+
__rolldown_pluginutils = require_chunk.__toESM(__rolldown_pluginutils);
|
|
14
|
+
let node_fs_promises = require("node:fs/promises");
|
|
15
|
+
node_fs_promises = require_chunk.__toESM(node_fs_promises);
|
|
16
|
+
let node_os = require("node:os");
|
|
17
|
+
node_os = require_chunk.__toESM(node_os);
|
|
11
18
|
|
|
12
19
|
//#region package.json
|
|
13
|
-
var version = "1.0.0-beta.
|
|
20
|
+
var version = "1.0.0-beta.35";
|
|
14
21
|
var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
15
22
|
|
|
16
23
|
//#endregion
|
|
17
|
-
//#region src/utils
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
24
|
+
//#region src/builtin-plugin/utils.ts
|
|
25
|
+
const BuiltinClassSymbol = Symbol.for("__RolldownBuiltinPlugin__");
|
|
26
|
+
var BuiltinPlugin = class {
|
|
27
|
+
constructor(name, _options) {
|
|
28
|
+
this.name = name;
|
|
29
|
+
this._options = _options;
|
|
30
|
+
this[BuiltinClassSymbol] = true;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
function isBuiltinPlugin(obj) {
|
|
34
|
+
return obj && obj[BuiltinClassSymbol] === true;
|
|
22
35
|
}
|
|
23
|
-
function
|
|
24
|
-
return
|
|
36
|
+
function createBuiltinPlugin(name, options) {
|
|
37
|
+
return new BuiltinPlugin(name, options);
|
|
25
38
|
}
|
|
26
|
-
|
|
27
|
-
//#endregion
|
|
28
|
-
//#region src/builtin-plugin/utils.ts
|
|
29
39
|
function makeBuiltinPluginCallable(plugin) {
|
|
30
40
|
let callablePlugin = new require_parse_ast_index.BindingCallableBuiltinPlugin(bindingifyBuiltInPlugin(plugin));
|
|
31
41
|
const wrappedPlugin = plugin;
|
|
@@ -49,67 +59,6 @@ function bindingifyBuiltInPlugin(plugin) {
|
|
|
49
59
|
};
|
|
50
60
|
}
|
|
51
61
|
|
|
52
|
-
//#endregion
|
|
53
|
-
//#region src/builtin-plugin/constructors.ts
|
|
54
|
-
var BuiltinPlugin = class {
|
|
55
|
-
constructor(name, _options) {
|
|
56
|
-
this.name = name;
|
|
57
|
-
this._options = _options;
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
function modulePreloadPolyfillPlugin(config) {
|
|
61
|
-
return new BuiltinPlugin("builtin:module-preload-polyfill", config);
|
|
62
|
-
}
|
|
63
|
-
function dynamicImportVarsPlugin(config) {
|
|
64
|
-
if (config) {
|
|
65
|
-
config.include = normalizedStringOrRegex(config.include);
|
|
66
|
-
config.exclude = normalizedStringOrRegex(config.exclude);
|
|
67
|
-
}
|
|
68
|
-
return new BuiltinPlugin("builtin:dynamic-import-vars", config);
|
|
69
|
-
}
|
|
70
|
-
function importGlobPlugin(config) {
|
|
71
|
-
return new BuiltinPlugin("builtin:import-glob", config);
|
|
72
|
-
}
|
|
73
|
-
function reporterPlugin(config) {
|
|
74
|
-
return new BuiltinPlugin("builtin:reporter", config);
|
|
75
|
-
}
|
|
76
|
-
function manifestPlugin(config) {
|
|
77
|
-
return new BuiltinPlugin("builtin:manifest", config);
|
|
78
|
-
}
|
|
79
|
-
function wasmHelperPlugin(config) {
|
|
80
|
-
return new BuiltinPlugin("builtin:wasm-helper", config);
|
|
81
|
-
}
|
|
82
|
-
function wasmFallbackPlugin() {
|
|
83
|
-
const builtinPlugin = new BuiltinPlugin("builtin:wasm-fallback");
|
|
84
|
-
return makeBuiltinPluginCallable(builtinPlugin);
|
|
85
|
-
}
|
|
86
|
-
function loadFallbackPlugin() {
|
|
87
|
-
return new BuiltinPlugin("builtin:load-fallback");
|
|
88
|
-
}
|
|
89
|
-
function jsonPlugin(config) {
|
|
90
|
-
const builtinPlugin = new BuiltinPlugin("builtin:json", config);
|
|
91
|
-
return makeBuiltinPluginCallable(builtinPlugin);
|
|
92
|
-
}
|
|
93
|
-
function buildImportAnalysisPlugin(config) {
|
|
94
|
-
return new BuiltinPlugin("builtin:build-import-analysis", config);
|
|
95
|
-
}
|
|
96
|
-
function viteResolvePlugin(config) {
|
|
97
|
-
const builtinPlugin = new BuiltinPlugin("builtin:vite-resolve", config);
|
|
98
|
-
return makeBuiltinPluginCallable(builtinPlugin);
|
|
99
|
-
}
|
|
100
|
-
function isolatedDeclarationPlugin(config) {
|
|
101
|
-
return new BuiltinPlugin("builtin:isolated-declaration", config);
|
|
102
|
-
}
|
|
103
|
-
function assetPlugin(config) {
|
|
104
|
-
return new BuiltinPlugin("builtin:asset", config);
|
|
105
|
-
}
|
|
106
|
-
function webWorkerPostPlugin() {
|
|
107
|
-
return new BuiltinPlugin("builtin:web-worker-post");
|
|
108
|
-
}
|
|
109
|
-
function oxcRuntimePlugin(config) {
|
|
110
|
-
return new BuiltinPlugin("builtin:oxc-runtime", config);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
62
|
//#endregion
|
|
114
63
|
//#region src/log/logging.ts
|
|
115
64
|
const LOG_LEVEL_SILENT = "silent";
|
|
@@ -234,6 +183,75 @@ function normalizeHook(hook) {
|
|
|
234
183
|
require_misc.unreachable("Invalid hook type");
|
|
235
184
|
}
|
|
236
185
|
|
|
186
|
+
//#endregion
|
|
187
|
+
//#region src/utils/normalize-string-or-regex.ts
|
|
188
|
+
function normalizedStringOrRegex(pattern) {
|
|
189
|
+
if (!pattern) return void 0;
|
|
190
|
+
if (!isReadonlyArray(pattern)) return [pattern];
|
|
191
|
+
return pattern;
|
|
192
|
+
}
|
|
193
|
+
function isReadonlyArray(input) {
|
|
194
|
+
return Array.isArray(input);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
//#endregion
|
|
198
|
+
//#region src/builtin-plugin/constructors.ts
|
|
199
|
+
function modulePreloadPolyfillPlugin(config) {
|
|
200
|
+
return createBuiltinPlugin("builtin:module-preload-polyfill", config);
|
|
201
|
+
}
|
|
202
|
+
function dynamicImportVarsPlugin(config) {
|
|
203
|
+
if (config) {
|
|
204
|
+
config.include = normalizedStringOrRegex(config.include);
|
|
205
|
+
config.exclude = normalizedStringOrRegex(config.exclude);
|
|
206
|
+
}
|
|
207
|
+
return createBuiltinPlugin("builtin:dynamic-import-vars", config);
|
|
208
|
+
}
|
|
209
|
+
function importGlobPlugin(config) {
|
|
210
|
+
return createBuiltinPlugin("builtin:import-glob", config);
|
|
211
|
+
}
|
|
212
|
+
function reporterPlugin(config) {
|
|
213
|
+
return createBuiltinPlugin("builtin:reporter", config);
|
|
214
|
+
}
|
|
215
|
+
function manifestPlugin(config) {
|
|
216
|
+
return createBuiltinPlugin("builtin:manifest", config);
|
|
217
|
+
}
|
|
218
|
+
function wasmHelperPlugin(config) {
|
|
219
|
+
return createBuiltinPlugin("builtin:wasm-helper", config);
|
|
220
|
+
}
|
|
221
|
+
function wasmFallbackPlugin() {
|
|
222
|
+
const builtinPlugin = createBuiltinPlugin("builtin:wasm-fallback");
|
|
223
|
+
return makeBuiltinPluginCallable(builtinPlugin);
|
|
224
|
+
}
|
|
225
|
+
function loadFallbackPlugin() {
|
|
226
|
+
return createBuiltinPlugin("builtin:load-fallback");
|
|
227
|
+
}
|
|
228
|
+
function jsonPlugin(config) {
|
|
229
|
+
const builtinPlugin = createBuiltinPlugin("builtin:json", config);
|
|
230
|
+
return makeBuiltinPluginCallable(builtinPlugin);
|
|
231
|
+
}
|
|
232
|
+
function buildImportAnalysisPlugin(config) {
|
|
233
|
+
return createBuiltinPlugin("builtin:build-import-analysis", config);
|
|
234
|
+
}
|
|
235
|
+
function viteResolvePlugin(config) {
|
|
236
|
+
const builtinPlugin = createBuiltinPlugin("builtin:vite-resolve", config);
|
|
237
|
+
return makeBuiltinPluginCallable(builtinPlugin);
|
|
238
|
+
}
|
|
239
|
+
function isolatedDeclarationPlugin(config) {
|
|
240
|
+
return createBuiltinPlugin("builtin:isolated-declaration", config);
|
|
241
|
+
}
|
|
242
|
+
function assetPlugin(config) {
|
|
243
|
+
return createBuiltinPlugin("builtin:asset", config);
|
|
244
|
+
}
|
|
245
|
+
function webWorkerPostPlugin() {
|
|
246
|
+
return createBuiltinPlugin("builtin:web-worker-post");
|
|
247
|
+
}
|
|
248
|
+
function oxcRuntimePlugin(config) {
|
|
249
|
+
return createBuiltinPlugin("builtin:oxc-runtime", config);
|
|
250
|
+
}
|
|
251
|
+
function esmExternalRequirePlugin(config) {
|
|
252
|
+
return createBuiltinPlugin("builtin:esm-external-require", config);
|
|
253
|
+
}
|
|
254
|
+
|
|
237
255
|
//#endregion
|
|
238
256
|
//#region src/constants/plugin.ts
|
|
239
257
|
const ENUMERATED_INPUT_PLUGIN_HOOK_NAMES = [
|
|
@@ -325,7 +343,7 @@ function checkOutputPluginOption(plugins, onLog) {
|
|
|
325
343
|
function normalizePlugins(plugins, anonymousPrefix) {
|
|
326
344
|
for (const [index, plugin] of plugins.entries()) {
|
|
327
345
|
if ("_parallel" in plugin) continue;
|
|
328
|
-
if (plugin
|
|
346
|
+
if (isBuiltinPlugin(plugin)) continue;
|
|
329
347
|
if (!plugin.name) plugin.name = `${anonymousPrefix}${index + 1}`;
|
|
330
348
|
}
|
|
331
349
|
return plugins;
|
|
@@ -394,7 +412,7 @@ function getObjectPlugins(plugins) {
|
|
|
394
412
|
return plugins.filter((plugin) => {
|
|
395
413
|
if (!plugin) return void 0;
|
|
396
414
|
if ("_parallel" in plugin) return void 0;
|
|
397
|
-
if (plugin
|
|
415
|
+
if (isBuiltinPlugin(plugin)) return void 0;
|
|
398
416
|
return plugin;
|
|
399
417
|
});
|
|
400
418
|
}
|
|
@@ -1901,7 +1919,7 @@ const TransformOptionsSchema = object({
|
|
|
1901
1919
|
typescript: optional(TypescriptSchema),
|
|
1902
1920
|
helpers: optional(HelpersSchema),
|
|
1903
1921
|
decorators: optional(DecoratorOptionSchema),
|
|
1904
|
-
jsx: optional(JsxOptionsSchema),
|
|
1922
|
+
jsx: optional(union([literal("preserve"), JsxOptionsSchema])),
|
|
1905
1923
|
target: pipe(optional(union([string(), array(string())])), description("The JavaScript target environment"))
|
|
1906
1924
|
});
|
|
1907
1925
|
const WatchOptionsSchema = strictObject({
|
|
@@ -1929,7 +1947,8 @@ const ChecksOptionsSchema = strictObject({
|
|
|
1929
1947
|
commonJsVariableInEsm: pipe(optional(boolean()), description("Whether to emit warning when detecting common js variable in esm")),
|
|
1930
1948
|
importIsUndefined: pipe(optional(boolean()), description("Whether to emit warning when detecting import is undefined")),
|
|
1931
1949
|
emptyImportMeta: pipe(optional(boolean()), description("Whether to emit warning when detecting empty import meta")),
|
|
1932
|
-
configurationFieldConflict: pipe(optional(boolean()), description("Whether to emit warning when detecting configuration field conflict"))
|
|
1950
|
+
configurationFieldConflict: pipe(optional(boolean()), description("Whether to emit warning when detecting configuration field conflict")),
|
|
1951
|
+
preferBuiltinFeature: pipe(optional(boolean()), description("Whether to emit warning when detecting prefer builtin feature"))
|
|
1933
1952
|
});
|
|
1934
1953
|
const MinifyOptionsSchema = strictObject({
|
|
1935
1954
|
mangle: optional(boolean()),
|
|
@@ -1947,17 +1966,25 @@ const ResolveOptionsSchema = strictObject({
|
|
|
1947
1966
|
mainFiles: optional(array(string())),
|
|
1948
1967
|
modules: optional(array(string())),
|
|
1949
1968
|
symlinks: optional(boolean()),
|
|
1950
|
-
tsconfigFilename: optional(string()),
|
|
1951
1969
|
yarnPnp: optional(boolean())
|
|
1952
1970
|
});
|
|
1953
1971
|
const TreeshakingOptionsSchema = union([boolean(), looseObject({
|
|
1954
1972
|
annotations: optional(boolean()),
|
|
1955
1973
|
manualPureFunctions: optional(array(string())),
|
|
1956
1974
|
unknownGlobalSideEffects: optional(boolean()),
|
|
1957
|
-
commonjs: optional(boolean())
|
|
1975
|
+
commonjs: optional(boolean()),
|
|
1976
|
+
propertyReadSideEffects: optional(union([literal(false), literal("always")])),
|
|
1977
|
+
propertyWriteSideEffects: optional(union([literal(false), literal("always")]))
|
|
1958
1978
|
})]);
|
|
1959
1979
|
const OptimizationOptionsSchema = strictObject({
|
|
1960
|
-
inlineConst: pipe(optional(
|
|
1980
|
+
inlineConst: pipe(optional(union([
|
|
1981
|
+
boolean(),
|
|
1982
|
+
literal("smart"),
|
|
1983
|
+
strictObject({
|
|
1984
|
+
mode: optional(union([literal("all"), literal("smart")])),
|
|
1985
|
+
pass: optional(number())
|
|
1986
|
+
})
|
|
1987
|
+
])), description("Enable crossmodule constant inlining")),
|
|
1961
1988
|
pifeForModuleWrappers: pipe(optional(boolean()), description("Use PIFE pattern for module wrappers"))
|
|
1962
1989
|
});
|
|
1963
1990
|
const OnLogSchema = pipe(function_(), args(tuple([
|
|
@@ -1967,6 +1994,7 @@ const OnLogSchema = pipe(function_(), args(tuple([
|
|
|
1967
1994
|
])));
|
|
1968
1995
|
const OnwarnSchema = pipe(function_(), args(tuple([RollupLogSchema, pipe(function_(), args(tuple([union([RollupLogWithStringSchema, pipe(function_(), returns(RollupLogWithStringSchema))])])))])));
|
|
1969
1996
|
const HmrSchema = union([boolean(), strictObject({
|
|
1997
|
+
new: optional(boolean()),
|
|
1970
1998
|
port: optional(number()),
|
|
1971
1999
|
host: optional(string()),
|
|
1972
2000
|
implement: optional(string())
|
|
@@ -2031,7 +2059,8 @@ const InputOptionsSchema = strictObject({
|
|
|
2031
2059
|
literal("allow-extension"),
|
|
2032
2060
|
literal("exports-only"),
|
|
2033
2061
|
literal(false)
|
|
2034
|
-
])))
|
|
2062
|
+
]))),
|
|
2063
|
+
tsconfig: pipe(optional(string()), description("Path to the tsconfig.json file."))
|
|
2035
2064
|
});
|
|
2036
2065
|
const InputCliOverrideSchema = strictObject({
|
|
2037
2066
|
input: pipe(optional(array(string())), description("Entry file")),
|
|
@@ -2153,7 +2182,8 @@ const OutputOptionsSchema = strictObject({
|
|
|
2153
2182
|
preserveModules: pipe(optional(boolean()), description("Preserve module structure")),
|
|
2154
2183
|
preserveModulesRoot: pipe(optional(string()), description("Put preserved modules under this path at root level")),
|
|
2155
2184
|
virtualDirname: optional(string()),
|
|
2156
|
-
minifyInternalExports: pipe(optional(boolean()), description("Minify internal exports"))
|
|
2185
|
+
minifyInternalExports: pipe(optional(boolean()), description("Minify internal exports")),
|
|
2186
|
+
topLevelVar: pipe(optional(boolean()), description("Rewrite top-level declarations to use `var`."))
|
|
2157
2187
|
});
|
|
2158
2188
|
const getAddonDescription = (placement, wrapper) => {
|
|
2159
2189
|
return `Code to insert the ${ansis.default.bold(placement)} of the bundled file (${ansis.default.bold(wrapper)} the wrapper function)`;
|
|
@@ -2201,15 +2231,19 @@ function validateCliOptions(options) {
|
|
|
2201
2231
|
return `Invalid value for option ${option}: ${issue.message}`;
|
|
2202
2232
|
})];
|
|
2203
2233
|
}
|
|
2204
|
-
const inputHelperMsgRecord = {
|
|
2234
|
+
const inputHelperMsgRecord = {
|
|
2235
|
+
output: { ignored: true },
|
|
2236
|
+
"resolve.tsconfigFilename": { issueMsg: "It is deprecated. Please use the top-level `tsconfig` option instead." }
|
|
2237
|
+
};
|
|
2205
2238
|
const outputHelperMsgRecord = {};
|
|
2206
2239
|
function validateOption(key, options) {
|
|
2240
|
+
if (typeof options !== "object") throw new Error(`Invalid ${key} options. Expected an Object but received ${JSON.stringify(options)}.`);
|
|
2207
2241
|
if (globalThis.process?.env?.ROLLUP_TEST) return;
|
|
2208
2242
|
let parsed = safeParse(key === "input" ? InputOptionsSchema : OutputOptionsSchema, options);
|
|
2209
2243
|
if (!parsed.success) {
|
|
2210
2244
|
const errors = parsed.issues.map((issue) => {
|
|
2211
|
-
const issuePaths = issue.path.map((path$2) => path$2.key);
|
|
2212
2245
|
let issueMsg = issue.message;
|
|
2246
|
+
const issuePaths = issue.path.map((path$2) => path$2.key);
|
|
2213
2247
|
if (issue.type === "union") {
|
|
2214
2248
|
const subIssue = issue.issues?.find((i) => !(i.type !== issue.received && i.input === issue.input));
|
|
2215
2249
|
if (subIssue) {
|
|
@@ -2220,9 +2254,9 @@ function validateOption(key, options) {
|
|
|
2220
2254
|
const stringPath = issuePaths.join(".");
|
|
2221
2255
|
const helper = key === "input" ? inputHelperMsgRecord[stringPath] : outputHelperMsgRecord[stringPath];
|
|
2222
2256
|
if (helper && helper.ignored) return "";
|
|
2223
|
-
return `- For the "${stringPath}". ${issueMsg}
|
|
2257
|
+
return `- For the "${stringPath}". ${helper?.issueMsg || issueMsg + "."} ${helper?.help ? `\n Help: ${helper.help}` : ""}`;
|
|
2224
2258
|
}).filter(Boolean);
|
|
2225
|
-
if (errors.length) console.warn(
|
|
2259
|
+
if (errors.length) console.warn(`\x1b[33mWarning: Invalid ${key} options (${errors.length} issue${errors.length === 1 ? "" : "s"} found)\n${errors.join("\n")}\x1b[0m`);
|
|
2226
2260
|
}
|
|
2227
2261
|
}
|
|
2228
2262
|
function getInputCliKeys() {
|
|
@@ -2295,6 +2329,10 @@ function getErrorMessage(e$1) {
|
|
|
2295
2329
|
s += message;
|
|
2296
2330
|
if (e$1.frame) s = joinNewLine(s, e$1.frame);
|
|
2297
2331
|
if (e$1.stack) s = joinNewLine(s, e$1.stack.replace(message, ""));
|
|
2332
|
+
if (e$1.cause) {
|
|
2333
|
+
s = joinNewLine(s, "Caused by:");
|
|
2334
|
+
s = joinNewLine(s, getErrorMessage(e$1.cause).split("\n").map((line) => " " + line).join("\n"));
|
|
2335
|
+
}
|
|
2298
2336
|
return s;
|
|
2299
2337
|
}
|
|
2300
2338
|
function joinNewLine(s1, s2) {
|
|
@@ -2607,7 +2645,8 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
|
2607
2645
|
...res,
|
|
2608
2646
|
external: res.external === "relative" ? require_misc.unreachable(`The PluginContext resolve result external couldn't be 'relative'`) : res.external,
|
|
2609
2647
|
...info,
|
|
2610
|
-
moduleSideEffects: info.moduleSideEffects ?? res.moduleSideEffects ?? null
|
|
2648
|
+
moduleSideEffects: info.moduleSideEffects ?? res.moduleSideEffects ?? null,
|
|
2649
|
+
packageJsonPath: res.packageJsonPath
|
|
2611
2650
|
};
|
|
2612
2651
|
}
|
|
2613
2652
|
emitFile = (file) => {
|
|
@@ -2733,7 +2772,8 @@ function bindingifyResolveId(args$1) {
|
|
|
2733
2772
|
id: ret.id,
|
|
2734
2773
|
external: ret.external,
|
|
2735
2774
|
normalizeExternalId: false,
|
|
2736
|
-
moduleSideEffects: exist.moduleSideEffects ?? void 0
|
|
2775
|
+
moduleSideEffects: exist.moduleSideEffects ?? void 0,
|
|
2776
|
+
packageJsonPath: ret.packageJsonPath
|
|
2737
2777
|
};
|
|
2738
2778
|
},
|
|
2739
2779
|
meta: bindingifyPluginHookMeta(meta),
|
|
@@ -3659,7 +3699,13 @@ var NormalizedOutputOptionsImpl = class {
|
|
|
3659
3699
|
return this.outputOptions.sourcemapPathTransform;
|
|
3660
3700
|
}
|
|
3661
3701
|
get minify() {
|
|
3662
|
-
|
|
3702
|
+
let ret = this.inner.minify;
|
|
3703
|
+
if (typeof ret === "object" && ret !== null) {
|
|
3704
|
+
delete ret["codegen"];
|
|
3705
|
+
delete ret["module"];
|
|
3706
|
+
delete ret["sourcemap"];
|
|
3707
|
+
}
|
|
3708
|
+
return ret;
|
|
3663
3709
|
}
|
|
3664
3710
|
get legalComments() {
|
|
3665
3711
|
return this.inner.legalComments;
|
|
@@ -3801,7 +3847,7 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
3801
3847
|
const pluginContextData = new PluginContextData(onLog, outputOptions, normalizedOutputPlugins);
|
|
3802
3848
|
const plugins = rawPlugins.map((plugin) => {
|
|
3803
3849
|
if ("_parallel" in plugin) return void 0;
|
|
3804
|
-
if (plugin
|
|
3850
|
+
if (isBuiltinPlugin(plugin)) return bindingifyBuiltInPlugin(plugin);
|
|
3805
3851
|
return bindingifyPlugin(plugin, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode);
|
|
3806
3852
|
});
|
|
3807
3853
|
const { jsx, transform } = bindingifyJsx(onLog, inputOptions.jsx, inputOptions.transform);
|
|
@@ -3814,7 +3860,7 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
3814
3860
|
platform: inputOptions.platform,
|
|
3815
3861
|
shimMissingExports: inputOptions.shimMissingExports,
|
|
3816
3862
|
logLevel: bindingifyLogLevel(logLevel),
|
|
3817
|
-
onLog,
|
|
3863
|
+
onLog: async (level, log) => onLog(level, log),
|
|
3818
3864
|
treeshake: bindingifyTreeshakeOptions(inputOptions.treeshake),
|
|
3819
3865
|
moduleTypes: inputOptions.moduleTypes,
|
|
3820
3866
|
define: inputOptions.define ? Object.entries(inputOptions.define) : void 0,
|
|
@@ -3843,7 +3889,8 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
3843
3889
|
markModuleLoaded: pluginContextData.markModuleLoaded.bind(pluginContextData),
|
|
3844
3890
|
preserveEntrySignatures: bindingifyPreserveEntrySignatures(inputOptions.preserveEntrySignatures),
|
|
3845
3891
|
optimization: inputOptions.optimization,
|
|
3846
|
-
context: inputOptions.context
|
|
3892
|
+
context: inputOptions.context,
|
|
3893
|
+
tsconfig: inputOptions.resolve?.tsconfigFilename ?? inputOptions.tsconfig
|
|
3847
3894
|
};
|
|
3848
3895
|
}
|
|
3849
3896
|
function bindingifyHmr(hmr) {
|
|
@@ -4018,6 +4065,24 @@ function bindingifyTreeshakeOptions(config) {
|
|
|
4018
4065
|
unknownGlobalSideEffects: config.unknownGlobalSideEffects,
|
|
4019
4066
|
commonjs: config.commonjs
|
|
4020
4067
|
};
|
|
4068
|
+
switch (config.propertyReadSideEffects) {
|
|
4069
|
+
case "always":
|
|
4070
|
+
normalizedConfig.propertyReadSideEffects = require_parse_ast_index.BindingPropertyReadSideEffects.Always;
|
|
4071
|
+
break;
|
|
4072
|
+
case false:
|
|
4073
|
+
normalizedConfig.propertyReadSideEffects = require_parse_ast_index.BindingPropertyReadSideEffects.False;
|
|
4074
|
+
break;
|
|
4075
|
+
default:
|
|
4076
|
+
}
|
|
4077
|
+
switch (config.propertyWriteSideEffects) {
|
|
4078
|
+
case "always":
|
|
4079
|
+
normalizedConfig.propertyWriteSideEffects = require_parse_ast_index.BindingPropertyWriteSideEffects.Always;
|
|
4080
|
+
break;
|
|
4081
|
+
case false:
|
|
4082
|
+
normalizedConfig.propertyWriteSideEffects = require_parse_ast_index.BindingPropertyWriteSideEffects.False;
|
|
4083
|
+
break;
|
|
4084
|
+
default:
|
|
4085
|
+
}
|
|
4021
4086
|
if (config.moduleSideEffects === void 0) normalizedConfig.moduleSideEffects = true;
|
|
4022
4087
|
else if (config.moduleSideEffects === "no-external") normalizedConfig.moduleSideEffects = [{
|
|
4023
4088
|
external: true,
|
|
@@ -4402,12 +4467,6 @@ function defineConfig(config) {
|
|
|
4402
4467
|
const VERSION = version;
|
|
4403
4468
|
|
|
4404
4469
|
//#endregion
|
|
4405
|
-
Object.defineProperty(exports, 'BuiltinPlugin', {
|
|
4406
|
-
enumerable: true,
|
|
4407
|
-
get: function () {
|
|
4408
|
-
return BuiltinPlugin;
|
|
4409
|
-
}
|
|
4410
|
-
});
|
|
4411
4470
|
Object.defineProperty(exports, 'PluginContextData', {
|
|
4412
4471
|
enumerable: true,
|
|
4413
4472
|
get: function () {
|
|
@@ -4450,12 +4509,24 @@ Object.defineProperty(exports, 'buildImportAnalysisPlugin', {
|
|
|
4450
4509
|
return buildImportAnalysisPlugin;
|
|
4451
4510
|
}
|
|
4452
4511
|
});
|
|
4512
|
+
Object.defineProperty(exports, 'createBuiltinPlugin', {
|
|
4513
|
+
enumerable: true,
|
|
4514
|
+
get: function () {
|
|
4515
|
+
return createBuiltinPlugin;
|
|
4516
|
+
}
|
|
4517
|
+
});
|
|
4453
4518
|
Object.defineProperty(exports, 'createBundlerImpl', {
|
|
4454
4519
|
enumerable: true,
|
|
4455
4520
|
get: function () {
|
|
4456
4521
|
return createBundlerImpl;
|
|
4457
4522
|
}
|
|
4458
4523
|
});
|
|
4524
|
+
Object.defineProperty(exports, 'createBundlerOptions', {
|
|
4525
|
+
enumerable: true,
|
|
4526
|
+
get: function () {
|
|
4527
|
+
return createBundlerOptions;
|
|
4528
|
+
}
|
|
4529
|
+
});
|
|
4459
4530
|
Object.defineProperty(exports, 'defineConfig', {
|
|
4460
4531
|
enumerable: true,
|
|
4461
4532
|
get: function () {
|
|
@@ -4474,6 +4545,12 @@ Object.defineProperty(exports, 'dynamicImportVarsPlugin', {
|
|
|
4474
4545
|
return dynamicImportVarsPlugin;
|
|
4475
4546
|
}
|
|
4476
4547
|
});
|
|
4548
|
+
Object.defineProperty(exports, 'esmExternalRequirePlugin', {
|
|
4549
|
+
enumerable: true,
|
|
4550
|
+
get: function () {
|
|
4551
|
+
return esmExternalRequirePlugin;
|
|
4552
|
+
}
|
|
4553
|
+
});
|
|
4477
4554
|
Object.defineProperty(exports, 'getInputCliKeys', {
|
|
4478
4555
|
enumerable: true,
|
|
4479
4556
|
get: function () {
|