rolldown 1.0.0-beta.32 → 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-BEeJNtY4.d.mts → binding-9k0egz6L.d.mts} +110 -10
- package/dist/shared/{binding-CRMJJtol.d.cts → binding-D13M6Llu.d.cts} +110 -10
- package/dist/shared/{define-config-Cf8iQFTl.d.mts → define-config-D5AluabE.d.cts} +70 -25
- package/dist/shared/{define-config-Dw9PP95x.d.cts → define-config-DVSr6Unb.d.mts} +70 -25
- package/dist/shared/{load-config-BF8LOHEy.mjs → load-config-CXpGBNqp.mjs} +1 -1
- package/dist/shared/{load-config-Dl9pIpnr.cjs → load-config-CefxSUnT.cjs} +1 -1
- package/dist/shared/{parse-ast-index-Cn-35Vbp.cjs → parse-ast-index-BCv3Y1TT.cjs} +31 -25
- package/dist/shared/{parse-ast-index-Ch2Zs4Nn.mjs → parse-ast-index-DjojK-Vf.mjs} +26 -26
- package/dist/shared/{src-p50l1OMU.mjs → src-Chn1S4O2.mjs} +114 -95
- package/dist/shared/{src-CsEb-TS_.cjs → src-djpzntWm.cjs} +125 -94
- package/package.json +21 -21
|
@@ -4,6 +4,108 @@ import * as _oxc_project_types0 from "@oxc-project/types";
|
|
|
4
4
|
type MaybePromise<T> = T | Promise<T>;
|
|
5
5
|
type VoidNullable<T = void> = T | null | undefined | void;
|
|
6
6
|
type BindingStringOrRegex = string | RegExp;
|
|
7
|
+
interface CodegenOptions {
|
|
8
|
+
/**
|
|
9
|
+
* Remove whitespace.
|
|
10
|
+
*
|
|
11
|
+
* @default true
|
|
12
|
+
*/
|
|
13
|
+
removeWhitespace?: boolean;
|
|
14
|
+
}
|
|
15
|
+
interface CompressOptions {
|
|
16
|
+
/**
|
|
17
|
+
* Set desired EcmaScript standard version for output.
|
|
18
|
+
*
|
|
19
|
+
* Set `esnext` to enable all target highering.
|
|
20
|
+
*
|
|
21
|
+
* e.g.
|
|
22
|
+
*
|
|
23
|
+
* * catch optional binding when >= es2019
|
|
24
|
+
* * `??` operator >= es2020
|
|
25
|
+
*
|
|
26
|
+
* @default 'esnext'
|
|
27
|
+
*/
|
|
28
|
+
target?: 'esnext' | 'es2015' | 'es2016' | 'es2017' | 'es2018' | 'es2019' | 'es2020' | 'es2021' | 'es2022' | 'es2023' | 'es2024';
|
|
29
|
+
/**
|
|
30
|
+
* Pass true to discard calls to `console.*`.
|
|
31
|
+
*
|
|
32
|
+
* @default false
|
|
33
|
+
*/
|
|
34
|
+
dropConsole?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Remove `debugger;` statements.
|
|
37
|
+
*
|
|
38
|
+
* @default true
|
|
39
|
+
*/
|
|
40
|
+
dropDebugger?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Drop unreferenced functions and variables.
|
|
43
|
+
*
|
|
44
|
+
* Simple direct variable assignments do not count as references unless set to "keep_assign".
|
|
45
|
+
*/
|
|
46
|
+
unused?: true | false | 'keep_assign';
|
|
47
|
+
/** Keep function / class names. */
|
|
48
|
+
keepNames?: CompressOptionsKeepNames;
|
|
49
|
+
}
|
|
50
|
+
interface CompressOptionsKeepNames {
|
|
51
|
+
/**
|
|
52
|
+
* Keep function names so that `Function.prototype.name` is preserved.
|
|
53
|
+
*
|
|
54
|
+
* This does not guarantee that the `undefined` name is preserved.
|
|
55
|
+
*
|
|
56
|
+
* @default false
|
|
57
|
+
*/
|
|
58
|
+
function: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Keep class names so that `Class.prototype.name` is preserved.
|
|
61
|
+
*
|
|
62
|
+
* This does not guarantee that the `undefined` name is preserved.
|
|
63
|
+
*
|
|
64
|
+
* @default false
|
|
65
|
+
*/
|
|
66
|
+
class: boolean;
|
|
67
|
+
}
|
|
68
|
+
interface MangleOptions {
|
|
69
|
+
/**
|
|
70
|
+
* Pass `true` to mangle names declared in the top level scope.
|
|
71
|
+
*
|
|
72
|
+
* @default false
|
|
73
|
+
*/
|
|
74
|
+
toplevel?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Preserve `name` property for functions and classes.
|
|
77
|
+
*
|
|
78
|
+
* @default false
|
|
79
|
+
*/
|
|
80
|
+
keepNames?: boolean | MangleOptionsKeepNames;
|
|
81
|
+
/** Debug mangled names. */
|
|
82
|
+
debug?: boolean;
|
|
83
|
+
}
|
|
84
|
+
interface MangleOptionsKeepNames {
|
|
85
|
+
/**
|
|
86
|
+
* Preserve `name` property for functions.
|
|
87
|
+
*
|
|
88
|
+
* @default false
|
|
89
|
+
*/
|
|
90
|
+
function: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Preserve `name` property for classes.
|
|
93
|
+
*
|
|
94
|
+
* @default false
|
|
95
|
+
*/
|
|
96
|
+
class: boolean;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** Minify synchronously. */
|
|
100
|
+
|
|
101
|
+
interface MinifyOptions {
|
|
102
|
+
/** Use when minifying an ES6 module. */
|
|
103
|
+
module?: boolean;
|
|
104
|
+
compress?: boolean | CompressOptions;
|
|
105
|
+
mangle?: boolean | MangleOptions;
|
|
106
|
+
codegen?: boolean | CodegenOptions;
|
|
107
|
+
sourcemap?: boolean;
|
|
108
|
+
}
|
|
7
109
|
interface Comment {
|
|
8
110
|
type: 'Line' | 'Block';
|
|
9
111
|
value: string;
|
|
@@ -857,7 +959,7 @@ interface StyledComponentsOptions {
|
|
|
857
959
|
* from this list, the directory name will be used instead of the file name for
|
|
858
960
|
* the component's display name.
|
|
859
961
|
*
|
|
860
|
-
* @default ["index"]
|
|
962
|
+
* @default `["index"]`
|
|
861
963
|
*/
|
|
862
964
|
meaninglessFileNames?: Array<string>;
|
|
863
965
|
/**
|
|
@@ -920,8 +1022,8 @@ interface TransformOptions {
|
|
|
920
1022
|
*
|
|
921
1023
|
* Example:
|
|
922
1024
|
*
|
|
923
|
-
* * 'es2015'
|
|
924
|
-
* * ['es2020', 'chrome58', 'edge16', 'firefox57', 'node12', 'safari11']
|
|
1025
|
+
* * `'es2015'`
|
|
1026
|
+
* * `['es2020', 'chrome58', 'edge16', 'firefox57', 'node12', 'safari11']`
|
|
925
1027
|
*
|
|
926
1028
|
* @default `esnext` (No transformation)
|
|
927
1029
|
*
|
|
@@ -1162,7 +1264,7 @@ interface BindingBuildImportAnalysisPluginConfig {
|
|
|
1162
1264
|
renderBuiltUrl: boolean;
|
|
1163
1265
|
isRelativeBase: boolean;
|
|
1164
1266
|
}
|
|
1165
|
-
type BindingBuiltinPluginName = 'builtin:alias' | 'builtin:asset' | 'builtin:asset-import-meta-url' | 'builtin:build-import-analysis' | 'builtin:dynamic-import-vars' | 'builtin:import-glob' | 'builtin:isolated-declaration' | 'builtin:json' | 'builtin:load-fallback' | 'builtin:manifest' | 'builtin:module-preload-polyfill' | 'builtin:oxc-runtime' | 'builtin:reporter' | 'builtin:replace' | 'builtin:transform' | 'builtin:vite-resolve' | 'builtin:wasm-fallback' | 'builtin:wasm-helper' | 'builtin:web-worker-post';
|
|
1267
|
+
type BindingBuiltinPluginName = 'builtin:alias' | 'builtin:asset' | 'builtin:asset-import-meta-url' | 'builtin:build-import-analysis' | 'builtin:dynamic-import-vars' | 'builtin:import-glob' | 'builtin:isolated-declaration' | 'builtin:json' | 'builtin:load-fallback' | 'builtin:manifest' | 'builtin:module-preload-polyfill' | 'builtin:oxc-runtime' | 'builtin:reporter' | 'builtin:replace' | 'builtin:esm-external-require' | 'builtin:transform' | 'builtin:vite-resolve' | 'builtin:wasm-fallback' | 'builtin:wasm-helper' | 'builtin:web-worker-post';
|
|
1166
1268
|
interface BindingDynamicImportVarsPluginConfig {
|
|
1167
1269
|
include?: Array<BindingStringOrRegex>;
|
|
1168
1270
|
exclude?: Array<BindingStringOrRegex>;
|
|
@@ -1172,6 +1274,9 @@ interface BindingError {
|
|
|
1172
1274
|
kind: string;
|
|
1173
1275
|
message: string;
|
|
1174
1276
|
}
|
|
1277
|
+
interface BindingEsmExternalRequirePluginConfig {
|
|
1278
|
+
external: Array<BindingStringOrRegex>;
|
|
1279
|
+
}
|
|
1175
1280
|
type BindingGenerateHmrPatchReturn = {
|
|
1176
1281
|
type: 'Ok';
|
|
1177
1282
|
field0: Array<BindingHmrUpdate>;
|
|
@@ -1229,11 +1334,6 @@ interface BindingManifestPluginConfig {
|
|
|
1229
1334
|
isLegacy?: () => boolean;
|
|
1230
1335
|
cssEntries: () => Set<string>;
|
|
1231
1336
|
}
|
|
1232
|
-
interface BindingMinifyOptions {
|
|
1233
|
-
mangle?: boolean;
|
|
1234
|
-
compress?: boolean;
|
|
1235
|
-
removeWhitespace?: boolean;
|
|
1236
|
-
}
|
|
1237
1337
|
interface BindingModulePreloadPolyfillPluginConfig {
|
|
1238
1338
|
isServer?: boolean;
|
|
1239
1339
|
}
|
|
@@ -1322,4 +1422,4 @@ interface PreRenderedChunk {
|
|
|
1322
1422
|
exports: Array<string>;
|
|
1323
1423
|
}
|
|
1324
1424
|
//#endregion
|
|
1325
|
-
export { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingBuiltinPluginName, BindingBundlerImpl, BindingDynamicImportVarsPluginConfig, BindingHmrUpdate, BindingHookResolveIdExtraArgs, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig,
|
|
1425
|
+
export { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingBuiltinPluginName, BindingBundlerImpl, BindingDynamicImportVarsPluginConfig, BindingEsmExternalRequirePluginConfig, BindingHmrUpdate, BindingHookResolveIdExtraArgs, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingModulePreloadPolyfillPluginConfig, BindingRenderedChunk, BindingReplacePluginConfig, BindingReporterPluginConfig, BindingTransformHookExtraArgs, BindingTransformPluginConfig, BindingViteResolvePluginConfig, BindingWasmHelperPluginConfig, BindingWatcherEvent, IsolatedDeclarationsOptions, IsolatedDeclarationsResult, MinifyOptions, NapiResolveOptions, ParseResult, ParserOptions, PreRenderedChunk, ResolveResult, ResolverFactory, TransformOptions, TransformResult, isolatedDeclaration, moduleRunnerTransform, transform };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { TopLevelFilterExpression } from "@rolldown/pluginutils";
|
|
1
|
+
import { BindingBuiltinPluginName, BindingBundlerImpl, BindingHmrUpdate, BindingHookResolveIdExtraArgs, BindingRenderedChunk, BindingTransformHookExtraArgs, BindingWatcherEvent, MinifyOptions as MinifyOptions$1, ParserOptions, PreRenderedChunk, TransformOptions } from "./binding-D13M6Llu.cjs";
|
|
3
2
|
import { Program } from "@oxc-project/types";
|
|
3
|
+
import { TopLevelFilterExpression } from "@rolldown/pluginutils";
|
|
4
4
|
|
|
5
5
|
//#region src/log/logging.d.ts
|
|
6
6
|
type LogLevel = "info" | "debug" | "warn";
|
|
@@ -150,7 +150,7 @@ interface PreRenderedAsset {
|
|
|
150
150
|
}
|
|
151
151
|
type AssetFileNamesFunction = (chunkInfo: PreRenderedAsset) => string;
|
|
152
152
|
type GlobalsFunction = (name: string) => string;
|
|
153
|
-
type MinifyOptions =
|
|
153
|
+
type MinifyOptions = Omit<MinifyOptions$1, "module" | "codegen" | "sorucemap">;
|
|
154
154
|
interface ChunkingContext {
|
|
155
155
|
getModuleInfo(moduleId: string): ModuleInfo | null;
|
|
156
156
|
}
|
|
@@ -186,6 +186,16 @@ interface OutputOptions {
|
|
|
186
186
|
cssEntryFileNames?: string | ChunkFileNamesFunction;
|
|
187
187
|
cssChunkFileNames?: string | ChunkFileNamesFunction;
|
|
188
188
|
sanitizeFileName?: boolean | ((name: string) => string);
|
|
189
|
+
/**
|
|
190
|
+
* Control code minification.
|
|
191
|
+
*
|
|
192
|
+
* - `true`: Enable full minification including code compression and dead code elimination
|
|
193
|
+
* - `false`: Disable minification (default)
|
|
194
|
+
* - `'dce-only'`: Only perform dead code elimination without code compression
|
|
195
|
+
* - `MinifyOptions`: Fine-grained control over minification settings
|
|
196
|
+
*
|
|
197
|
+
* @default false
|
|
198
|
+
*/
|
|
189
199
|
minify?: boolean | "dce-only" | MinifyOptions;
|
|
190
200
|
name?: string;
|
|
191
201
|
globals?: Record<string, string> | GlobalsFunction;
|
|
@@ -543,6 +553,7 @@ interface NormalizedInputOptions {
|
|
|
543
553
|
cwd: string | undefined;
|
|
544
554
|
platform: InputOptions["platform"];
|
|
545
555
|
shimMissingExports: boolean;
|
|
556
|
+
context: string;
|
|
546
557
|
}
|
|
547
558
|
//#endregion
|
|
548
559
|
//#region src/options/normalized-output-options.d.ts
|
|
@@ -573,7 +584,7 @@ interface NormalizedOutputOptions {
|
|
|
573
584
|
sourcemapDebugIds: boolean;
|
|
574
585
|
sourcemapIgnoreList: SourcemapIgnoreListOption;
|
|
575
586
|
sourcemapPathTransform: SourcemapPathTransformOption | undefined;
|
|
576
|
-
minify: false |
|
|
587
|
+
minify: false | MinifyOptions | "dce-only";
|
|
577
588
|
legalComments: "none" | "inline";
|
|
578
589
|
polyfillRequire: boolean;
|
|
579
590
|
plugins: RolldownPlugin[];
|
|
@@ -805,30 +816,12 @@ type SourceMapInput = ExistingRawSourceMap | string | null;
|
|
|
805
816
|
//#region src/index.d.ts
|
|
806
817
|
declare const VERSION: string;
|
|
807
818
|
//#endregion
|
|
808
|
-
//#region src/builtin-plugin/
|
|
819
|
+
//#region src/builtin-plugin/utils.d.ts
|
|
809
820
|
declare class BuiltinPlugin {
|
|
810
821
|
name: BindingBuiltinPluginName;
|
|
811
822
|
_options?: unknown;
|
|
812
823
|
constructor(name: BindingBuiltinPluginName, _options?: unknown);
|
|
813
824
|
}
|
|
814
|
-
declare function modulePreloadPolyfillPlugin(config?: BindingModulePreloadPolyfillPluginConfig): BuiltinPlugin;
|
|
815
|
-
type DynamicImportVarsPluginConfig = Omit<BindingDynamicImportVarsPluginConfig, "include" | "exclude"> & {
|
|
816
|
-
include?: StringOrRegExp | StringOrRegExp[];
|
|
817
|
-
exclude?: StringOrRegExp | StringOrRegExp[];
|
|
818
|
-
};
|
|
819
|
-
declare function dynamicImportVarsPlugin(config?: DynamicImportVarsPluginConfig): BuiltinPlugin;
|
|
820
|
-
declare function importGlobPlugin(config?: BindingImportGlobPluginConfig): BuiltinPlugin;
|
|
821
|
-
declare function reporterPlugin(config?: BindingReporterPluginConfig): BuiltinPlugin;
|
|
822
|
-
declare function manifestPlugin(config?: BindingManifestPluginConfig): BuiltinPlugin;
|
|
823
|
-
declare function wasmHelperPlugin(config?: BindingWasmHelperPluginConfig): BuiltinPlugin;
|
|
824
|
-
declare function wasmFallbackPlugin(): BuiltinPlugin;
|
|
825
|
-
declare function loadFallbackPlugin(): BuiltinPlugin;
|
|
826
|
-
declare function jsonPlugin(config?: BindingJsonPluginConfig): BuiltinPlugin;
|
|
827
|
-
declare function buildImportAnalysisPlugin(config: BindingBuildImportAnalysisPluginConfig): BuiltinPlugin;
|
|
828
|
-
declare function viteResolvePlugin(config: BindingViteResolvePluginConfig): BuiltinPlugin;
|
|
829
|
-
declare function isolatedDeclarationPlugin(config?: BindingIsolatedDeclarationPluginConfig): BuiltinPlugin;
|
|
830
|
-
declare function assetPlugin(config?: BindingAssetPluginConfig): BuiltinPlugin;
|
|
831
|
-
declare function webWorkerPostPlugin(): BuiltinPlugin;
|
|
832
825
|
//#endregion
|
|
833
826
|
//#region src/constants/plugin.d.ts
|
|
834
827
|
declare const ENUMERATED_INPUT_PLUGIN_HOOK_NAMES: readonly ["options", "buildStart", "resolveId", "load", "transform", "moduleParsed", "buildEnd", "onLog", "resolveDynamicImport", "closeBundle", "closeWatcher", "watchChange"];
|
|
@@ -877,6 +870,7 @@ interface ModuleOptions {
|
|
|
877
870
|
moduleSideEffects: ModuleSideEffects;
|
|
878
871
|
meta: CustomPluginOptions;
|
|
879
872
|
invalidate?: boolean;
|
|
873
|
+
packageJsonPath?: string;
|
|
880
874
|
}
|
|
881
875
|
interface ResolvedId extends ModuleOptions {
|
|
882
876
|
external: boolean | "absolute";
|
|
@@ -1047,6 +1041,11 @@ interface ChecksOptions {
|
|
|
1047
1041
|
* @default true
|
|
1048
1042
|
*/
|
|
1049
1043
|
configurationFieldConflict?: boolean;
|
|
1044
|
+
/**
|
|
1045
|
+
* Whether to emit warning when detecting prefer builtin feature
|
|
1046
|
+
* @default true
|
|
1047
|
+
*/
|
|
1048
|
+
preferBuiltinFeature?: boolean;
|
|
1050
1049
|
}
|
|
1051
1050
|
//#endregion
|
|
1052
1051
|
//#region src/options/input-options.d.ts
|
|
@@ -1073,6 +1072,32 @@ type HmrOptions = boolean | {
|
|
|
1073
1072
|
implement?: string;
|
|
1074
1073
|
};
|
|
1075
1074
|
type OptimizationOptions = {
|
|
1075
|
+
/**
|
|
1076
|
+
* Inline imported constant values during bundling instead of preserving variable references.
|
|
1077
|
+
*
|
|
1078
|
+
* When enabled, constant values from imported modules will be inlined at their usage sites,
|
|
1079
|
+
* potentially reducing bundle size and improving runtime performance by eliminating variable lookups.
|
|
1080
|
+
*
|
|
1081
|
+
* **example**
|
|
1082
|
+
* ```js
|
|
1083
|
+
* // Input files:
|
|
1084
|
+
* // constants.js
|
|
1085
|
+
* export const API_URL = 'https://api.example.com';
|
|
1086
|
+
*
|
|
1087
|
+
* // main.js
|
|
1088
|
+
* import { API_URL } from './constants.js';
|
|
1089
|
+
* console.log(API_URL);
|
|
1090
|
+
*
|
|
1091
|
+
* // With inlineConst: true, the bundled output becomes:
|
|
1092
|
+
* console.log('https://api.example.com');
|
|
1093
|
+
*
|
|
1094
|
+
* // Instead of:
|
|
1095
|
+
* const API_URL = 'https://api.example.com';
|
|
1096
|
+
* console.log(API_URL);
|
|
1097
|
+
* ```
|
|
1098
|
+
*
|
|
1099
|
+
* @default false
|
|
1100
|
+
*/
|
|
1076
1101
|
inlineConst?: boolean;
|
|
1077
1102
|
};
|
|
1078
1103
|
type AttachDebugOptions = "none" | "simple" | "full";
|
|
@@ -1111,12 +1136,16 @@ interface InputOptions {
|
|
|
1111
1136
|
mainFiles?: string[];
|
|
1112
1137
|
modules?: string[];
|
|
1113
1138
|
symlinks?: boolean;
|
|
1114
|
-
tsconfigFilename?: string;
|
|
1115
1139
|
};
|
|
1116
1140
|
cwd?: string;
|
|
1117
1141
|
/**
|
|
1118
1142
|
* Expected platform where the code run.
|
|
1119
1143
|
*
|
|
1144
|
+
* When the platform is set to neutral:
|
|
1145
|
+
* - When bundling is enabled the default output format is set to esm, which uses the export syntax introduced with ECMAScript 2015 (i.e. ES6). You can change the output format if this default is not appropriate.
|
|
1146
|
+
* - The main fields setting is empty by default. If you want to use npm-style packages, you will likely have to configure this to be something else such as main for the standard main field used by node.
|
|
1147
|
+
* - The conditions setting does not automatically include any platform-specific values.
|
|
1148
|
+
*
|
|
1120
1149
|
* @default
|
|
1121
1150
|
* - 'node' if the format is 'cjs'
|
|
1122
1151
|
* - 'browser' for other formats
|
|
@@ -1291,6 +1320,11 @@ interface InputOptions {
|
|
|
1291
1320
|
inject?: Record<string, string | [string, string]>;
|
|
1292
1321
|
profilerNames?: boolean;
|
|
1293
1322
|
/**
|
|
1323
|
+
* @deprecated Use {@link OxcTransformOption.jsx} instead.
|
|
1324
|
+
*
|
|
1325
|
+
* This top-level `jsx` option will be removed in a future release.
|
|
1326
|
+
* It is only kept for backward compatibility and will be mapped internally to `transform.jsx`.
|
|
1327
|
+
*
|
|
1294
1328
|
* - `false` disables the JSX parser, resulting in a syntax error if JSX syntax is used.
|
|
1295
1329
|
* - `"preserve"` disables the JSX transformer, preserving the original JSX syntax in the output.
|
|
1296
1330
|
* - `"react"` enables the `classic` JSX transformer.
|
|
@@ -1328,6 +1362,17 @@ interface InputOptions {
|
|
|
1328
1362
|
preserveEntrySignatures?: false | "strict" | "allow-extension" | "exports-only";
|
|
1329
1363
|
optimization?: OptimizationOptions;
|
|
1330
1364
|
context?: string;
|
|
1365
|
+
/**
|
|
1366
|
+
* Allows you to specify where to find the TypeScript configuration file.
|
|
1367
|
+
*
|
|
1368
|
+
* You may provide:
|
|
1369
|
+
* - a relative path to the configuration file. It will be resolved relative to cwd.
|
|
1370
|
+
* - an absolute path to the configuration file.
|
|
1371
|
+
*
|
|
1372
|
+
* When a tsconfig path is specified, the module resolver will respect `compilerOptions.paths` from the specified `tsconfig.json`,
|
|
1373
|
+
* and the tsconfig options will be merged with the top-level `transform` options, with the `transform` options taking precedence.
|
|
1374
|
+
*/
|
|
1375
|
+
tsconfig?: string;
|
|
1331
1376
|
}
|
|
1332
1377
|
//#endregion
|
|
1333
1378
|
//#region src/types/rolldown-options.d.ts
|
|
@@ -1346,4 +1391,4 @@ declare function defineConfig(config: RolldownOptions): RolldownOptions;
|
|
|
1346
1391
|
declare function defineConfig(config: RolldownOptions[]): RolldownOptions[];
|
|
1347
1392
|
declare function defineConfig(config: ConfigExport): ConfigExport;
|
|
1348
1393
|
//#endregion
|
|
1349
|
-
export { type AddonFunction, type AsyncPluginHooks, type BufferEncoding, type BuildOptions, BuiltinPlugin, type ChunkFileNamesFunction, type ChunkingContext, type ConfigExport, type CustomPluginOptions, type DefineParallelPluginResult, type EmittedAsset, type EmittedFile, type ExistingRawSourceMap, type ExternalOption, type FunctionPluginHooks, type GeneralHookFilter, type GetModuleInfo, type GlobalsFunction, type HookFilter, type HookFilterExtension, type ImportKind, type InputOption, type InputOptions, type InternalModuleFormat, type LoadResult, type LogLevel, type LogLevelOption, type LogOrStringHandler, type LoggingFunction, MaybePromise, type MinifyOptions, type MinimalPluginContext, type ModuleFormat, type ModuleInfo, type ModuleOptions, type ModuleType, type ModuleTypeFilter, type ModuleTypes, type NormalizedInputOptions, type NormalizedOutputOptions, type ObjectHook, type OptimizationOptions, type OutputAsset, type OutputBundle, type OutputChunk, type OutputOptions, type ParallelPluginHooks, type PartialNull, type PartialResolvedId, type Plugin, type PluginContext, type PluginContextMeta, type PreRenderedAsset, type RenderedChunk, type RenderedModule, type ResolveIdExtraOptions, type ResolveIdResult, type ResolvedId, type RolldownBuild, type RolldownDirectoryEntry, type RolldownFileStats, type RolldownFsModule, type RolldownOptions, type RolldownOutput, type RolldownPlugin, type RolldownPluginOption, type RolldownWatcher, type RolldownWatcherEvent, type RollupError, type RollupLog, type RollupLogWithString, type SourceDescription, type SourceMap, type SourceMapInput, type SourcemapIgnoreListOption, type TransformPluginContext, type TransformResult, type TreeshakingOptions, VERSION, type WarningHandlerWithDefault, type WatchOptions, type WatcherOptions,
|
|
1394
|
+
export { type AddonFunction, type AsyncPluginHooks, type BufferEncoding, type BuildOptions, BuiltinPlugin, type ChunkFileNamesFunction, type ChunkingContext, type ConfigExport, type CustomPluginOptions, type DefineParallelPluginResult, type EmittedAsset, type EmittedFile, type ExistingRawSourceMap, type ExternalOption, type FunctionPluginHooks, type GeneralHookFilter, type GetModuleInfo, type GlobalsFunction, type HookFilter, type HookFilterExtension, type ImportKind, type InputOption, type InputOptions, type InternalModuleFormat, type LoadResult, type LogLevel, type LogLevelOption, type LogOrStringHandler, type LoggingFunction, MaybePromise, type MinifyOptions, type MinimalPluginContext, type ModuleFormat, type ModuleInfo, type ModuleOptions, type ModuleType, type ModuleTypeFilter, type ModuleTypes, type NormalizedInputOptions, type NormalizedOutputOptions, type ObjectHook, type OptimizationOptions, type OutputAsset, type OutputBundle, type OutputChunk, type OutputOptions, type ParallelPluginHooks, type PartialNull, type PartialResolvedId, type Plugin, type PluginContext, type PluginContextMeta, type PreRenderedAsset, type RenderedChunk, type RenderedModule, type ResolveIdExtraOptions, type ResolveIdResult, type ResolvedId, type RolldownBuild, type RolldownDirectoryEntry, type RolldownFileStats, type RolldownFsModule, type RolldownOptions, type RolldownOutput, type RolldownPlugin, type RolldownPluginOption, type RolldownWatcher, type RolldownWatcherEvent, type RollupError, type RollupLog, type RollupLogWithString, type SourceDescription, type SourceMap, type SourceMapInput, type SourcemapIgnoreListOption, StringOrRegExp, type TransformPluginContext, type TransformResult, type TreeshakingOptions, VERSION, type WarningHandlerWithDefault, type WatchOptions, type WatcherOptions, build, defineConfig, defineParallelPlugin, rolldown, watch, withFilter };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Program } from "@oxc-project/types";
|
|
1
|
+
import { BindingBuiltinPluginName, BindingBundlerImpl, BindingHmrUpdate, BindingHookResolveIdExtraArgs, BindingRenderedChunk, BindingTransformHookExtraArgs, BindingWatcherEvent, MinifyOptions as MinifyOptions$1, ParserOptions, PreRenderedChunk, TransformOptions } from "./binding-9k0egz6L.mjs";
|
|
3
2
|
import { TopLevelFilterExpression } from "@rolldown/pluginutils";
|
|
3
|
+
import { Program } from "@oxc-project/types";
|
|
4
4
|
|
|
5
5
|
//#region src/log/logging.d.ts
|
|
6
6
|
type LogLevel = "info" | "debug" | "warn";
|
|
@@ -150,7 +150,7 @@ interface PreRenderedAsset {
|
|
|
150
150
|
}
|
|
151
151
|
type AssetFileNamesFunction = (chunkInfo: PreRenderedAsset) => string;
|
|
152
152
|
type GlobalsFunction = (name: string) => string;
|
|
153
|
-
type MinifyOptions =
|
|
153
|
+
type MinifyOptions = Omit<MinifyOptions$1, "module" | "codegen" | "sorucemap">;
|
|
154
154
|
interface ChunkingContext {
|
|
155
155
|
getModuleInfo(moduleId: string): ModuleInfo | null;
|
|
156
156
|
}
|
|
@@ -186,6 +186,16 @@ interface OutputOptions {
|
|
|
186
186
|
cssEntryFileNames?: string | ChunkFileNamesFunction;
|
|
187
187
|
cssChunkFileNames?: string | ChunkFileNamesFunction;
|
|
188
188
|
sanitizeFileName?: boolean | ((name: string) => string);
|
|
189
|
+
/**
|
|
190
|
+
* Control code minification.
|
|
191
|
+
*
|
|
192
|
+
* - `true`: Enable full minification including code compression and dead code elimination
|
|
193
|
+
* - `false`: Disable minification (default)
|
|
194
|
+
* - `'dce-only'`: Only perform dead code elimination without code compression
|
|
195
|
+
* - `MinifyOptions`: Fine-grained control over minification settings
|
|
196
|
+
*
|
|
197
|
+
* @default false
|
|
198
|
+
*/
|
|
189
199
|
minify?: boolean | "dce-only" | MinifyOptions;
|
|
190
200
|
name?: string;
|
|
191
201
|
globals?: Record<string, string> | GlobalsFunction;
|
|
@@ -543,6 +553,7 @@ interface NormalizedInputOptions {
|
|
|
543
553
|
cwd: string | undefined;
|
|
544
554
|
platform: InputOptions["platform"];
|
|
545
555
|
shimMissingExports: boolean;
|
|
556
|
+
context: string;
|
|
546
557
|
}
|
|
547
558
|
//#endregion
|
|
548
559
|
//#region src/options/normalized-output-options.d.ts
|
|
@@ -573,7 +584,7 @@ interface NormalizedOutputOptions {
|
|
|
573
584
|
sourcemapDebugIds: boolean;
|
|
574
585
|
sourcemapIgnoreList: SourcemapIgnoreListOption;
|
|
575
586
|
sourcemapPathTransform: SourcemapPathTransformOption | undefined;
|
|
576
|
-
minify: false |
|
|
587
|
+
minify: false | MinifyOptions | "dce-only";
|
|
577
588
|
legalComments: "none" | "inline";
|
|
578
589
|
polyfillRequire: boolean;
|
|
579
590
|
plugins: RolldownPlugin[];
|
|
@@ -805,30 +816,12 @@ type SourceMapInput = ExistingRawSourceMap | string | null;
|
|
|
805
816
|
//#region src/index.d.ts
|
|
806
817
|
declare const VERSION: string;
|
|
807
818
|
//#endregion
|
|
808
|
-
//#region src/builtin-plugin/
|
|
819
|
+
//#region src/builtin-plugin/utils.d.ts
|
|
809
820
|
declare class BuiltinPlugin {
|
|
810
821
|
name: BindingBuiltinPluginName;
|
|
811
822
|
_options?: unknown;
|
|
812
823
|
constructor(name: BindingBuiltinPluginName, _options?: unknown);
|
|
813
824
|
}
|
|
814
|
-
declare function modulePreloadPolyfillPlugin(config?: BindingModulePreloadPolyfillPluginConfig): BuiltinPlugin;
|
|
815
|
-
type DynamicImportVarsPluginConfig = Omit<BindingDynamicImportVarsPluginConfig, "include" | "exclude"> & {
|
|
816
|
-
include?: StringOrRegExp | StringOrRegExp[];
|
|
817
|
-
exclude?: StringOrRegExp | StringOrRegExp[];
|
|
818
|
-
};
|
|
819
|
-
declare function dynamicImportVarsPlugin(config?: DynamicImportVarsPluginConfig): BuiltinPlugin;
|
|
820
|
-
declare function importGlobPlugin(config?: BindingImportGlobPluginConfig): BuiltinPlugin;
|
|
821
|
-
declare function reporterPlugin(config?: BindingReporterPluginConfig): BuiltinPlugin;
|
|
822
|
-
declare function manifestPlugin(config?: BindingManifestPluginConfig): BuiltinPlugin;
|
|
823
|
-
declare function wasmHelperPlugin(config?: BindingWasmHelperPluginConfig): BuiltinPlugin;
|
|
824
|
-
declare function wasmFallbackPlugin(): BuiltinPlugin;
|
|
825
|
-
declare function loadFallbackPlugin(): BuiltinPlugin;
|
|
826
|
-
declare function jsonPlugin(config?: BindingJsonPluginConfig): BuiltinPlugin;
|
|
827
|
-
declare function buildImportAnalysisPlugin(config: BindingBuildImportAnalysisPluginConfig): BuiltinPlugin;
|
|
828
|
-
declare function viteResolvePlugin(config: BindingViteResolvePluginConfig): BuiltinPlugin;
|
|
829
|
-
declare function isolatedDeclarationPlugin(config?: BindingIsolatedDeclarationPluginConfig): BuiltinPlugin;
|
|
830
|
-
declare function assetPlugin(config?: BindingAssetPluginConfig): BuiltinPlugin;
|
|
831
|
-
declare function webWorkerPostPlugin(): BuiltinPlugin;
|
|
832
825
|
//#endregion
|
|
833
826
|
//#region src/constants/plugin.d.ts
|
|
834
827
|
declare const ENUMERATED_INPUT_PLUGIN_HOOK_NAMES: readonly ["options", "buildStart", "resolveId", "load", "transform", "moduleParsed", "buildEnd", "onLog", "resolveDynamicImport", "closeBundle", "closeWatcher", "watchChange"];
|
|
@@ -877,6 +870,7 @@ interface ModuleOptions {
|
|
|
877
870
|
moduleSideEffects: ModuleSideEffects;
|
|
878
871
|
meta: CustomPluginOptions;
|
|
879
872
|
invalidate?: boolean;
|
|
873
|
+
packageJsonPath?: string;
|
|
880
874
|
}
|
|
881
875
|
interface ResolvedId extends ModuleOptions {
|
|
882
876
|
external: boolean | "absolute";
|
|
@@ -1047,6 +1041,11 @@ interface ChecksOptions {
|
|
|
1047
1041
|
* @default true
|
|
1048
1042
|
*/
|
|
1049
1043
|
configurationFieldConflict?: boolean;
|
|
1044
|
+
/**
|
|
1045
|
+
* Whether to emit warning when detecting prefer builtin feature
|
|
1046
|
+
* @default true
|
|
1047
|
+
*/
|
|
1048
|
+
preferBuiltinFeature?: boolean;
|
|
1050
1049
|
}
|
|
1051
1050
|
//#endregion
|
|
1052
1051
|
//#region src/options/input-options.d.ts
|
|
@@ -1073,6 +1072,32 @@ type HmrOptions = boolean | {
|
|
|
1073
1072
|
implement?: string;
|
|
1074
1073
|
};
|
|
1075
1074
|
type OptimizationOptions = {
|
|
1075
|
+
/**
|
|
1076
|
+
* Inline imported constant values during bundling instead of preserving variable references.
|
|
1077
|
+
*
|
|
1078
|
+
* When enabled, constant values from imported modules will be inlined at their usage sites,
|
|
1079
|
+
* potentially reducing bundle size and improving runtime performance by eliminating variable lookups.
|
|
1080
|
+
*
|
|
1081
|
+
* **example**
|
|
1082
|
+
* ```js
|
|
1083
|
+
* // Input files:
|
|
1084
|
+
* // constants.js
|
|
1085
|
+
* export const API_URL = 'https://api.example.com';
|
|
1086
|
+
*
|
|
1087
|
+
* // main.js
|
|
1088
|
+
* import { API_URL } from './constants.js';
|
|
1089
|
+
* console.log(API_URL);
|
|
1090
|
+
*
|
|
1091
|
+
* // With inlineConst: true, the bundled output becomes:
|
|
1092
|
+
* console.log('https://api.example.com');
|
|
1093
|
+
*
|
|
1094
|
+
* // Instead of:
|
|
1095
|
+
* const API_URL = 'https://api.example.com';
|
|
1096
|
+
* console.log(API_URL);
|
|
1097
|
+
* ```
|
|
1098
|
+
*
|
|
1099
|
+
* @default false
|
|
1100
|
+
*/
|
|
1076
1101
|
inlineConst?: boolean;
|
|
1077
1102
|
};
|
|
1078
1103
|
type AttachDebugOptions = "none" | "simple" | "full";
|
|
@@ -1111,12 +1136,16 @@ interface InputOptions {
|
|
|
1111
1136
|
mainFiles?: string[];
|
|
1112
1137
|
modules?: string[];
|
|
1113
1138
|
symlinks?: boolean;
|
|
1114
|
-
tsconfigFilename?: string;
|
|
1115
1139
|
};
|
|
1116
1140
|
cwd?: string;
|
|
1117
1141
|
/**
|
|
1118
1142
|
* Expected platform where the code run.
|
|
1119
1143
|
*
|
|
1144
|
+
* When the platform is set to neutral:
|
|
1145
|
+
* - When bundling is enabled the default output format is set to esm, which uses the export syntax introduced with ECMAScript 2015 (i.e. ES6). You can change the output format if this default is not appropriate.
|
|
1146
|
+
* - The main fields setting is empty by default. If you want to use npm-style packages, you will likely have to configure this to be something else such as main for the standard main field used by node.
|
|
1147
|
+
* - The conditions setting does not automatically include any platform-specific values.
|
|
1148
|
+
*
|
|
1120
1149
|
* @default
|
|
1121
1150
|
* - 'node' if the format is 'cjs'
|
|
1122
1151
|
* - 'browser' for other formats
|
|
@@ -1291,6 +1320,11 @@ interface InputOptions {
|
|
|
1291
1320
|
inject?: Record<string, string | [string, string]>;
|
|
1292
1321
|
profilerNames?: boolean;
|
|
1293
1322
|
/**
|
|
1323
|
+
* @deprecated Use {@link OxcTransformOption.jsx} instead.
|
|
1324
|
+
*
|
|
1325
|
+
* This top-level `jsx` option will be removed in a future release.
|
|
1326
|
+
* It is only kept for backward compatibility and will be mapped internally to `transform.jsx`.
|
|
1327
|
+
*
|
|
1294
1328
|
* - `false` disables the JSX parser, resulting in a syntax error if JSX syntax is used.
|
|
1295
1329
|
* - `"preserve"` disables the JSX transformer, preserving the original JSX syntax in the output.
|
|
1296
1330
|
* - `"react"` enables the `classic` JSX transformer.
|
|
@@ -1328,6 +1362,17 @@ interface InputOptions {
|
|
|
1328
1362
|
preserveEntrySignatures?: false | "strict" | "allow-extension" | "exports-only";
|
|
1329
1363
|
optimization?: OptimizationOptions;
|
|
1330
1364
|
context?: string;
|
|
1365
|
+
/**
|
|
1366
|
+
* Allows you to specify where to find the TypeScript configuration file.
|
|
1367
|
+
*
|
|
1368
|
+
* You may provide:
|
|
1369
|
+
* - a relative path to the configuration file. It will be resolved relative to cwd.
|
|
1370
|
+
* - an absolute path to the configuration file.
|
|
1371
|
+
*
|
|
1372
|
+
* When a tsconfig path is specified, the module resolver will respect `compilerOptions.paths` from the specified `tsconfig.json`,
|
|
1373
|
+
* and the tsconfig options will be merged with the top-level `transform` options, with the `transform` options taking precedence.
|
|
1374
|
+
*/
|
|
1375
|
+
tsconfig?: string;
|
|
1331
1376
|
}
|
|
1332
1377
|
//#endregion
|
|
1333
1378
|
//#region src/types/rolldown-options.d.ts
|
|
@@ -1346,4 +1391,4 @@ declare function defineConfig(config: RolldownOptions): RolldownOptions;
|
|
|
1346
1391
|
declare function defineConfig(config: RolldownOptions[]): RolldownOptions[];
|
|
1347
1392
|
declare function defineConfig(config: ConfigExport): ConfigExport;
|
|
1348
1393
|
//#endregion
|
|
1349
|
-
export { type AddonFunction, type AsyncPluginHooks, type BufferEncoding, type BuildOptions, BuiltinPlugin, type ChunkFileNamesFunction, type ChunkingContext, type ConfigExport, type CustomPluginOptions, type DefineParallelPluginResult, type EmittedAsset, type EmittedFile, type ExistingRawSourceMap, type ExternalOption, type FunctionPluginHooks, type GeneralHookFilter, type GetModuleInfo, type GlobalsFunction, type HookFilter, type HookFilterExtension, type ImportKind, type InputOption, type InputOptions, type InternalModuleFormat, type LoadResult, type LogLevel, type LogLevelOption, type LogOrStringHandler, type LoggingFunction, MaybePromise, type MinifyOptions, type MinimalPluginContext, type ModuleFormat, type ModuleInfo, type ModuleOptions, type ModuleType, type ModuleTypeFilter, type ModuleTypes, type NormalizedInputOptions, type NormalizedOutputOptions, type ObjectHook, type OptimizationOptions, type OutputAsset, type OutputBundle, type OutputChunk, type OutputOptions, type ParallelPluginHooks, type PartialNull, type PartialResolvedId, type Plugin, type PluginContext, type PluginContextMeta, type PreRenderedAsset, type RenderedChunk, type RenderedModule, type ResolveIdExtraOptions, type ResolveIdResult, type ResolvedId, type RolldownBuild, type RolldownDirectoryEntry, type RolldownFileStats, type RolldownFsModule, type RolldownOptions, type RolldownOutput, type RolldownPlugin, type RolldownPluginOption, type RolldownWatcher, type RolldownWatcherEvent, type RollupError, type RollupLog, type RollupLogWithString, type SourceDescription, type SourceMap, type SourceMapInput, type SourcemapIgnoreListOption, type TransformPluginContext, type TransformResult, type TreeshakingOptions, VERSION, type WarningHandlerWithDefault, type WatchOptions, type WatcherOptions,
|
|
1394
|
+
export { type AddonFunction, type AsyncPluginHooks, type BufferEncoding, type BuildOptions, BuiltinPlugin, type ChunkFileNamesFunction, type ChunkingContext, type ConfigExport, type CustomPluginOptions, type DefineParallelPluginResult, type EmittedAsset, type EmittedFile, type ExistingRawSourceMap, type ExternalOption, type FunctionPluginHooks, type GeneralHookFilter, type GetModuleInfo, type GlobalsFunction, type HookFilter, type HookFilterExtension, type ImportKind, type InputOption, type InputOptions, type InternalModuleFormat, type LoadResult, type LogLevel, type LogLevelOption, type LogOrStringHandler, type LoggingFunction, MaybePromise, type MinifyOptions, type MinimalPluginContext, type ModuleFormat, type ModuleInfo, type ModuleOptions, type ModuleType, type ModuleTypeFilter, type ModuleTypes, type NormalizedInputOptions, type NormalizedOutputOptions, type ObjectHook, type OptimizationOptions, type OutputAsset, type OutputBundle, type OutputChunk, type OutputOptions, type ParallelPluginHooks, type PartialNull, type PartialResolvedId, type Plugin, type PluginContext, type PluginContextMeta, type PreRenderedAsset, type RenderedChunk, type RenderedModule, type ResolveIdExtraOptions, type ResolveIdResult, type ResolvedId, type RolldownBuild, type RolldownDirectoryEntry, type RolldownFileStats, type RolldownFsModule, type RolldownOptions, type RolldownOutput, type RolldownPlugin, type RolldownPluginOption, type RolldownWatcher, type RolldownWatcherEvent, type RollupError, type RollupLog, type RollupLogWithString, type SourceDescription, type SourceMap, type SourceMapInput, type SourcemapIgnoreListOption, StringOrRegExp, type TransformPluginContext, type TransformResult, type TreeshakingOptions, VERSION, type WarningHandlerWithDefault, type WatchOptions, type WatcherOptions, build, defineConfig, defineParallelPlugin, rolldown, watch, withFilter };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-DDkG_k5U.cjs');
|
|
2
|
-
const require_src = require('./src-
|
|
2
|
+
const require_src = require('./src-djpzntWm.cjs');
|
|
3
3
|
const node_fs = require_chunk.__toESM(require("node:fs"));
|
|
4
4
|
const node_path = require_chunk.__toESM(require("node:path"));
|
|
5
5
|
const node_url = require_chunk.__toESM(require("node:url"));
|