rolldown 1.0.0-beta.33 → 1.0.0-beta.34
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 +5 -5
- package/dist/cli.mjs +5 -5
- 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 +36 -2
- package/dist/experimental-index.d.cts +36 -4
- package/dist/experimental-index.d.mts +36 -4
- package/dist/experimental-index.mjs +34 -3
- 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 +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 -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-D5AluabE.d.cts} +63 -24
- package/dist/shared/{define-config-DtlZ1GSS.d.mts → define-config-DVSr6Unb.d.mts} +63 -24
- package/dist/shared/{load-config-C00QU0Nl.mjs → load-config-CXpGBNqp.mjs} +1 -1
- package/dist/shared/{load-config-B-y3XROZ.cjs → load-config-CefxSUnT.cjs} +1 -1
- package/dist/shared/{parse-ast-index-DBzcfyxO.cjs → parse-ast-index-BCv3Y1TT.cjs} +31 -25
- package/dist/shared/{parse-ast-index-BsbuAWqn.mjs → parse-ast-index-DjojK-Vf.mjs} +26 -26
- package/dist/shared/{src-D1dc6nJr.mjs → src-Chn1S4O2.mjs} +98 -84
- package/dist/shared/{src-DZTBSVJk.cjs → src-djpzntWm.cjs} +109 -83
- package/package.json +20 -20
|
@@ -1,4 +1,4 @@
|
|
|
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, BindingWatcher, ParallelJsPluginRegistry, augmentCodeLocation, error, logCycleLoading, logDuplicateJsxConfig, logInputHookInOutputPlugin, logInvalidLogPosition, logMultiplyNotifyOption, logPluginError, parseAst, shutdownAsyncRuntime, startAsyncRuntime } from "./parse-ast-index-DjojK-Vf.mjs";
|
|
2
2
|
import { arraify, noop, unimplemented, unreachable, unsupported } from "./misc-CQeo-AFx.mjs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
@@ -9,22 +9,17 @@ import os from "node:os";
|
|
|
9
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.34";
|
|
13
13
|
var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
14
14
|
|
|
15
|
-
//#endregion
|
|
16
|
-
//#region src/utils/normalize-string-or-regex.ts
|
|
17
|
-
function normalizedStringOrRegex(pattern) {
|
|
18
|
-
if (!pattern) return void 0;
|
|
19
|
-
if (!isReadonlyArray(pattern)) return [pattern];
|
|
20
|
-
return pattern;
|
|
21
|
-
}
|
|
22
|
-
function isReadonlyArray(input) {
|
|
23
|
-
return Array.isArray(input);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
15
|
//#endregion
|
|
27
16
|
//#region src/builtin-plugin/utils.ts
|
|
17
|
+
var BuiltinPlugin = class {
|
|
18
|
+
constructor(name, _options) {
|
|
19
|
+
this.name = name;
|
|
20
|
+
this._options = _options;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
28
23
|
function makeBuiltinPluginCallable(plugin) {
|
|
29
24
|
let callablePlugin = new BindingCallableBuiltinPlugin(bindingifyBuiltInPlugin(plugin));
|
|
30
25
|
const wrappedPlugin = plugin;
|
|
@@ -48,67 +43,6 @@ function bindingifyBuiltInPlugin(plugin) {
|
|
|
48
43
|
};
|
|
49
44
|
}
|
|
50
45
|
|
|
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
46
|
//#endregion
|
|
113
47
|
//#region src/log/logging.ts
|
|
114
48
|
const LOG_LEVEL_SILENT = "silent";
|
|
@@ -233,6 +167,75 @@ function normalizeHook(hook) {
|
|
|
233
167
|
unreachable("Invalid hook type");
|
|
234
168
|
}
|
|
235
169
|
|
|
170
|
+
//#endregion
|
|
171
|
+
//#region src/utils/normalize-string-or-regex.ts
|
|
172
|
+
function normalizedStringOrRegex(pattern) {
|
|
173
|
+
if (!pattern) return void 0;
|
|
174
|
+
if (!isReadonlyArray(pattern)) return [pattern];
|
|
175
|
+
return pattern;
|
|
176
|
+
}
|
|
177
|
+
function isReadonlyArray(input) {
|
|
178
|
+
return Array.isArray(input);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
//#endregion
|
|
182
|
+
//#region src/builtin-plugin/constructors.ts
|
|
183
|
+
function modulePreloadPolyfillPlugin(config) {
|
|
184
|
+
return new BuiltinPlugin("builtin:module-preload-polyfill", config);
|
|
185
|
+
}
|
|
186
|
+
function dynamicImportVarsPlugin(config) {
|
|
187
|
+
if (config) {
|
|
188
|
+
config.include = normalizedStringOrRegex(config.include);
|
|
189
|
+
config.exclude = normalizedStringOrRegex(config.exclude);
|
|
190
|
+
}
|
|
191
|
+
return new BuiltinPlugin("builtin:dynamic-import-vars", config);
|
|
192
|
+
}
|
|
193
|
+
function importGlobPlugin(config) {
|
|
194
|
+
return new BuiltinPlugin("builtin:import-glob", config);
|
|
195
|
+
}
|
|
196
|
+
function reporterPlugin(config) {
|
|
197
|
+
return new BuiltinPlugin("builtin:reporter", config);
|
|
198
|
+
}
|
|
199
|
+
function manifestPlugin(config) {
|
|
200
|
+
return new BuiltinPlugin("builtin:manifest", config);
|
|
201
|
+
}
|
|
202
|
+
function wasmHelperPlugin(config) {
|
|
203
|
+
return new BuiltinPlugin("builtin:wasm-helper", config);
|
|
204
|
+
}
|
|
205
|
+
function wasmFallbackPlugin() {
|
|
206
|
+
const builtinPlugin = new BuiltinPlugin("builtin:wasm-fallback");
|
|
207
|
+
return makeBuiltinPluginCallable(builtinPlugin);
|
|
208
|
+
}
|
|
209
|
+
function loadFallbackPlugin() {
|
|
210
|
+
return new BuiltinPlugin("builtin:load-fallback");
|
|
211
|
+
}
|
|
212
|
+
function jsonPlugin(config) {
|
|
213
|
+
const builtinPlugin = new BuiltinPlugin("builtin:json", config);
|
|
214
|
+
return makeBuiltinPluginCallable(builtinPlugin);
|
|
215
|
+
}
|
|
216
|
+
function buildImportAnalysisPlugin(config) {
|
|
217
|
+
return new BuiltinPlugin("builtin:build-import-analysis", config);
|
|
218
|
+
}
|
|
219
|
+
function viteResolvePlugin(config) {
|
|
220
|
+
const builtinPlugin = new BuiltinPlugin("builtin:vite-resolve", config);
|
|
221
|
+
return makeBuiltinPluginCallable(builtinPlugin);
|
|
222
|
+
}
|
|
223
|
+
function isolatedDeclarationPlugin(config) {
|
|
224
|
+
return new BuiltinPlugin("builtin:isolated-declaration", config);
|
|
225
|
+
}
|
|
226
|
+
function assetPlugin(config) {
|
|
227
|
+
return new BuiltinPlugin("builtin:asset", config);
|
|
228
|
+
}
|
|
229
|
+
function webWorkerPostPlugin() {
|
|
230
|
+
return new BuiltinPlugin("builtin:web-worker-post");
|
|
231
|
+
}
|
|
232
|
+
function oxcRuntimePlugin(config) {
|
|
233
|
+
return new BuiltinPlugin("builtin:oxc-runtime", config);
|
|
234
|
+
}
|
|
235
|
+
function esmExternalRequirePlugin(config) {
|
|
236
|
+
return new BuiltinPlugin("builtin:esm-external-require", config);
|
|
237
|
+
}
|
|
238
|
+
|
|
236
239
|
//#endregion
|
|
237
240
|
//#region src/constants/plugin.ts
|
|
238
241
|
const ENUMERATED_INPUT_PLUGIN_HOOK_NAMES = [
|
|
@@ -1900,7 +1903,7 @@ const TransformOptionsSchema = object({
|
|
|
1900
1903
|
typescript: optional(TypescriptSchema),
|
|
1901
1904
|
helpers: optional(HelpersSchema),
|
|
1902
1905
|
decorators: optional(DecoratorOptionSchema),
|
|
1903
|
-
jsx: optional(JsxOptionsSchema),
|
|
1906
|
+
jsx: optional(union([literal("preserve"), JsxOptionsSchema])),
|
|
1904
1907
|
target: pipe(optional(union([string(), array(string())])), description("The JavaScript target environment"))
|
|
1905
1908
|
});
|
|
1906
1909
|
const WatchOptionsSchema = strictObject({
|
|
@@ -1928,7 +1931,8 @@ const ChecksOptionsSchema = strictObject({
|
|
|
1928
1931
|
commonJsVariableInEsm: pipe(optional(boolean()), description("Whether to emit warning when detecting common js variable in esm")),
|
|
1929
1932
|
importIsUndefined: pipe(optional(boolean()), description("Whether to emit warning when detecting import is undefined")),
|
|
1930
1933
|
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"))
|
|
1934
|
+
configurationFieldConflict: pipe(optional(boolean()), description("Whether to emit warning when detecting configuration field conflict")),
|
|
1935
|
+
preferBuiltinFeature: pipe(optional(boolean()), description("Whether to emit warning when detecting prefer builtin feature"))
|
|
1932
1936
|
});
|
|
1933
1937
|
const MinifyOptionsSchema = strictObject({
|
|
1934
1938
|
mangle: optional(boolean()),
|
|
@@ -1946,7 +1950,6 @@ const ResolveOptionsSchema = strictObject({
|
|
|
1946
1950
|
mainFiles: optional(array(string())),
|
|
1947
1951
|
modules: optional(array(string())),
|
|
1948
1952
|
symlinks: optional(boolean()),
|
|
1949
|
-
tsconfigFilename: optional(string()),
|
|
1950
1953
|
yarnPnp: optional(boolean())
|
|
1951
1954
|
});
|
|
1952
1955
|
const TreeshakingOptionsSchema = union([boolean(), looseObject({
|
|
@@ -2030,7 +2033,8 @@ const InputOptionsSchema = strictObject({
|
|
|
2030
2033
|
literal("allow-extension"),
|
|
2031
2034
|
literal("exports-only"),
|
|
2032
2035
|
literal(false)
|
|
2033
|
-
])))
|
|
2036
|
+
]))),
|
|
2037
|
+
tsconfig: pipe(optional(string()), description("Path to the tsconfig.json file."))
|
|
2034
2038
|
});
|
|
2035
2039
|
const InputCliOverrideSchema = strictObject({
|
|
2036
2040
|
input: pipe(optional(array(string())), description("Entry file")),
|
|
@@ -2152,7 +2156,8 @@ const OutputOptionsSchema = strictObject({
|
|
|
2152
2156
|
preserveModules: pipe(optional(boolean()), description("Preserve module structure")),
|
|
2153
2157
|
preserveModulesRoot: pipe(optional(string()), description("Put preserved modules under this path at root level")),
|
|
2154
2158
|
virtualDirname: optional(string()),
|
|
2155
|
-
minifyInternalExports: pipe(optional(boolean()), description("Minify internal exports"))
|
|
2159
|
+
minifyInternalExports: pipe(optional(boolean()), description("Minify internal exports")),
|
|
2160
|
+
topLevelVar: pipe(optional(boolean()), description("Rewrite top-level declarations to use `var`."))
|
|
2156
2161
|
});
|
|
2157
2162
|
const getAddonDescription = (placement, wrapper) => {
|
|
2158
2163
|
return `Code to insert the ${colors.bold(placement)} of the bundled file (${colors.bold(wrapper)} the wrapper function)`;
|
|
@@ -2606,7 +2611,8 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
|
2606
2611
|
...res,
|
|
2607
2612
|
external: res.external === "relative" ? unreachable(`The PluginContext resolve result external couldn't be 'relative'`) : res.external,
|
|
2608
2613
|
...info,
|
|
2609
|
-
moduleSideEffects: info.moduleSideEffects ?? res.moduleSideEffects ?? null
|
|
2614
|
+
moduleSideEffects: info.moduleSideEffects ?? res.moduleSideEffects ?? null,
|
|
2615
|
+
packageJsonPath: res.packageJsonPath
|
|
2610
2616
|
};
|
|
2611
2617
|
}
|
|
2612
2618
|
emitFile = (file) => {
|
|
@@ -2732,7 +2738,8 @@ function bindingifyResolveId(args$1) {
|
|
|
2732
2738
|
id: ret.id,
|
|
2733
2739
|
external: ret.external,
|
|
2734
2740
|
normalizeExternalId: false,
|
|
2735
|
-
moduleSideEffects: exist.moduleSideEffects ?? void 0
|
|
2741
|
+
moduleSideEffects: exist.moduleSideEffects ?? void 0,
|
|
2742
|
+
packageJsonPath: ret.packageJsonPath
|
|
2736
2743
|
};
|
|
2737
2744
|
},
|
|
2738
2745
|
meta: bindingifyPluginHookMeta(meta),
|
|
@@ -3658,7 +3665,13 @@ var NormalizedOutputOptionsImpl = class {
|
|
|
3658
3665
|
return this.outputOptions.sourcemapPathTransform;
|
|
3659
3666
|
}
|
|
3660
3667
|
get minify() {
|
|
3661
|
-
|
|
3668
|
+
let ret = this.inner.minify;
|
|
3669
|
+
if (typeof ret === "object" && ret !== null) {
|
|
3670
|
+
delete ret["codegen"];
|
|
3671
|
+
delete ret["module"];
|
|
3672
|
+
delete ret["sourcemap"];
|
|
3673
|
+
}
|
|
3674
|
+
return ret;
|
|
3662
3675
|
}
|
|
3663
3676
|
get legalComments() {
|
|
3664
3677
|
return this.inner.legalComments;
|
|
@@ -3842,7 +3855,8 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
3842
3855
|
markModuleLoaded: pluginContextData.markModuleLoaded.bind(pluginContextData),
|
|
3843
3856
|
preserveEntrySignatures: bindingifyPreserveEntrySignatures(inputOptions.preserveEntrySignatures),
|
|
3844
3857
|
optimization: inputOptions.optimization,
|
|
3845
|
-
context: inputOptions.context
|
|
3858
|
+
context: inputOptions.context,
|
|
3859
|
+
tsconfig: inputOptions.tsconfig
|
|
3846
3860
|
};
|
|
3847
3861
|
}
|
|
3848
3862
|
function bindingifyHmr(hmr) {
|
|
@@ -4401,4 +4415,4 @@ function defineConfig(config) {
|
|
|
4401
4415
|
const VERSION = version;
|
|
4402
4416
|
|
|
4403
4417
|
//#endregion
|
|
4404
|
-
export { BuiltinPlugin, PluginContextData, PluginDriver, VERSION, assetPlugin, bindingifyPlugin, build, buildImportAnalysisPlugin, createBundlerImpl, defineConfig, description$1 as description, dynamicImportVarsPlugin, getInputCliKeys, getJsonSchema, getOutputCliKeys, handleOutputErrors, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, reporterPlugin, rolldown, validateCliOptions, version, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch, webWorkerPostPlugin };
|
|
4418
|
+
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 };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-DDkG_k5U.cjs');
|
|
2
|
-
const require_parse_ast_index = require('./parse-ast-index-
|
|
2
|
+
const require_parse_ast_index = require('./parse-ast-index-BCv3Y1TT.cjs');
|
|
3
3
|
const require_misc = require('./misc-DksvspN4.cjs');
|
|
4
4
|
const node_path = require_chunk.__toESM(require("node:path"));
|
|
5
5
|
const node_url = require_chunk.__toESM(require("node:url"));
|
|
@@ -10,22 +10,17 @@ const node_os = require_chunk.__toESM(require("node:os"));
|
|
|
10
10
|
const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
|
|
11
11
|
|
|
12
12
|
//#region package.json
|
|
13
|
-
var version = "1.0.0-beta.
|
|
13
|
+
var version = "1.0.0-beta.34";
|
|
14
14
|
var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
15
15
|
|
|
16
|
-
//#endregion
|
|
17
|
-
//#region src/utils/normalize-string-or-regex.ts
|
|
18
|
-
function normalizedStringOrRegex(pattern) {
|
|
19
|
-
if (!pattern) return void 0;
|
|
20
|
-
if (!isReadonlyArray(pattern)) return [pattern];
|
|
21
|
-
return pattern;
|
|
22
|
-
}
|
|
23
|
-
function isReadonlyArray(input) {
|
|
24
|
-
return Array.isArray(input);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
16
|
//#endregion
|
|
28
17
|
//#region src/builtin-plugin/utils.ts
|
|
18
|
+
var BuiltinPlugin = class {
|
|
19
|
+
constructor(name, _options) {
|
|
20
|
+
this.name = name;
|
|
21
|
+
this._options = _options;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
29
24
|
function makeBuiltinPluginCallable(plugin) {
|
|
30
25
|
let callablePlugin = new require_parse_ast_index.BindingCallableBuiltinPlugin(bindingifyBuiltInPlugin(plugin));
|
|
31
26
|
const wrappedPlugin = plugin;
|
|
@@ -49,67 +44,6 @@ function bindingifyBuiltInPlugin(plugin) {
|
|
|
49
44
|
};
|
|
50
45
|
}
|
|
51
46
|
|
|
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
47
|
//#endregion
|
|
114
48
|
//#region src/log/logging.ts
|
|
115
49
|
const LOG_LEVEL_SILENT = "silent";
|
|
@@ -234,6 +168,75 @@ function normalizeHook(hook) {
|
|
|
234
168
|
require_misc.unreachable("Invalid hook type");
|
|
235
169
|
}
|
|
236
170
|
|
|
171
|
+
//#endregion
|
|
172
|
+
//#region src/utils/normalize-string-or-regex.ts
|
|
173
|
+
function normalizedStringOrRegex(pattern) {
|
|
174
|
+
if (!pattern) return void 0;
|
|
175
|
+
if (!isReadonlyArray(pattern)) return [pattern];
|
|
176
|
+
return pattern;
|
|
177
|
+
}
|
|
178
|
+
function isReadonlyArray(input) {
|
|
179
|
+
return Array.isArray(input);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
//#endregion
|
|
183
|
+
//#region src/builtin-plugin/constructors.ts
|
|
184
|
+
function modulePreloadPolyfillPlugin(config) {
|
|
185
|
+
return new BuiltinPlugin("builtin:module-preload-polyfill", config);
|
|
186
|
+
}
|
|
187
|
+
function dynamicImportVarsPlugin(config) {
|
|
188
|
+
if (config) {
|
|
189
|
+
config.include = normalizedStringOrRegex(config.include);
|
|
190
|
+
config.exclude = normalizedStringOrRegex(config.exclude);
|
|
191
|
+
}
|
|
192
|
+
return new BuiltinPlugin("builtin:dynamic-import-vars", config);
|
|
193
|
+
}
|
|
194
|
+
function importGlobPlugin(config) {
|
|
195
|
+
return new BuiltinPlugin("builtin:import-glob", config);
|
|
196
|
+
}
|
|
197
|
+
function reporterPlugin(config) {
|
|
198
|
+
return new BuiltinPlugin("builtin:reporter", config);
|
|
199
|
+
}
|
|
200
|
+
function manifestPlugin(config) {
|
|
201
|
+
return new BuiltinPlugin("builtin:manifest", config);
|
|
202
|
+
}
|
|
203
|
+
function wasmHelperPlugin(config) {
|
|
204
|
+
return new BuiltinPlugin("builtin:wasm-helper", config);
|
|
205
|
+
}
|
|
206
|
+
function wasmFallbackPlugin() {
|
|
207
|
+
const builtinPlugin = new BuiltinPlugin("builtin:wasm-fallback");
|
|
208
|
+
return makeBuiltinPluginCallable(builtinPlugin);
|
|
209
|
+
}
|
|
210
|
+
function loadFallbackPlugin() {
|
|
211
|
+
return new BuiltinPlugin("builtin:load-fallback");
|
|
212
|
+
}
|
|
213
|
+
function jsonPlugin(config) {
|
|
214
|
+
const builtinPlugin = new BuiltinPlugin("builtin:json", config);
|
|
215
|
+
return makeBuiltinPluginCallable(builtinPlugin);
|
|
216
|
+
}
|
|
217
|
+
function buildImportAnalysisPlugin(config) {
|
|
218
|
+
return new BuiltinPlugin("builtin:build-import-analysis", config);
|
|
219
|
+
}
|
|
220
|
+
function viteResolvePlugin(config) {
|
|
221
|
+
const builtinPlugin = new BuiltinPlugin("builtin:vite-resolve", config);
|
|
222
|
+
return makeBuiltinPluginCallable(builtinPlugin);
|
|
223
|
+
}
|
|
224
|
+
function isolatedDeclarationPlugin(config) {
|
|
225
|
+
return new BuiltinPlugin("builtin:isolated-declaration", config);
|
|
226
|
+
}
|
|
227
|
+
function assetPlugin(config) {
|
|
228
|
+
return new BuiltinPlugin("builtin:asset", config);
|
|
229
|
+
}
|
|
230
|
+
function webWorkerPostPlugin() {
|
|
231
|
+
return new BuiltinPlugin("builtin:web-worker-post");
|
|
232
|
+
}
|
|
233
|
+
function oxcRuntimePlugin(config) {
|
|
234
|
+
return new BuiltinPlugin("builtin:oxc-runtime", config);
|
|
235
|
+
}
|
|
236
|
+
function esmExternalRequirePlugin(config) {
|
|
237
|
+
return new BuiltinPlugin("builtin:esm-external-require", config);
|
|
238
|
+
}
|
|
239
|
+
|
|
237
240
|
//#endregion
|
|
238
241
|
//#region src/constants/plugin.ts
|
|
239
242
|
const ENUMERATED_INPUT_PLUGIN_HOOK_NAMES = [
|
|
@@ -1901,7 +1904,7 @@ const TransformOptionsSchema = object({
|
|
|
1901
1904
|
typescript: optional(TypescriptSchema),
|
|
1902
1905
|
helpers: optional(HelpersSchema),
|
|
1903
1906
|
decorators: optional(DecoratorOptionSchema),
|
|
1904
|
-
jsx: optional(JsxOptionsSchema),
|
|
1907
|
+
jsx: optional(union([literal("preserve"), JsxOptionsSchema])),
|
|
1905
1908
|
target: pipe(optional(union([string(), array(string())])), description("The JavaScript target environment"))
|
|
1906
1909
|
});
|
|
1907
1910
|
const WatchOptionsSchema = strictObject({
|
|
@@ -1929,7 +1932,8 @@ const ChecksOptionsSchema = strictObject({
|
|
|
1929
1932
|
commonJsVariableInEsm: pipe(optional(boolean()), description("Whether to emit warning when detecting common js variable in esm")),
|
|
1930
1933
|
importIsUndefined: pipe(optional(boolean()), description("Whether to emit warning when detecting import is undefined")),
|
|
1931
1934
|
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"))
|
|
1935
|
+
configurationFieldConflict: pipe(optional(boolean()), description("Whether to emit warning when detecting configuration field conflict")),
|
|
1936
|
+
preferBuiltinFeature: pipe(optional(boolean()), description("Whether to emit warning when detecting prefer builtin feature"))
|
|
1933
1937
|
});
|
|
1934
1938
|
const MinifyOptionsSchema = strictObject({
|
|
1935
1939
|
mangle: optional(boolean()),
|
|
@@ -1947,7 +1951,6 @@ const ResolveOptionsSchema = strictObject({
|
|
|
1947
1951
|
mainFiles: optional(array(string())),
|
|
1948
1952
|
modules: optional(array(string())),
|
|
1949
1953
|
symlinks: optional(boolean()),
|
|
1950
|
-
tsconfigFilename: optional(string()),
|
|
1951
1954
|
yarnPnp: optional(boolean())
|
|
1952
1955
|
});
|
|
1953
1956
|
const TreeshakingOptionsSchema = union([boolean(), looseObject({
|
|
@@ -2031,7 +2034,8 @@ const InputOptionsSchema = strictObject({
|
|
|
2031
2034
|
literal("allow-extension"),
|
|
2032
2035
|
literal("exports-only"),
|
|
2033
2036
|
literal(false)
|
|
2034
|
-
])))
|
|
2037
|
+
]))),
|
|
2038
|
+
tsconfig: pipe(optional(string()), description("Path to the tsconfig.json file."))
|
|
2035
2039
|
});
|
|
2036
2040
|
const InputCliOverrideSchema = strictObject({
|
|
2037
2041
|
input: pipe(optional(array(string())), description("Entry file")),
|
|
@@ -2153,7 +2157,8 @@ const OutputOptionsSchema = strictObject({
|
|
|
2153
2157
|
preserveModules: pipe(optional(boolean()), description("Preserve module structure")),
|
|
2154
2158
|
preserveModulesRoot: pipe(optional(string()), description("Put preserved modules under this path at root level")),
|
|
2155
2159
|
virtualDirname: optional(string()),
|
|
2156
|
-
minifyInternalExports: pipe(optional(boolean()), description("Minify internal exports"))
|
|
2160
|
+
minifyInternalExports: pipe(optional(boolean()), description("Minify internal exports")),
|
|
2161
|
+
topLevelVar: pipe(optional(boolean()), description("Rewrite top-level declarations to use `var`."))
|
|
2157
2162
|
});
|
|
2158
2163
|
const getAddonDescription = (placement, wrapper) => {
|
|
2159
2164
|
return `Code to insert the ${ansis.default.bold(placement)} of the bundled file (${ansis.default.bold(wrapper)} the wrapper function)`;
|
|
@@ -2607,7 +2612,8 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
|
2607
2612
|
...res,
|
|
2608
2613
|
external: res.external === "relative" ? require_misc.unreachable(`The PluginContext resolve result external couldn't be 'relative'`) : res.external,
|
|
2609
2614
|
...info,
|
|
2610
|
-
moduleSideEffects: info.moduleSideEffects ?? res.moduleSideEffects ?? null
|
|
2615
|
+
moduleSideEffects: info.moduleSideEffects ?? res.moduleSideEffects ?? null,
|
|
2616
|
+
packageJsonPath: res.packageJsonPath
|
|
2611
2617
|
};
|
|
2612
2618
|
}
|
|
2613
2619
|
emitFile = (file) => {
|
|
@@ -2733,7 +2739,8 @@ function bindingifyResolveId(args$1) {
|
|
|
2733
2739
|
id: ret.id,
|
|
2734
2740
|
external: ret.external,
|
|
2735
2741
|
normalizeExternalId: false,
|
|
2736
|
-
moduleSideEffects: exist.moduleSideEffects ?? void 0
|
|
2742
|
+
moduleSideEffects: exist.moduleSideEffects ?? void 0,
|
|
2743
|
+
packageJsonPath: ret.packageJsonPath
|
|
2737
2744
|
};
|
|
2738
2745
|
},
|
|
2739
2746
|
meta: bindingifyPluginHookMeta(meta),
|
|
@@ -3659,7 +3666,13 @@ var NormalizedOutputOptionsImpl = class {
|
|
|
3659
3666
|
return this.outputOptions.sourcemapPathTransform;
|
|
3660
3667
|
}
|
|
3661
3668
|
get minify() {
|
|
3662
|
-
|
|
3669
|
+
let ret = this.inner.minify;
|
|
3670
|
+
if (typeof ret === "object" && ret !== null) {
|
|
3671
|
+
delete ret["codegen"];
|
|
3672
|
+
delete ret["module"];
|
|
3673
|
+
delete ret["sourcemap"];
|
|
3674
|
+
}
|
|
3675
|
+
return ret;
|
|
3663
3676
|
}
|
|
3664
3677
|
get legalComments() {
|
|
3665
3678
|
return this.inner.legalComments;
|
|
@@ -3843,7 +3856,8 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
3843
3856
|
markModuleLoaded: pluginContextData.markModuleLoaded.bind(pluginContextData),
|
|
3844
3857
|
preserveEntrySignatures: bindingifyPreserveEntrySignatures(inputOptions.preserveEntrySignatures),
|
|
3845
3858
|
optimization: inputOptions.optimization,
|
|
3846
|
-
context: inputOptions.context
|
|
3859
|
+
context: inputOptions.context,
|
|
3860
|
+
tsconfig: inputOptions.tsconfig
|
|
3847
3861
|
};
|
|
3848
3862
|
}
|
|
3849
3863
|
function bindingifyHmr(hmr) {
|
|
@@ -4456,6 +4470,12 @@ Object.defineProperty(exports, 'createBundlerImpl', {
|
|
|
4456
4470
|
return createBundlerImpl;
|
|
4457
4471
|
}
|
|
4458
4472
|
});
|
|
4473
|
+
Object.defineProperty(exports, 'createBundlerOptions', {
|
|
4474
|
+
enumerable: true,
|
|
4475
|
+
get: function () {
|
|
4476
|
+
return createBundlerOptions;
|
|
4477
|
+
}
|
|
4478
|
+
});
|
|
4459
4479
|
Object.defineProperty(exports, 'defineConfig', {
|
|
4460
4480
|
enumerable: true,
|
|
4461
4481
|
get: function () {
|
|
@@ -4474,6 +4494,12 @@ Object.defineProperty(exports, 'dynamicImportVarsPlugin', {
|
|
|
4474
4494
|
return dynamicImportVarsPlugin;
|
|
4475
4495
|
}
|
|
4476
4496
|
});
|
|
4497
|
+
Object.defineProperty(exports, 'esmExternalRequirePlugin', {
|
|
4498
|
+
enumerable: true,
|
|
4499
|
+
get: function () {
|
|
4500
|
+
return esmExternalRequirePlugin;
|
|
4501
|
+
}
|
|
4502
|
+
});
|
|
4477
4503
|
Object.defineProperty(exports, 'getInputCliKeys', {
|
|
4478
4504
|
enumerable: true,
|
|
4479
4505
|
get: function () {
|
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.34",
|
|
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.34"
|
|
99
99
|
},
|
|
100
100
|
"devDependencies": {
|
|
101
101
|
"@napi-rs/cli": "^3.1.2",
|
|
@@ -108,7 +108,7 @@
|
|
|
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
114
|
"rolldown-plugin-dts": "^0.15.0",
|
|
@@ -119,24 +119,24 @@
|
|
|
119
119
|
"typedoc": "^0.28.0",
|
|
120
120
|
"typescript": "^5.7.3",
|
|
121
121
|
"valibot": "1.1.0",
|
|
122
|
-
"rolldown": "1.0.0-beta.
|
|
122
|
+
"rolldown": "1.0.0-beta.34",
|
|
123
123
|
"@rolldown/testing": "0.0.1"
|
|
124
124
|
},
|
|
125
125
|
"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.
|
|
126
|
+
"@rolldown/binding-darwin-x64": "1.0.0-beta.34",
|
|
127
|
+
"@rolldown/binding-win32-x64-msvc": "1.0.0-beta.34",
|
|
128
|
+
"@rolldown/binding-linux-x64-gnu": "1.0.0-beta.34",
|
|
129
|
+
"@rolldown/binding-linux-x64-musl": "1.0.0-beta.34",
|
|
130
|
+
"@rolldown/binding-freebsd-x64": "1.0.0-beta.34",
|
|
131
|
+
"@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.34",
|
|
132
|
+
"@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.34",
|
|
133
|
+
"@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.34",
|
|
134
|
+
"@rolldown/binding-darwin-arm64": "1.0.0-beta.34",
|
|
135
|
+
"@rolldown/binding-linux-arm64-musl": "1.0.0-beta.34",
|
|
136
|
+
"@rolldown/binding-openharmony-arm64": "1.0.0-beta.34",
|
|
137
|
+
"@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.34",
|
|
138
|
+
"@rolldown/binding-android-arm64": "1.0.0-beta.34",
|
|
139
|
+
"@rolldown/binding-wasm32-wasi": "1.0.0-beta.34"
|
|
140
140
|
},
|
|
141
141
|
"scripts": {
|
|
142
142
|
"# Scrips for binding #": "_",
|