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.
Files changed (35) hide show
  1. package/dist/cli.cjs +5 -5
  2. package/dist/cli.mjs +5 -5
  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.cjs +36 -2
  8. package/dist/experimental-index.d.cts +36 -4
  9. package/dist/experimental-index.d.mts +36 -4
  10. package/dist/experimental-index.mjs +34 -3
  11. package/dist/filter-index.d.cts +2 -2
  12. package/dist/filter-index.d.mts +2 -2
  13. package/dist/index.cjs +2 -2
  14. package/dist/index.d.cts +2 -2
  15. package/dist/index.d.mts +2 -2
  16. package/dist/index.mjs +2 -2
  17. package/dist/parallel-plugin-worker.cjs +2 -2
  18. package/dist/parallel-plugin-worker.mjs +2 -2
  19. package/dist/parallel-plugin.d.cts +2 -2
  20. package/dist/parallel-plugin.d.mts +2 -2
  21. package/dist/parse-ast-index.cjs +1 -1
  22. package/dist/parse-ast-index.d.cts +1 -1
  23. package/dist/parse-ast-index.d.mts +1 -1
  24. package/dist/parse-ast-index.mjs +1 -1
  25. package/dist/shared/{binding-CFhvYkVn.d.mts → binding-9k0egz6L.d.mts} +107 -7
  26. package/dist/shared/{binding-DQk9TN_A.d.cts → binding-D13M6Llu.d.cts} +107 -7
  27. package/dist/shared/{define-config-B3QOs3Kt.d.cts → define-config-D5AluabE.d.cts} +63 -24
  28. package/dist/shared/{define-config-DtlZ1GSS.d.mts → define-config-DVSr6Unb.d.mts} +63 -24
  29. package/dist/shared/{load-config-C00QU0Nl.mjs → load-config-CXpGBNqp.mjs} +1 -1
  30. package/dist/shared/{load-config-B-y3XROZ.cjs → load-config-CefxSUnT.cjs} +1 -1
  31. package/dist/shared/{parse-ast-index-DBzcfyxO.cjs → parse-ast-index-BCv3Y1TT.cjs} +31 -25
  32. package/dist/shared/{parse-ast-index-BsbuAWqn.mjs → parse-ast-index-DjojK-Vf.mjs} +26 -26
  33. package/dist/shared/{src-D1dc6nJr.mjs → src-Chn1S4O2.mjs} +98 -84
  34. package/dist/shared/{src-DZTBSVJk.cjs → src-djpzntWm.cjs} +109 -83
  35. package/package.json +20 -20
@@ -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-D13M6Llu.cjs";
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" | "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;
@@ -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[];
@@ -806,30 +816,12 @@ type SourceMapInput = ExistingRawSourceMap | string | null;
806
816
  //#region src/index.d.ts
807
817
  declare const VERSION: string;
808
818
  //#endregion
809
- //#region src/builtin-plugin/constructors.d.ts
819
+ //#region src/builtin-plugin/utils.d.ts
810
820
  declare class BuiltinPlugin {
811
821
  name: BindingBuiltinPluginName;
812
822
  _options?: unknown;
813
823
  constructor(name: BindingBuiltinPluginName, _options?: unknown);
814
824
  }
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;
833
825
  //#endregion
834
826
  //#region src/constants/plugin.d.ts
835
827
  declare const ENUMERATED_INPUT_PLUGIN_HOOK_NAMES: readonly ["options", "buildStart", "resolveId", "load", "transform", "moduleParsed", "buildEnd", "onLog", "resolveDynamicImport", "closeBundle", "closeWatcher", "watchChange"];
@@ -878,6 +870,7 @@ interface ModuleOptions {
878
870
  moduleSideEffects: ModuleSideEffects;
879
871
  meta: CustomPluginOptions;
880
872
  invalidate?: boolean;
873
+ packageJsonPath?: string;
881
874
  }
882
875
  interface ResolvedId extends ModuleOptions {
883
876
  external: boolean | "absolute";
@@ -1048,6 +1041,11 @@ interface ChecksOptions {
1048
1041
  * @default true
1049
1042
  */
1050
1043
  configurationFieldConflict?: boolean;
1044
+ /**
1045
+ * Whether to emit warning when detecting prefer builtin feature
1046
+ * @default true
1047
+ */
1048
+ preferBuiltinFeature?: boolean;
1051
1049
  }
1052
1050
  //#endregion
1053
1051
  //#region src/options/input-options.d.ts
@@ -1074,6 +1072,32 @@ type HmrOptions = boolean | {
1074
1072
  implement?: string;
1075
1073
  };
1076
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
+ */
1077
1101
  inlineConst?: boolean;
1078
1102
  };
1079
1103
  type AttachDebugOptions = "none" | "simple" | "full";
@@ -1112,7 +1136,6 @@ interface InputOptions {
1112
1136
  mainFiles?: string[];
1113
1137
  modules?: string[];
1114
1138
  symlinks?: boolean;
1115
- tsconfigFilename?: string;
1116
1139
  };
1117
1140
  cwd?: string;
1118
1141
  /**
@@ -1297,6 +1320,11 @@ interface InputOptions {
1297
1320
  inject?: Record<string, string | [string, string]>;
1298
1321
  profilerNames?: boolean;
1299
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
+ *
1300
1328
  * - `false` disables the JSX parser, resulting in a syntax error if JSX syntax is used.
1301
1329
  * - `"preserve"` disables the JSX transformer, preserving the original JSX syntax in the output.
1302
1330
  * - `"react"` enables the `classic` JSX transformer.
@@ -1334,6 +1362,17 @@ interface InputOptions {
1334
1362
  preserveEntrySignatures?: false | "strict" | "allow-extension" | "exports-only";
1335
1363
  optimization?: OptimizationOptions;
1336
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;
1337
1376
  }
1338
1377
  //#endregion
1339
1378
  //#region src/types/rolldown-options.d.ts
@@ -1352,4 +1391,4 @@ declare function defineConfig(config: RolldownOptions): RolldownOptions;
1352
1391
  declare function defineConfig(config: RolldownOptions[]): RolldownOptions[];
1353
1392
  declare function defineConfig(config: ConfigExport): ConfigExport;
1354
1393
  //#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 };
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,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-CFhvYkVn.mjs";
1
+ import { BindingBuiltinPluginName, BindingBundlerImpl, BindingHmrUpdate, BindingHookResolveIdExtraArgs, BindingRenderedChunk, BindingTransformHookExtraArgs, BindingWatcherEvent, MinifyOptions as MinifyOptions$1, ParserOptions, PreRenderedChunk, TransformOptions } from "./binding-9k0egz6L.mjs";
2
2
  import { TopLevelFilterExpression } from "@rolldown/pluginutils";
3
3
  import { Program } from "@oxc-project/types";
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" | "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;
@@ -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[];
@@ -806,30 +816,12 @@ type SourceMapInput = ExistingRawSourceMap | string | null;
806
816
  //#region src/index.d.ts
807
817
  declare const VERSION: string;
808
818
  //#endregion
809
- //#region src/builtin-plugin/constructors.d.ts
819
+ //#region src/builtin-plugin/utils.d.ts
810
820
  declare class BuiltinPlugin {
811
821
  name: BindingBuiltinPluginName;
812
822
  _options?: unknown;
813
823
  constructor(name: BindingBuiltinPluginName, _options?: unknown);
814
824
  }
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;
833
825
  //#endregion
834
826
  //#region src/constants/plugin.d.ts
835
827
  declare const ENUMERATED_INPUT_PLUGIN_HOOK_NAMES: readonly ["options", "buildStart", "resolveId", "load", "transform", "moduleParsed", "buildEnd", "onLog", "resolveDynamicImport", "closeBundle", "closeWatcher", "watchChange"];
@@ -878,6 +870,7 @@ interface ModuleOptions {
878
870
  moduleSideEffects: ModuleSideEffects;
879
871
  meta: CustomPluginOptions;
880
872
  invalidate?: boolean;
873
+ packageJsonPath?: string;
881
874
  }
882
875
  interface ResolvedId extends ModuleOptions {
883
876
  external: boolean | "absolute";
@@ -1048,6 +1041,11 @@ interface ChecksOptions {
1048
1041
  * @default true
1049
1042
  */
1050
1043
  configurationFieldConflict?: boolean;
1044
+ /**
1045
+ * Whether to emit warning when detecting prefer builtin feature
1046
+ * @default true
1047
+ */
1048
+ preferBuiltinFeature?: boolean;
1051
1049
  }
1052
1050
  //#endregion
1053
1051
  //#region src/options/input-options.d.ts
@@ -1074,6 +1072,32 @@ type HmrOptions = boolean | {
1074
1072
  implement?: string;
1075
1073
  };
1076
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
+ */
1077
1101
  inlineConst?: boolean;
1078
1102
  };
1079
1103
  type AttachDebugOptions = "none" | "simple" | "full";
@@ -1112,7 +1136,6 @@ interface InputOptions {
1112
1136
  mainFiles?: string[];
1113
1137
  modules?: string[];
1114
1138
  symlinks?: boolean;
1115
- tsconfigFilename?: string;
1116
1139
  };
1117
1140
  cwd?: string;
1118
1141
  /**
@@ -1297,6 +1320,11 @@ interface InputOptions {
1297
1320
  inject?: Record<string, string | [string, string]>;
1298
1321
  profilerNames?: boolean;
1299
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
+ *
1300
1328
  * - `false` disables the JSX parser, resulting in a syntax error if JSX syntax is used.
1301
1329
  * - `"preserve"` disables the JSX transformer, preserving the original JSX syntax in the output.
1302
1330
  * - `"react"` enables the `classic` JSX transformer.
@@ -1334,6 +1362,17 @@ interface InputOptions {
1334
1362
  preserveEntrySignatures?: false | "strict" | "allow-extension" | "exports-only";
1335
1363
  optimization?: OptimizationOptions;
1336
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;
1337
1376
  }
1338
1377
  //#endregion
1339
1378
  //#region src/types/rolldown-options.d.ts
@@ -1352,4 +1391,4 @@ declare function defineConfig(config: RolldownOptions): RolldownOptions;
1352
1391
  declare function defineConfig(config: RolldownOptions[]): RolldownOptions[];
1353
1392
  declare function defineConfig(config: ConfigExport): ConfigExport;
1354
1393
  //#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 };
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,4 +1,4 @@
1
- import { rolldown } from "./src-D1dc6nJr.mjs";
1
+ import { rolldown } from "./src-Chn1S4O2.mjs";
2
2
  import fs from "node:fs";
3
3
  import path from "node:path";
4
4
  import { pathToFileURL } from "node:url";
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require('./chunk-DDkG_k5U.cjs');
2
- const require_src = require('./src-DZTBSVJk.cjs');
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"));