@rolldown/browser 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.
Files changed (42) hide show
  1. package/dist/cli.cjs +243 -238
  2. package/dist/cli.mjs +232 -232
  3. package/dist/config.cjs +3 -3
  4. package/dist/config.d.cts +2 -2
  5. package/dist/config.d.mts +2 -2
  6. package/dist/config.mjs +3 -3
  7. package/dist/experimental-index.browser.mjs +51 -6
  8. package/dist/experimental-index.cjs +57 -7
  9. package/dist/experimental-index.d.cts +45 -4
  10. package/dist/experimental-index.d.mts +45 -4
  11. package/dist/experimental-index.mjs +52 -7
  12. package/dist/filter-index.d.cts +2 -2
  13. package/dist/filter-index.d.mts +2 -2
  14. package/dist/index.browser.mjs +1 -1
  15. package/dist/index.cjs +2 -2
  16. package/dist/index.d.cts +2 -2
  17. package/dist/index.d.mts +2 -2
  18. package/dist/index.mjs +2 -2
  19. package/dist/parallel-plugin-worker.cjs +6 -4
  20. package/dist/parallel-plugin-worker.mjs +3 -3
  21. package/dist/parallel-plugin.d.cts +2 -2
  22. package/dist/parallel-plugin.d.mts +2 -2
  23. package/dist/parse-ast-index.cjs +1 -1
  24. package/dist/parse-ast-index.d.cts +1 -1
  25. package/dist/parse-ast-index.d.mts +1 -1
  26. package/dist/parse-ast-index.mjs +1 -1
  27. package/dist/rolldown-binding.wasi-browser.js +7 -0
  28. package/dist/rolldown-binding.wasi.cjs +7 -0
  29. package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
  30. package/dist/shared/{binding-CFhvYkVn.d.mts → binding-9k0egz6L.d.mts} +107 -7
  31. package/dist/shared/{binding-DQk9TN_A.d.cts → binding-D13M6Llu.d.cts} +107 -7
  32. package/dist/shared/{define-config-B3QOs3Kt.d.cts → define-config-DJXaSinS.d.mts} +90 -24
  33. package/dist/shared/{define-config-DyjJkNqG.d.mts → define-config-DhrkZ_o7.d.cts} +90 -24
  34. package/dist/shared/{load-config-CLPLfZVe.mjs → load-config-BCjD-AGJ.mjs} +1 -1
  35. package/dist/shared/{load-config-xKQFLlGV.cjs → load-config-BJKhRKZL.cjs} +11 -6
  36. package/dist/shared/{parse-ast-index-BGzB5Bo-.mjs → parse-ast-index-C_CZT4St.mjs} +1 -1
  37. package/dist/shared/{parse-ast-index-BZfwAN9P.cjs → parse-ast-index-J0xVKZRe.cjs} +3 -2
  38. package/dist/shared/{prompt-QNI93ne7.cjs → prompt-Q05EYrFb.cjs} +8 -4
  39. package/dist/shared/{src-CZgQg1yE.mjs → src-B0RCtUy7.mjs} +160 -101
  40. package/dist/shared/{src-CGziNJPr.cjs → src-Bd4BGX4v.cjs} +193 -116
  41. package/dist/{src-D_htlJ_o.js → src-C8U06Im1.js} +157 -98
  42. package/package.json +19 -11
@@ -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;
@@ -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, BindingMinifyOptions, BindingModulePreloadPolyfillPluginConfig, BindingRenderedChunk, BindingReplacePluginConfig, BindingReporterPluginConfig, BindingTransformHookExtraArgs, BindingTransformPluginConfig, BindingViteResolvePluginConfig, BindingWasmHelperPluginConfig, BindingWatcherEvent, IsolatedDeclarationsOptions, IsolatedDeclarationsResult, NapiResolveOptions, ParseResult, ParserOptions, PreRenderedChunk, ResolveResult, ResolverFactory, TransformOptions, TransformResult, isolatedDeclaration, moduleRunnerTransform, transform };
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 };
@@ -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;
@@ -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, BindingMinifyOptions, BindingModulePreloadPolyfillPluginConfig, BindingRenderedChunk, BindingReplacePluginConfig, BindingReporterPluginConfig, BindingTransformHookExtraArgs, BindingTransformPluginConfig, BindingViteResolvePluginConfig, BindingWasmHelperPluginConfig, BindingWatcherEvent, IsolatedDeclarationsOptions, IsolatedDeclarationsResult, NapiResolveOptions, ParseResult, ParserOptions, PreRenderedChunk, ResolveResult, ResolverFactory, TransformOptions, TransformResult, isolatedDeclaration, moduleRunnerTransform, transform };
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,4 +1,4 @@
1
- import { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingBuiltinPluginName, BindingBundlerImpl, BindingDynamicImportVarsPluginConfig, BindingHmrUpdate, BindingHookResolveIdExtraArgs, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingMinifyOptions, BindingModulePreloadPolyfillPluginConfig, BindingRenderedChunk, BindingReporterPluginConfig, BindingTransformHookExtraArgs, BindingViteResolvePluginConfig, BindingWasmHelperPluginConfig, BindingWatcherEvent, ParserOptions, PreRenderedChunk, TransformOptions } from "./binding-DQk9TN_A.cjs";
1
+ import { BindingBuiltinPluginName, BindingBundlerImpl, BindingHmrUpdate, BindingHookResolveIdExtraArgs, BindingRenderedChunk, BindingTransformHookExtraArgs, BindingWatcherEvent, MinifyOptions as MinifyOptions$1, ParserOptions, PreRenderedChunk, TransformOptions } from "./binding-9k0egz6L.mjs";
2
2
  import { Program } from "@oxc-project/types";
3
3
  import { TopLevelFilterExpression } from "@rolldown/pluginutils";
4
4
 
@@ -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 = BindingMinifyOptions;
153
+ type MinifyOptions = Omit<MinifyOptions$1, "module" | "codegen" | "sourcemap">;
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;
@@ -574,7 +584,7 @@ interface NormalizedOutputOptions {
574
584
  sourcemapDebugIds: boolean;
575
585
  sourcemapIgnoreList: SourcemapIgnoreListOption;
576
586
  sourcemapPathTransform: SourcemapPathTransformOption | undefined;
577
- minify: false | BindingMinifyOptions;
587
+ minify: false | MinifyOptions | "dce-only";
578
588
  legalComments: "none" | "inline";
579
589
  polyfillRequire: boolean;
580
590
  plugins: RolldownPlugin[];
@@ -783,6 +793,8 @@ type TreeshakingOptions = {
783
793
  manualPureFunctions?: readonly string[];
784
794
  unknownGlobalSideEffects?: boolean;
785
795
  commonjs?: boolean;
796
+ propertyReadSideEffects?: false | "always";
797
+ propertyWriteSideEffects?: false | "always";
786
798
  };
787
799
  //#endregion
788
800
  //#region src/types/output-bundle.d.ts
@@ -806,30 +818,16 @@ type SourceMapInput = ExistingRawSourceMap | string | null;
806
818
  //#region src/index.d.ts
807
819
  declare const VERSION: string;
808
820
  //#endregion
809
- //#region src/builtin-plugin/constructors.d.ts
821
+ //#region src/builtin-plugin/utils.d.ts
822
+ declare const BuiltinClassSymbol: symbol;
810
823
  declare class BuiltinPlugin {
811
824
  name: BindingBuiltinPluginName;
812
825
  _options?: unknown;
813
826
  constructor(name: BindingBuiltinPluginName, _options?: unknown);
814
827
  }
815
- declare function modulePreloadPolyfillPlugin(config?: BindingModulePreloadPolyfillPluginConfig): BuiltinPlugin;
816
- type DynamicImportVarsPluginConfig = Omit<BindingDynamicImportVarsPluginConfig, "include" | "exclude"> & {
817
- include?: StringOrRegExp | StringOrRegExp[];
818
- exclude?: StringOrRegExp | StringOrRegExp[];
819
- };
820
- declare function dynamicImportVarsPlugin(config?: DynamicImportVarsPluginConfig): BuiltinPlugin;
821
- declare function importGlobPlugin(config?: BindingImportGlobPluginConfig): BuiltinPlugin;
822
- declare function reporterPlugin(config?: BindingReporterPluginConfig): BuiltinPlugin;
823
- declare function manifestPlugin(config?: BindingManifestPluginConfig): BuiltinPlugin;
824
- declare function wasmHelperPlugin(config?: BindingWasmHelperPluginConfig): BuiltinPlugin;
825
- declare function wasmFallbackPlugin(): BuiltinPlugin;
826
- declare function loadFallbackPlugin(): BuiltinPlugin;
827
- declare function jsonPlugin(config?: BindingJsonPluginConfig): BuiltinPlugin;
828
- declare function buildImportAnalysisPlugin(config: BindingBuildImportAnalysisPluginConfig): BuiltinPlugin;
829
- declare function viteResolvePlugin(config: BindingViteResolvePluginConfig): BuiltinPlugin;
830
- declare function isolatedDeclarationPlugin(config?: BindingIsolatedDeclarationPluginConfig): BuiltinPlugin;
831
- declare function assetPlugin(config?: BindingAssetPluginConfig): BuiltinPlugin;
832
- declare function webWorkerPostPlugin(): BuiltinPlugin;
828
+ interface BuiltinPlugin {
829
+ [BuiltinClassSymbol]: boolean;
830
+ }
833
831
  //#endregion
834
832
  //#region src/constants/plugin.d.ts
835
833
  declare const ENUMERATED_INPUT_PLUGIN_HOOK_NAMES: readonly ["options", "buildStart", "resolveId", "load", "transform", "moduleParsed", "buildEnd", "onLog", "resolveDynamicImport", "closeBundle", "closeWatcher", "watchChange"];
@@ -878,6 +876,7 @@ interface ModuleOptions {
878
876
  moduleSideEffects: ModuleSideEffects;
879
877
  meta: CustomPluginOptions;
880
878
  invalidate?: boolean;
879
+ packageJsonPath?: string;
881
880
  }
882
881
  interface ResolvedId extends ModuleOptions {
883
882
  external: boolean | "absolute";
@@ -1048,6 +1047,11 @@ interface ChecksOptions {
1048
1047
  * @default true
1049
1048
  */
1050
1049
  configurationFieldConflict?: boolean;
1050
+ /**
1051
+ * Whether to emit warning when detecting prefer builtin feature
1052
+ * @default true
1053
+ */
1054
+ preferBuiltinFeature?: boolean;
1051
1055
  }
1052
1056
  //#endregion
1053
1057
  //#region src/options/input-options.d.ts
@@ -1072,9 +1076,52 @@ type HmrOptions = boolean | {
1072
1076
  host?: string;
1073
1077
  port?: number;
1074
1078
  implement?: string;
1079
+ new?: boolean;
1075
1080
  };
1076
1081
  type OptimizationOptions = {
1077
- inlineConst?: boolean;
1082
+ /**
1083
+ * Inline imported constant values during bundling instead of preserving variable references.
1084
+ *
1085
+ * When enabled, constant values from imported modules will be inlined at their usage sites,
1086
+ * potentially reducing bundle size and improving runtime performance by eliminating variable lookups.
1087
+ * **options**:
1088
+ * - `true`: equivalent to `{ mode: 'all', pass: 1 }`, enabling constant inlining for all eligible constants with a single pass.
1089
+ * - `false`: Disable constant inlining
1090
+ * - `{ mode: 'smart' | 'all', pass?: number }`:
1091
+ * - `mode: 'smart'`: Only inline constants in specific scenarios where it is likely to reduce bundle size and improve performance.
1092
+ * Smart mode inlines constants in these specific scenarios:
1093
+ * 1. `if (test) {} else {}` - condition expressions in if statements
1094
+ * 2. `test ? a : b` - condition expressions in ternary operators
1095
+ * 3. `test1 || test2` - logical OR expressions
1096
+ * 4. `test1 && test2` - logical AND expressions
1097
+ * 5. `test1 ?? test2` - nullish coalescing expressions
1098
+ * - `mode: 'all'`: Inline all imported constants wherever they are used.
1099
+ * - `pass`: Number of passes to perform for inlining constants.
1100
+ *
1101
+ * **example**
1102
+ * ```js
1103
+ * // Input files:
1104
+ * // constants.js
1105
+ * export const API_URL = 'https://api.example.com';
1106
+ *
1107
+ * // main.js
1108
+ * import { API_URL } from './constants.js';
1109
+ * console.log(API_URL);
1110
+ *
1111
+ * // With inlineConst: true, the bundled output becomes:
1112
+ * console.log('https://api.example.com');
1113
+ *
1114
+ * // Instead of:
1115
+ * const API_URL = 'https://api.example.com';
1116
+ * console.log(API_URL);
1117
+ * ```
1118
+ *
1119
+ * @default false
1120
+ */
1121
+ inlineConst?: boolean | {
1122
+ mode?: "all" | "smart";
1123
+ pass?: number;
1124
+ };
1078
1125
  };
1079
1126
  type AttachDebugOptions = "none" | "simple" | "full";
1080
1127
  type ChunkModulesOrder = "exec-order" | "module-id";
@@ -1112,6 +1159,9 @@ interface InputOptions {
1112
1159
  mainFiles?: string[];
1113
1160
  modules?: string[];
1114
1161
  symlinks?: boolean;
1162
+ /**
1163
+ * @deprecated Use the top-level `tsconfig` option instead.
1164
+ */
1115
1165
  tsconfigFilename?: string;
1116
1166
  };
1117
1167
  cwd?: string;
@@ -1297,6 +1347,11 @@ interface InputOptions {
1297
1347
  inject?: Record<string, string | [string, string]>;
1298
1348
  profilerNames?: boolean;
1299
1349
  /**
1350
+ * @deprecated Use {@link OxcTransformOption.jsx} instead.
1351
+ *
1352
+ * This top-level `jsx` option will be removed in a future release.
1353
+ * It is only kept for backward compatibility and will be mapped internally to `transform.jsx`.
1354
+ *
1300
1355
  * - `false` disables the JSX parser, resulting in a syntax error if JSX syntax is used.
1301
1356
  * - `"preserve"` disables the JSX transformer, preserving the original JSX syntax in the output.
1302
1357
  * - `"react"` enables the `classic` JSX transformer.
@@ -1334,6 +1389,17 @@ interface InputOptions {
1334
1389
  preserveEntrySignatures?: false | "strict" | "allow-extension" | "exports-only";
1335
1390
  optimization?: OptimizationOptions;
1336
1391
  context?: string;
1392
+ /**
1393
+ * Allows you to specify where to find the TypeScript configuration file.
1394
+ *
1395
+ * You may provide:
1396
+ * - a relative path to the configuration file. It will be resolved relative to cwd.
1397
+ * - an absolute path to the configuration file.
1398
+ *
1399
+ * When a tsconfig path is specified, the module resolver will respect `compilerOptions.paths` from the specified `tsconfig.json`,
1400
+ * and the tsconfig options will be merged with the top-level `transform` options, with the `transform` options taking precedence.
1401
+ */
1402
+ tsconfig?: string;
1337
1403
  }
1338
1404
  //#endregion
1339
1405
  //#region src/types/rolldown-options.d.ts
@@ -1352,4 +1418,4 @@ declare function defineConfig(config: RolldownOptions): RolldownOptions;
1352
1418
  declare function defineConfig(config: RolldownOptions[]): RolldownOptions[];
1353
1419
  declare function defineConfig(config: ConfigExport): ConfigExport;
1354
1420
  //#endregion
1355
- 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, assetPlugin, build, buildImportAnalysisPlugin, defineConfig, defineParallelPlugin, dynamicImportVarsPlugin, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, reporterPlugin, rolldown, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch, webWorkerPostPlugin, withFilter };
1421
+ 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 };