rolldown 1.0.0-beta.23 → 1.0.0-beta.25

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 (36) hide show
  1. package/dist/cli.cjs +7 -7
  2. package/dist/cli.mjs +7 -7
  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 +2 -2
  8. package/dist/experimental-index.d.cts +2 -4
  9. package/dist/experimental-index.d.mts +2 -4
  10. package/dist/experimental-index.mjs +2 -2
  11. package/dist/experimental-runtime-types.d.ts +3 -2
  12. package/dist/filter-index.d.cts +2 -2
  13. package/dist/filter-index.d.mts +2 -2
  14. package/dist/index.cjs +2 -2
  15. package/dist/index.d.cts +3 -3
  16. package/dist/index.d.mts +3 -3
  17. package/dist/index.mjs +2 -2
  18. package/dist/parallel-plugin-worker.cjs +2 -2
  19. package/dist/parallel-plugin-worker.mjs +2 -2
  20. package/dist/parallel-plugin.d.cts +2 -2
  21. package/dist/parallel-plugin.d.mts +2 -2
  22. package/dist/parse-ast-index.cjs +1 -1
  23. package/dist/parse-ast-index.d.cts +1 -2
  24. package/dist/parse-ast-index.d.mts +1 -2
  25. package/dist/parse-ast-index.mjs +1 -1
  26. package/dist/shared/{binding-CMKStSph.d.cts → binding-B9-3a5q4.d.cts} +0 -10
  27. package/dist/shared/{binding-DB58iXP8.d.mts → binding-DQYRWAqj.d.mts} +0 -10
  28. package/dist/shared/{define-config-BRkYSF9E.d.cts → define-config-DM79zlkB.d.mts} +37 -32
  29. package/dist/shared/{define-config-CyRbZDRR.d.mts → define-config-ZN70csxk.d.cts} +37 -32
  30. package/dist/shared/{load-config-n-iiDvYj.cjs → load-config-CTkl_gvX.cjs} +1 -1
  31. package/dist/shared/{load-config-CTdjFUJH.mjs → load-config-FeIDZeND.mjs} +1 -1
  32. package/dist/shared/{parse-ast-index-DDMiEgyY.cjs → parse-ast-index-BZPHquvf.cjs} +17 -5
  33. package/dist/shared/{parse-ast-index-DmWy-n6o.mjs → parse-ast-index-BztFsVUE.mjs} +10 -4
  34. package/dist/shared/{src-DgdMNl-3.mjs → src-BS7SHs-K.mjs} +106 -63
  35. package/dist/shared/{src-D6QrbVqq.cjs → src-CKVDAG8j.cjs} +106 -63
  36. package/package.json +19 -19
@@ -1,6 +1,6 @@
1
- import { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingBuiltinPluginName, BindingBundlerImpl, BindingDynamicImportVarsPluginConfig, BindingHmrOutputPatch, BindingHookResolveIdExtraArgs, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingMfManifest, BindingMinifyOptions, BindingModuleFederationPluginOption, BindingModulePreloadPolyfillPluginConfig, BindingRemote, BindingRenderedChunk, BindingReporterPluginConfig, BindingTransformHookExtraArgs, BindingViteResolvePluginConfig, BindingWasmHelperPluginConfig, BindingWatcherEvent, ParserOptions, PreRenderedChunk, TransformOptions } from "./binding-CMKStSph.cjs";
2
- import { Program } from "@oxc-project/types";
1
+ import { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingBuiltinPluginName, BindingBundlerImpl, BindingDynamicImportVarsPluginConfig, BindingHmrOutputPatch, BindingHookResolveIdExtraArgs, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingMfManifest, BindingMinifyOptions, BindingModuleFederationPluginOption, BindingModulePreloadPolyfillPluginConfig, BindingRemote, BindingRenderedChunk, BindingReporterPluginConfig, BindingTransformHookExtraArgs, BindingViteResolvePluginConfig, BindingWasmHelperPluginConfig, BindingWatcherEvent, ParserOptions, PreRenderedChunk, TransformOptions } from "./binding-DQYRWAqj.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";
@@ -426,6 +426,14 @@ interface OutputOptions {
426
426
  preserveModules?: boolean;
427
427
  virtualDirname?: string;
428
428
  preserveModulesRoot?: string;
429
+ topLevelVar?: boolean;
430
+ /**
431
+ * - Type: `boolean`
432
+ * - Default: `false`
433
+ *
434
+ * Whether to minify internal exports.
435
+ */
436
+ minifyInternalExports?: boolean;
429
437
  }
430
438
  //#endregion
431
439
  //#region src/api/build.d.ts
@@ -453,16 +461,12 @@ declare class RolldownBuild {
453
461
  write(outputOptions?: OutputOptions): Promise<RolldownOutput>;
454
462
  close(): Promise<void>;
455
463
  [Symbol.asyncDispose](): Promise<void>;
456
- generateHmrPatch(changedFiles: string[]): Promise<BindingHmrOutputPatch>;
464
+ generateHmrPatch(changedFiles: string[]): Promise<BindingHmrOutputPatch | undefined>;
457
465
  hmrInvalidate(file: string, firstInvalidatedBy?: string): Promise<BindingHmrOutputPatch>;
458
- // TODO(underfin)
459
- // The `watchFiles` method returns a promise, but Rollup does not.
460
- // Converting it to a synchronous API might cause a deadlock if the user calls `write` and `watchFiles` simultaneously.
461
466
  get watchFiles(): Promise<string[]>;
462
467
  }
463
468
  //#endregion
464
469
  //#region src/api/rolldown/index.d.ts
465
- // `async` here is intentional to be compatible with `rollup.rollup`.
466
470
  declare const rolldown: (input: InputOptions) => Promise<RolldownBuild>;
467
471
  //#endregion
468
472
  //#region src/options/watch-options.d.ts
@@ -473,7 +477,6 @@ interface WatchOptions extends InputOptions {
473
477
  //#region src/api/watch/watch-emitter.d.ts
474
478
  type WatcherEvent = "close" | "event" | "restart" | "change";
475
479
  type ChangeEvent$1 = "create" | "update" | "delete";
476
- // TODO: find a way use `RolldownBuild` instead of `Bundler`.
477
480
  type RolldownWatchBuild = BindingBundlerImpl;
478
481
  type RolldownWatcherEvent = {
479
482
  code: "START";
@@ -482,7 +485,6 @@ type RolldownWatcherEvent = {
482
485
  } | {
483
486
  code: "BUNDLE_END";
484
487
  duration: number;
485
- // input?: InputOption
486
488
  output: readonly string[];
487
489
  result: RolldownWatchBuild;
488
490
  } | {
@@ -508,7 +510,6 @@ declare class WatcherEmitter {
508
510
  type RolldownWatcher = WatcherEmitter;
509
511
  //#endregion
510
512
  //#region src/api/watch/index.d.ts
511
- // Compat to `rollup.watch`
512
513
  declare const watch: (input: WatchOptions | WatchOptions[]) => RolldownWatcher;
513
514
  //#endregion
514
515
  //#region src/log/log-handler.d.ts
@@ -526,7 +527,6 @@ interface NormalizedInputOptions {
526
527
  platform: InputOptions["platform"];
527
528
  shimMissingExports: boolean;
528
529
  }
529
- // TODO: I guess we make these getters enumerable so it act more like a plain object
530
530
  //#endregion
531
531
  //#region src/options/normalized-output-options.d.ts
532
532
  type InternalModuleFormat = "es" | "cjs" | "iife" | "umd";
@@ -562,8 +562,9 @@ interface NormalizedOutputOptions {
562
562
  preserveModules: boolean;
563
563
  virtualDirname: string;
564
564
  preserveModulesRoot?: string;
565
+ topLevelVar?: boolean;
566
+ minifyInternalExports?: boolean;
565
567
  }
566
- // TODO: I guess we make these getters enumerable so it act more like a plain object
567
568
  //#endregion
568
569
  //#region src/plugin/hook-filter.d.ts
569
570
  type GeneralHookFilter<Value = StringOrRegExp> = MaybeArray<Value> | {
@@ -657,6 +658,7 @@ interface EmittedChunk {
657
658
  }
658
659
  type EmittedFile = EmittedAsset | EmittedChunk;
659
660
  interface PluginContextResolveOptions {
661
+ isEntry?: boolean;
660
662
  skipSelf?: boolean;
661
663
  custom?: CustomPluginOptions;
662
664
  }
@@ -726,12 +728,15 @@ declare const VERSION: string;
726
728
  //#region src/builtin-plugin/constructors.d.ts
727
729
  declare class BuiltinPlugin {
728
730
  name: BindingBuiltinPluginName;
729
- // NOTE: has `_` to avoid conflict with `options` hook
730
731
  _options?: unknown;
731
732
  constructor(name: BindingBuiltinPluginName, _options?: unknown);
732
733
  }
733
734
  declare function modulePreloadPolyfillPlugin(config?: BindingModulePreloadPolyfillPluginConfig): BuiltinPlugin;
734
- declare function dynamicImportVarsPlugin(config?: BindingDynamicImportVarsPluginConfig): BuiltinPlugin;
735
+ type DynamicImportVarsPluginConfig = Omit<BindingDynamicImportVarsPluginConfig, "include" | "exclude"> & {
736
+ include?: StringOrRegExp | StringOrRegExp[];
737
+ exclude?: StringOrRegExp | StringOrRegExp[];
738
+ };
739
+ declare function dynamicImportVarsPlugin(config?: DynamicImportVarsPluginConfig): BuiltinPlugin;
735
740
  declare function importGlobPlugin(config?: BindingImportGlobPluginConfig): BuiltinPlugin;
736
741
  declare function reporterPlugin(config?: BindingReporterPluginConfig): BuiltinPlugin;
737
742
  declare function manifestPlugin(config?: BindingManifestPluginConfig): BuiltinPlugin;
@@ -788,7 +793,6 @@ declare function withFilter<A, T extends RolldownPluginOption<A>>(pluginOption:
788
793
  //#endregion
789
794
  //#region src/plugin/index.d.ts
790
795
  type ModuleSideEffects = boolean | "no-treeshake" | null;
791
- // ref: https://github.com/microsoft/TypeScript/issues/33471#issuecomment-1376364329
792
796
  type ModuleType = "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | (string & {});
793
797
  type ImportKind = BindingHookResolveIdExtraArgs["kind"];
794
798
  interface CustomPluginOptions {
@@ -797,8 +801,6 @@ interface CustomPluginOptions {
797
801
  interface ModuleOptions {
798
802
  moduleSideEffects: ModuleSideEffects;
799
803
  meta: CustomPluginOptions;
800
- // flag used to check if user directly modified the `ModuleInfo`
801
- // this is used to sync state between rust and js
802
804
  invalidate?: boolean;
803
805
  }
804
806
  interface ResolvedId extends ModuleOptions {
@@ -828,9 +830,7 @@ type RenderedChunkMeta = {
828
830
  interface FunctionPluginHooks {
829
831
  [DEFINED_HOOK_NAMES.onLog]: (this: MinimalPluginContext, level: LogLevel, log: RollupLog) => NullValue | boolean;
830
832
  [DEFINED_HOOK_NAMES.options]: (this: MinimalPluginContext, options: InputOptions) => NullValue | InputOptions;
831
- // TODO find a way to make `this: PluginContext` work.
832
833
  [DEFINED_HOOK_NAMES.outputOptions]: (this: MinimalPluginContext, options: OutputOptions) => NullValue | OutputOptions;
833
- // --- Build hooks ---
834
834
  [DEFINED_HOOK_NAMES.buildStart]: (this: PluginContext, options: NormalizedInputOptions) => void;
835
835
  [DEFINED_HOOK_NAMES.resolveId]: (this: PluginContext, source: string, importer: string | undefined, extraOptions: ResolveIdExtraOptions) => ResolveIdResult;
836
836
  /**
@@ -844,7 +844,6 @@ interface FunctionPluginHooks {
844
844
  }) => TransformResult;
845
845
  [DEFINED_HOOK_NAMES.moduleParsed]: (this: PluginContext, moduleInfo: ModuleInfo) => void;
846
846
  [DEFINED_HOOK_NAMES.buildEnd]: (this: PluginContext, err?: Error) => void;
847
- // --- Generate hooks ---
848
847
  [DEFINED_HOOK_NAMES.renderStart]: (this: PluginContext, outputOptions: NormalizedOutputOptions, inputOptions: NormalizedInputOptions) => void;
849
848
  [DEFINED_HOOK_NAMES.renderChunk]: (this: PluginContext, code: string, chunk: RenderedChunk, outputOptions: NormalizedOutputOptions, meta: RenderedChunkMeta) => NullValue | string | {
850
849
  code: string;
@@ -855,7 +854,6 @@ interface FunctionPluginHooks {
855
854
  [DEFINED_HOOK_NAMES.generateBundle]: (this: PluginContext, outputOptions: NormalizedOutputOptions, bundle: OutputBundle, isWrite: boolean) => void;
856
855
  [DEFINED_HOOK_NAMES.writeBundle]: (this: PluginContext, outputOptions: NormalizedOutputOptions, bundle: OutputBundle) => void;
857
856
  [DEFINED_HOOK_NAMES.closeBundle]: (this: PluginContext) => void;
858
- // --- watch hooks ---
859
857
  [DEFINED_HOOK_NAMES.watchChange]: (this: PluginContext, id: string, event: {
860
858
  event: ChangeEvent;
861
859
  }) => void;
@@ -870,13 +868,8 @@ type ObjectHook<T, O = {}> = T | ({
870
868
  handler: T;
871
869
  } & ObjectHookMeta & O);
872
870
  type SyncPluginHooks = DefinedHookNames["augmentChunkHash" | "onLog" | "outputOptions"];
873
- // | 'renderDynamicImport'
874
- // | 'resolveFileUrl'
875
- // | 'resolveImportMeta'
876
871
  type AsyncPluginHooks = Exclude<keyof FunctionPluginHooks, SyncPluginHooks>;
877
872
  type FirstPluginHooks = DefinedHookNames["load" | "resolveDynamicImport" | "resolveId"];
878
- // | 'resolveImportMeta'
879
- // | 'shouldTransformCachedModule'
880
873
  type SequentialPluginHooks = DefinedHookNames["augmentChunkHash" | "generateBundle" | "onLog" | "options" | "outputOptions" | "renderChunk" | "transform"];
881
874
  type AddonHooks = DefinedHookNames["banner" | "footer" | "intro" | "outro"];
882
875
  type OutputPluginHooks = DefinedHookNames["augmentChunkHash" | "generateBundle" | "outputOptions" | "renderChunk" | "renderError" | "renderStart" | "writeBundle"];
@@ -903,11 +896,9 @@ type PluginHooks = { [K in keyof FunctionPluginHooks]: ObjectHook<K extends Asyn
903
896
  type AddonHookFunction = (this: PluginContext, chunk: RenderedChunk) => string | Promise<string>;
904
897
  type AddonHook = string | AddonHookFunction;
905
898
  interface OutputPlugin extends Partial<{ [K in OutputPluginHooks]: PluginHooks[K] }>, Partial<{ [K in AddonHooks]: ObjectHook<AddonHook> }> {
906
- // cacheKey?: string
907
899
  name: string;
908
900
  }
909
901
  interface Plugin<A = any> extends OutputPlugin, Partial<PluginHooks> {
910
- // for inter-plugin communication
911
902
  api?: A;
912
903
  }
913
904
  type RolldownPlugin<A = any> = Plugin<A> | BuiltinPlugin | ParallelPlugin;
@@ -920,8 +911,6 @@ type RolldownOutputPluginOption = MaybePromise<NullValue<RolldownOutputPlugin> |
920
911
  } | false | RolldownOutputPluginOption[]>;
921
912
  //#endregion
922
913
  //#region src/options/generated/checks-options.d.ts
923
- // Auto-generated code, DO NOT EDIT DIRECTLY!
924
- // To edit this generated file you have to edit `tasks/generator/src/generators/checks.rs`
925
914
  interface ChecksOptions {
926
915
  /**
927
916
  * Whether to emit warning when detecting circular dependency
@@ -982,7 +971,6 @@ interface ChecksOptions {
982
971
  //#endregion
983
972
  //#region src/options/input-options.d.ts
984
973
  type InputOption = string | string[] | Record<string, string>;
985
- // Omit those key that are part of rolldown option
986
974
  type OxcTransformOption = Omit<TransformOptions, "sourceType" | "lang" | "cwd" | "sourcemap" | "define" | "inject">;
987
975
  type ExternalOption = StringOrRegExp | StringOrRegExp[] | ((id: string, parentId: string | undefined, isResolved: boolean) => NullValue<boolean>);
988
976
  type ModuleTypes = Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | "css" | "asset">;
@@ -1002,7 +990,11 @@ type HmrOptions = boolean | {
1002
990
  port?: number;
1003
991
  implement?: string;
1004
992
  };
993
+ type OptimizationOptions = {
994
+ inlineConst?: boolean;
995
+ };
1005
996
  type AttachDebugOptions = "none" | "simple" | "full";
997
+ type ChunkModulesOrder = "exec-order" | "module-id";
1006
998
  interface RollupJsxOptions {
1007
999
  mode?: "classic" | "automatic" | "preserve";
1008
1000
  factory?: string;
@@ -1061,6 +1053,18 @@ interface InputOptions {
1061
1053
  resolveNewUrlToAsset?: boolean;
1062
1054
  hmr?: HmrOptions;
1063
1055
  /**
1056
+ * Control which order should use when rendering modules in chunk
1057
+ *
1058
+ * - Type: `'exec-order' | 'module-id'
1059
+ * - Default: `'exec-order'`
1060
+ *
1061
+ * - `exec-order`: Almost equivalent to the topological order of the module graph, but specially handling when module graph has cycle.
1062
+ * - `module-id`: This is more friendly for gzip compression, especially for some javascript static asset lib (e.g. icon library)
1063
+ * > [!NOTE]
1064
+ * > Try to sort the modules by their module id if possible(Since rolldown scope hoist all modules in the chunk, we only try to sort those modules by module id if we could ensure runtime behavior is correct after sorting).
1065
+ */
1066
+ chunkModulesOrder?: ChunkModulesOrder;
1067
+ /**
1064
1068
  * Attach debug information to the output bundle.
1065
1069
  *
1066
1070
  * - Type: `'none' | 'simple' | 'full'`
@@ -1183,6 +1187,7 @@ interface InputOptions {
1183
1187
  sessionId?: string;
1184
1188
  };
1185
1189
  preserveEntrySignatures?: false | "strict" | "allow-extension" | "exports-only";
1190
+ optimization?: OptimizationOptions;
1186
1191
  }
1187
1192
  //#endregion
1188
1193
  //#region src/types/rolldown-options.d.ts
@@ -1201,4 +1206,4 @@ declare function defineConfig(config: RolldownOptions): RolldownOptions;
1201
1206
  declare function defineConfig(config: RolldownOptions[]): RolldownOptions[];
1202
1207
  declare function defineConfig(config: ConfigExport): ConfigExport;
1203
1208
  //#endregion
1204
- export { AddonFunction, AsyncPluginHooks, BuildOptions, BuiltinPlugin, ChunkFileNamesFunction, ChunkingContext, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MaybePromise, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, ModuleTypes, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, assetPlugin, build, buildImportAnalysisPlugin, defineConfig, defineParallelPlugin, dynamicImportVarsPlugin, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, reporterPlugin, rolldown, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch, webWorkerPostPlugin, withFilter };
1209
+ export { AddonFunction, AsyncPluginHooks, BuildOptions, BuiltinPlugin, ChunkFileNamesFunction, ChunkingContext, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MaybePromise, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, ModuleTypes, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OptimizationOptions, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, assetPlugin, build, buildImportAnalysisPlugin, defineConfig, defineParallelPlugin, dynamicImportVarsPlugin, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, reporterPlugin, rolldown, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch, webWorkerPostPlugin, withFilter };
@@ -1,6 +1,6 @@
1
- import { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingBuiltinPluginName, BindingBundlerImpl, BindingDynamicImportVarsPluginConfig, BindingHmrOutputPatch, BindingHookResolveIdExtraArgs, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingMfManifest, BindingMinifyOptions, BindingModuleFederationPluginOption, BindingModulePreloadPolyfillPluginConfig, BindingRemote, BindingRenderedChunk, BindingReporterPluginConfig, BindingTransformHookExtraArgs, BindingViteResolvePluginConfig, BindingWasmHelperPluginConfig, BindingWatcherEvent, ParserOptions, PreRenderedChunk, TransformOptions } from "./binding-DB58iXP8.mjs";
2
- import { TopLevelFilterExpression } from "@rolldown/pluginutils";
1
+ import { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingBuiltinPluginName, BindingBundlerImpl, BindingDynamicImportVarsPluginConfig, BindingHmrOutputPatch, BindingHookResolveIdExtraArgs, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingMfManifest, BindingMinifyOptions, BindingModuleFederationPluginOption, BindingModulePreloadPolyfillPluginConfig, BindingRemote, BindingRenderedChunk, BindingReporterPluginConfig, BindingTransformHookExtraArgs, BindingViteResolvePluginConfig, BindingWasmHelperPluginConfig, BindingWatcherEvent, ParserOptions, PreRenderedChunk, TransformOptions } from "./binding-B9-3a5q4.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";
@@ -426,6 +426,14 @@ interface OutputOptions {
426
426
  preserveModules?: boolean;
427
427
  virtualDirname?: string;
428
428
  preserveModulesRoot?: string;
429
+ topLevelVar?: boolean;
430
+ /**
431
+ * - Type: `boolean`
432
+ * - Default: `false`
433
+ *
434
+ * Whether to minify internal exports.
435
+ */
436
+ minifyInternalExports?: boolean;
429
437
  }
430
438
  //#endregion
431
439
  //#region src/api/build.d.ts
@@ -453,16 +461,12 @@ declare class RolldownBuild {
453
461
  write(outputOptions?: OutputOptions): Promise<RolldownOutput>;
454
462
  close(): Promise<void>;
455
463
  [Symbol.asyncDispose](): Promise<void>;
456
- generateHmrPatch(changedFiles: string[]): Promise<BindingHmrOutputPatch>;
464
+ generateHmrPatch(changedFiles: string[]): Promise<BindingHmrOutputPatch | undefined>;
457
465
  hmrInvalidate(file: string, firstInvalidatedBy?: string): Promise<BindingHmrOutputPatch>;
458
- // TODO(underfin)
459
- // The `watchFiles` method returns a promise, but Rollup does not.
460
- // Converting it to a synchronous API might cause a deadlock if the user calls `write` and `watchFiles` simultaneously.
461
466
  get watchFiles(): Promise<string[]>;
462
467
  }
463
468
  //#endregion
464
469
  //#region src/api/rolldown/index.d.ts
465
- // `async` here is intentional to be compatible with `rollup.rollup`.
466
470
  declare const rolldown: (input: InputOptions) => Promise<RolldownBuild>;
467
471
  //#endregion
468
472
  //#region src/options/watch-options.d.ts
@@ -473,7 +477,6 @@ interface WatchOptions extends InputOptions {
473
477
  //#region src/api/watch/watch-emitter.d.ts
474
478
  type WatcherEvent = "close" | "event" | "restart" | "change";
475
479
  type ChangeEvent$1 = "create" | "update" | "delete";
476
- // TODO: find a way use `RolldownBuild` instead of `Bundler`.
477
480
  type RolldownWatchBuild = BindingBundlerImpl;
478
481
  type RolldownWatcherEvent = {
479
482
  code: "START";
@@ -482,7 +485,6 @@ type RolldownWatcherEvent = {
482
485
  } | {
483
486
  code: "BUNDLE_END";
484
487
  duration: number;
485
- // input?: InputOption
486
488
  output: readonly string[];
487
489
  result: RolldownWatchBuild;
488
490
  } | {
@@ -508,7 +510,6 @@ declare class WatcherEmitter {
508
510
  type RolldownWatcher = WatcherEmitter;
509
511
  //#endregion
510
512
  //#region src/api/watch/index.d.ts
511
- // Compat to `rollup.watch`
512
513
  declare const watch: (input: WatchOptions | WatchOptions[]) => RolldownWatcher;
513
514
  //#endregion
514
515
  //#region src/log/log-handler.d.ts
@@ -526,7 +527,6 @@ interface NormalizedInputOptions {
526
527
  platform: InputOptions["platform"];
527
528
  shimMissingExports: boolean;
528
529
  }
529
- // TODO: I guess we make these getters enumerable so it act more like a plain object
530
530
  //#endregion
531
531
  //#region src/options/normalized-output-options.d.ts
532
532
  type InternalModuleFormat = "es" | "cjs" | "iife" | "umd";
@@ -562,8 +562,9 @@ interface NormalizedOutputOptions {
562
562
  preserveModules: boolean;
563
563
  virtualDirname: string;
564
564
  preserveModulesRoot?: string;
565
+ topLevelVar?: boolean;
566
+ minifyInternalExports?: boolean;
565
567
  }
566
- // TODO: I guess we make these getters enumerable so it act more like a plain object
567
568
  //#endregion
568
569
  //#region src/plugin/hook-filter.d.ts
569
570
  type GeneralHookFilter<Value = StringOrRegExp> = MaybeArray<Value> | {
@@ -657,6 +658,7 @@ interface EmittedChunk {
657
658
  }
658
659
  type EmittedFile = EmittedAsset | EmittedChunk;
659
660
  interface PluginContextResolveOptions {
661
+ isEntry?: boolean;
660
662
  skipSelf?: boolean;
661
663
  custom?: CustomPluginOptions;
662
664
  }
@@ -726,12 +728,15 @@ declare const VERSION: string;
726
728
  //#region src/builtin-plugin/constructors.d.ts
727
729
  declare class BuiltinPlugin {
728
730
  name: BindingBuiltinPluginName;
729
- // NOTE: has `_` to avoid conflict with `options` hook
730
731
  _options?: unknown;
731
732
  constructor(name: BindingBuiltinPluginName, _options?: unknown);
732
733
  }
733
734
  declare function modulePreloadPolyfillPlugin(config?: BindingModulePreloadPolyfillPluginConfig): BuiltinPlugin;
734
- declare function dynamicImportVarsPlugin(config?: BindingDynamicImportVarsPluginConfig): BuiltinPlugin;
735
+ type DynamicImportVarsPluginConfig = Omit<BindingDynamicImportVarsPluginConfig, "include" | "exclude"> & {
736
+ include?: StringOrRegExp | StringOrRegExp[];
737
+ exclude?: StringOrRegExp | StringOrRegExp[];
738
+ };
739
+ declare function dynamicImportVarsPlugin(config?: DynamicImportVarsPluginConfig): BuiltinPlugin;
735
740
  declare function importGlobPlugin(config?: BindingImportGlobPluginConfig): BuiltinPlugin;
736
741
  declare function reporterPlugin(config?: BindingReporterPluginConfig): BuiltinPlugin;
737
742
  declare function manifestPlugin(config?: BindingManifestPluginConfig): BuiltinPlugin;
@@ -788,7 +793,6 @@ declare function withFilter<A, T extends RolldownPluginOption<A>>(pluginOption:
788
793
  //#endregion
789
794
  //#region src/plugin/index.d.ts
790
795
  type ModuleSideEffects = boolean | "no-treeshake" | null;
791
- // ref: https://github.com/microsoft/TypeScript/issues/33471#issuecomment-1376364329
792
796
  type ModuleType = "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | (string & {});
793
797
  type ImportKind = BindingHookResolveIdExtraArgs["kind"];
794
798
  interface CustomPluginOptions {
@@ -797,8 +801,6 @@ interface CustomPluginOptions {
797
801
  interface ModuleOptions {
798
802
  moduleSideEffects: ModuleSideEffects;
799
803
  meta: CustomPluginOptions;
800
- // flag used to check if user directly modified the `ModuleInfo`
801
- // this is used to sync state between rust and js
802
804
  invalidate?: boolean;
803
805
  }
804
806
  interface ResolvedId extends ModuleOptions {
@@ -828,9 +830,7 @@ type RenderedChunkMeta = {
828
830
  interface FunctionPluginHooks {
829
831
  [DEFINED_HOOK_NAMES.onLog]: (this: MinimalPluginContext, level: LogLevel, log: RollupLog) => NullValue | boolean;
830
832
  [DEFINED_HOOK_NAMES.options]: (this: MinimalPluginContext, options: InputOptions) => NullValue | InputOptions;
831
- // TODO find a way to make `this: PluginContext` work.
832
833
  [DEFINED_HOOK_NAMES.outputOptions]: (this: MinimalPluginContext, options: OutputOptions) => NullValue | OutputOptions;
833
- // --- Build hooks ---
834
834
  [DEFINED_HOOK_NAMES.buildStart]: (this: PluginContext, options: NormalizedInputOptions) => void;
835
835
  [DEFINED_HOOK_NAMES.resolveId]: (this: PluginContext, source: string, importer: string | undefined, extraOptions: ResolveIdExtraOptions) => ResolveIdResult;
836
836
  /**
@@ -844,7 +844,6 @@ interface FunctionPluginHooks {
844
844
  }) => TransformResult;
845
845
  [DEFINED_HOOK_NAMES.moduleParsed]: (this: PluginContext, moduleInfo: ModuleInfo) => void;
846
846
  [DEFINED_HOOK_NAMES.buildEnd]: (this: PluginContext, err?: Error) => void;
847
- // --- Generate hooks ---
848
847
  [DEFINED_HOOK_NAMES.renderStart]: (this: PluginContext, outputOptions: NormalizedOutputOptions, inputOptions: NormalizedInputOptions) => void;
849
848
  [DEFINED_HOOK_NAMES.renderChunk]: (this: PluginContext, code: string, chunk: RenderedChunk, outputOptions: NormalizedOutputOptions, meta: RenderedChunkMeta) => NullValue | string | {
850
849
  code: string;
@@ -855,7 +854,6 @@ interface FunctionPluginHooks {
855
854
  [DEFINED_HOOK_NAMES.generateBundle]: (this: PluginContext, outputOptions: NormalizedOutputOptions, bundle: OutputBundle, isWrite: boolean) => void;
856
855
  [DEFINED_HOOK_NAMES.writeBundle]: (this: PluginContext, outputOptions: NormalizedOutputOptions, bundle: OutputBundle) => void;
857
856
  [DEFINED_HOOK_NAMES.closeBundle]: (this: PluginContext) => void;
858
- // --- watch hooks ---
859
857
  [DEFINED_HOOK_NAMES.watchChange]: (this: PluginContext, id: string, event: {
860
858
  event: ChangeEvent;
861
859
  }) => void;
@@ -870,13 +868,8 @@ type ObjectHook<T, O = {}> = T | ({
870
868
  handler: T;
871
869
  } & ObjectHookMeta & O);
872
870
  type SyncPluginHooks = DefinedHookNames["augmentChunkHash" | "onLog" | "outputOptions"];
873
- // | 'renderDynamicImport'
874
- // | 'resolveFileUrl'
875
- // | 'resolveImportMeta'
876
871
  type AsyncPluginHooks = Exclude<keyof FunctionPluginHooks, SyncPluginHooks>;
877
872
  type FirstPluginHooks = DefinedHookNames["load" | "resolveDynamicImport" | "resolveId"];
878
- // | 'resolveImportMeta'
879
- // | 'shouldTransformCachedModule'
880
873
  type SequentialPluginHooks = DefinedHookNames["augmentChunkHash" | "generateBundle" | "onLog" | "options" | "outputOptions" | "renderChunk" | "transform"];
881
874
  type AddonHooks = DefinedHookNames["banner" | "footer" | "intro" | "outro"];
882
875
  type OutputPluginHooks = DefinedHookNames["augmentChunkHash" | "generateBundle" | "outputOptions" | "renderChunk" | "renderError" | "renderStart" | "writeBundle"];
@@ -903,11 +896,9 @@ type PluginHooks = { [K in keyof FunctionPluginHooks]: ObjectHook<K extends Asyn
903
896
  type AddonHookFunction = (this: PluginContext, chunk: RenderedChunk) => string | Promise<string>;
904
897
  type AddonHook = string | AddonHookFunction;
905
898
  interface OutputPlugin extends Partial<{ [K in OutputPluginHooks]: PluginHooks[K] }>, Partial<{ [K in AddonHooks]: ObjectHook<AddonHook> }> {
906
- // cacheKey?: string
907
899
  name: string;
908
900
  }
909
901
  interface Plugin<A = any> extends OutputPlugin, Partial<PluginHooks> {
910
- // for inter-plugin communication
911
902
  api?: A;
912
903
  }
913
904
  type RolldownPlugin<A = any> = Plugin<A> | BuiltinPlugin | ParallelPlugin;
@@ -920,8 +911,6 @@ type RolldownOutputPluginOption = MaybePromise<NullValue<RolldownOutputPlugin> |
920
911
  } | false | RolldownOutputPluginOption[]>;
921
912
  //#endregion
922
913
  //#region src/options/generated/checks-options.d.ts
923
- // Auto-generated code, DO NOT EDIT DIRECTLY!
924
- // To edit this generated file you have to edit `tasks/generator/src/generators/checks.rs`
925
914
  interface ChecksOptions {
926
915
  /**
927
916
  * Whether to emit warning when detecting circular dependency
@@ -982,7 +971,6 @@ interface ChecksOptions {
982
971
  //#endregion
983
972
  //#region src/options/input-options.d.ts
984
973
  type InputOption = string | string[] | Record<string, string>;
985
- // Omit those key that are part of rolldown option
986
974
  type OxcTransformOption = Omit<TransformOptions, "sourceType" | "lang" | "cwd" | "sourcemap" | "define" | "inject">;
987
975
  type ExternalOption = StringOrRegExp | StringOrRegExp[] | ((id: string, parentId: string | undefined, isResolved: boolean) => NullValue<boolean>);
988
976
  type ModuleTypes = Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | "css" | "asset">;
@@ -1002,7 +990,11 @@ type HmrOptions = boolean | {
1002
990
  port?: number;
1003
991
  implement?: string;
1004
992
  };
993
+ type OptimizationOptions = {
994
+ inlineConst?: boolean;
995
+ };
1005
996
  type AttachDebugOptions = "none" | "simple" | "full";
997
+ type ChunkModulesOrder = "exec-order" | "module-id";
1006
998
  interface RollupJsxOptions {
1007
999
  mode?: "classic" | "automatic" | "preserve";
1008
1000
  factory?: string;
@@ -1061,6 +1053,18 @@ interface InputOptions {
1061
1053
  resolveNewUrlToAsset?: boolean;
1062
1054
  hmr?: HmrOptions;
1063
1055
  /**
1056
+ * Control which order should use when rendering modules in chunk
1057
+ *
1058
+ * - Type: `'exec-order' | 'module-id'
1059
+ * - Default: `'exec-order'`
1060
+ *
1061
+ * - `exec-order`: Almost equivalent to the topological order of the module graph, but specially handling when module graph has cycle.
1062
+ * - `module-id`: This is more friendly for gzip compression, especially for some javascript static asset lib (e.g. icon library)
1063
+ * > [!NOTE]
1064
+ * > Try to sort the modules by their module id if possible(Since rolldown scope hoist all modules in the chunk, we only try to sort those modules by module id if we could ensure runtime behavior is correct after sorting).
1065
+ */
1066
+ chunkModulesOrder?: ChunkModulesOrder;
1067
+ /**
1064
1068
  * Attach debug information to the output bundle.
1065
1069
  *
1066
1070
  * - Type: `'none' | 'simple' | 'full'`
@@ -1183,6 +1187,7 @@ interface InputOptions {
1183
1187
  sessionId?: string;
1184
1188
  };
1185
1189
  preserveEntrySignatures?: false | "strict" | "allow-extension" | "exports-only";
1190
+ optimization?: OptimizationOptions;
1186
1191
  }
1187
1192
  //#endregion
1188
1193
  //#region src/types/rolldown-options.d.ts
@@ -1201,4 +1206,4 @@ declare function defineConfig(config: RolldownOptions): RolldownOptions;
1201
1206
  declare function defineConfig(config: RolldownOptions[]): RolldownOptions[];
1202
1207
  declare function defineConfig(config: ConfigExport): ConfigExport;
1203
1208
  //#endregion
1204
- export { AddonFunction, AsyncPluginHooks, BuildOptions, BuiltinPlugin, ChunkFileNamesFunction, ChunkingContext, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MaybePromise, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, ModuleTypes, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, assetPlugin, build, buildImportAnalysisPlugin, defineConfig, defineParallelPlugin, dynamicImportVarsPlugin, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, reporterPlugin, rolldown, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch, webWorkerPostPlugin, withFilter };
1209
+ export { AddonFunction, AsyncPluginHooks, BuildOptions, BuiltinPlugin, ChunkFileNamesFunction, ChunkingContext, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MaybePromise, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, ModuleTypes, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OptimizationOptions, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, assetPlugin, build, buildImportAnalysisPlugin, defineConfig, defineParallelPlugin, dynamicImportVarsPlugin, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, reporterPlugin, rolldown, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch, webWorkerPostPlugin, withFilter };
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require('./chunk-DDkG_k5U.cjs');
2
- const require_src = require('./src-D6QrbVqq.cjs');
2
+ const require_src = require('./src-CKVDAG8j.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"));
@@ -1,4 +1,4 @@
1
- import { rolldown } from "./src-DgdMNl-3.mjs";
1
+ import { rolldown } from "./src-BS7SHs-K.mjs";
2
2
  import fs from "node:fs";
3
3
  import path from "node:path";
4
4
  import { pathToFileURL } from "node:url";
@@ -326,7 +326,7 @@ if (!nativeBinding) {
326
326
  if (loadErrors.length > 0) throw new Error("Cannot find native binding. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.", { cause: loadErrors });
327
327
  throw new Error(`Failed to load native binding`);
328
328
  }
329
- const { Severity, ParseResult, ExportExportNameKind, ExportImportNameKind, ExportLocalNameKind, getBufferOffset, ImportNameKind, parseAsync, parseAsyncRaw, parseSync, parseSyncRaw, rawTransferSupported, ResolverFactory, EnforceExtension, ModuleType, sync, HelperMode, isolatedDeclaration, moduleRunnerTransform, transform, BindingBundleEndEventData, BindingBundleErrorEventData, BindingBundler, BindingBundlerImpl, BindingCallableBuiltinPlugin, BindingChunkingContext, BindingError, BindingHmrOutput, BindingModuleInfo, BindingNormalizedOptions, BindingOutputAsset, BindingOutputChunk, BindingOutputs, BindingPluginContext, BindingRenderedChunk, BindingRenderedChunkMeta, BindingRenderedModule, BindingTransformPluginContext, BindingWatcher, BindingWatcherChangeData, BindingWatcherEvent, ParallelJsPluginRegistry, BindingAttachDebugInfo, BindingBuiltinPluginName, BindingHookSideEffects, BindingJsx, BindingLogLevel, BindingPluginOrder, FilterTokenKind, registerPlugins, shutdownAsyncRuntime, startAsyncRuntime } = nativeBinding;
329
+ const { Severity, ParseResult, ExportExportNameKind, ExportImportNameKind, ExportLocalNameKind, ImportNameKind, parseAsync, parseSync, rawTransferSupported, ResolverFactory, EnforceExtension, ModuleType, sync, HelperMode, isolatedDeclaration, moduleRunnerTransform, transform, BindingBundleEndEventData, BindingBundleErrorEventData, BindingBundler, BindingBundlerImpl, BindingCallableBuiltinPlugin, BindingChunkingContext, BindingError, BindingHmrOutput, BindingModuleInfo, BindingNormalizedOptions, BindingOutputAsset, BindingOutputChunk, BindingOutputs, BindingPluginContext, BindingRenderedChunk, BindingRenderedChunkMeta, BindingRenderedModule, BindingTransformPluginContext, BindingWatcher, BindingWatcherChangeData, BindingWatcherEvent, ParallelJsPluginRegistry, BindingAttachDebugInfo, BindingBuiltinPluginName, BindingChunkModuleOrderBy, BindingJsx, BindingLogLevel, BindingPluginOrder, FilterTokenKind, registerPlugins, shutdownAsyncRuntime, startAsyncRuntime } = nativeBinding;
330
330
 
331
331
  //#endregion
332
332
  //#region src/utils/code-frame.ts
@@ -430,7 +430,7 @@ function locate(source, search, options) {
430
430
 
431
431
  //#endregion
432
432
  //#region src/log/logs.ts
433
- const INVALID_LOG_POSITION = "INVALID_LOG_POSITION", PLUGIN_ERROR = "PLUGIN_ERROR", INPUT_HOOK_IN_OUTPUT_PLUGIN = "INPUT_HOOK_IN_OUTPUT_PLUGIN", CYCLE_LOADING = "CYCLE_LOADING", MULTIPLY_NOTIFY_OPTION = "MULTIPLY_NOTIFY_OPTION", PARSE_ERROR = "PARSE_ERROR";
433
+ const INVALID_LOG_POSITION = "INVALID_LOG_POSITION", PLUGIN_ERROR = "PLUGIN_ERROR", INPUT_HOOK_IN_OUTPUT_PLUGIN = "INPUT_HOOK_IN_OUTPUT_PLUGIN", CYCLE_LOADING = "CYCLE_LOADING", MULTIPLY_NOTIFY_OPTION = "MULTIPLY_NOTIFY_OPTION", PARSE_ERROR = "PARSE_ERROR", DUPLICATE_JSX_CONFIG = "DUPLICATE_JSX_CONFIG";
434
434
  function logParseError(message) {
435
435
  return {
436
436
  code: PARSE_ERROR,
@@ -461,6 +461,12 @@ function logMultiplyNotifyOption() {
461
461
  message: `Found multiply notify option at watch options, using first one to start notify watcher.`
462
462
  };
463
463
  }
464
+ function logDuplicateJsxConfig() {
465
+ return {
466
+ code: DUPLICATE_JSX_CONFIG,
467
+ message: "Both `options.jsx` and `options.transform.jsx` are set so `options.jsx` is ignored"
468
+ };
469
+ }
464
470
  function logPluginError(error$1, plugin, { hook, id } = {}) {
465
471
  try {
466
472
  const code = error$1.code;
@@ -509,7 +515,7 @@ function augmentCodeLocation(properties, pos, source, id) {
509
515
  }
510
516
 
511
517
  //#endregion
512
- //#region ../../node_modules/.pnpm/oxc-parser@0.75.0/node_modules/oxc-parser/wrap.mjs
518
+ //#region ../../node_modules/.pnpm/oxc-parser@0.76.0/node_modules/oxc-parser/wrap.mjs
513
519
  function wrap$1(result) {
514
520
  let program, module$1, comments, errors;
515
521
  return {
@@ -604,10 +610,10 @@ Object.defineProperty(exports, 'BindingCallableBuiltinPlugin', {
604
610
  return BindingCallableBuiltinPlugin;
605
611
  }
606
612
  });
607
- Object.defineProperty(exports, 'BindingHookSideEffects', {
613
+ Object.defineProperty(exports, 'BindingChunkModuleOrderBy', {
608
614
  enumerable: true,
609
615
  get: function () {
610
- return BindingHookSideEffects;
616
+ return BindingChunkModuleOrderBy;
611
617
  }
612
618
  });
613
619
  Object.defineProperty(exports, 'BindingJsx', {
@@ -670,6 +676,12 @@ Object.defineProperty(exports, 'logCycleLoading', {
670
676
  return logCycleLoading;
671
677
  }
672
678
  });
679
+ Object.defineProperty(exports, 'logDuplicateJsxConfig', {
680
+ enumerable: true,
681
+ get: function () {
682
+ return logDuplicateJsxConfig;
683
+ }
684
+ });
673
685
  Object.defineProperty(exports, 'logInputHookInOutputPlugin', {
674
686
  enumerable: true,
675
687
  get: function () {
@@ -353,7 +353,7 @@ if (!nativeBinding) {
353
353
  if (loadErrors.length > 0) throw new Error("Cannot find native binding. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.", { cause: loadErrors });
354
354
  throw new Error(`Failed to load native binding`);
355
355
  }
356
- const { Severity, ParseResult, ExportExportNameKind, ExportImportNameKind, ExportLocalNameKind, getBufferOffset, ImportNameKind, parseAsync, parseAsyncRaw, parseSync, parseSyncRaw, rawTransferSupported, ResolverFactory, EnforceExtension, ModuleType, sync, HelperMode, isolatedDeclaration, moduleRunnerTransform, transform, BindingBundleEndEventData, BindingBundleErrorEventData, BindingBundler, BindingBundlerImpl, BindingCallableBuiltinPlugin, BindingChunkingContext, BindingError, BindingHmrOutput, BindingModuleInfo, BindingNormalizedOptions, BindingOutputAsset, BindingOutputChunk, BindingOutputs, BindingPluginContext, BindingRenderedChunk, BindingRenderedChunkMeta, BindingRenderedModule, BindingTransformPluginContext, BindingWatcher, BindingWatcherChangeData, BindingWatcherEvent, ParallelJsPluginRegistry, BindingAttachDebugInfo, BindingBuiltinPluginName, BindingHookSideEffects, BindingJsx, BindingLogLevel, BindingPluginOrder, FilterTokenKind, registerPlugins, shutdownAsyncRuntime, startAsyncRuntime } = nativeBinding;
356
+ const { Severity, ParseResult, ExportExportNameKind, ExportImportNameKind, ExportLocalNameKind, ImportNameKind, parseAsync, parseSync, rawTransferSupported, ResolverFactory, EnforceExtension, ModuleType, sync, HelperMode, isolatedDeclaration, moduleRunnerTransform, transform, BindingBundleEndEventData, BindingBundleErrorEventData, BindingBundler, BindingBundlerImpl, BindingCallableBuiltinPlugin, BindingChunkingContext, BindingError, BindingHmrOutput, BindingModuleInfo, BindingNormalizedOptions, BindingOutputAsset, BindingOutputChunk, BindingOutputs, BindingPluginContext, BindingRenderedChunk, BindingRenderedChunkMeta, BindingRenderedModule, BindingTransformPluginContext, BindingWatcher, BindingWatcherChangeData, BindingWatcherEvent, ParallelJsPluginRegistry, BindingAttachDebugInfo, BindingBuiltinPluginName, BindingChunkModuleOrderBy, BindingJsx, BindingLogLevel, BindingPluginOrder, FilterTokenKind, registerPlugins, shutdownAsyncRuntime, startAsyncRuntime } = nativeBinding;
357
357
 
358
358
  //#endregion
359
359
  //#region src/utils/code-frame.ts
@@ -457,7 +457,7 @@ function locate(source, search, options) {
457
457
 
458
458
  //#endregion
459
459
  //#region src/log/logs.ts
460
- const INVALID_LOG_POSITION = "INVALID_LOG_POSITION", PLUGIN_ERROR = "PLUGIN_ERROR", INPUT_HOOK_IN_OUTPUT_PLUGIN = "INPUT_HOOK_IN_OUTPUT_PLUGIN", CYCLE_LOADING = "CYCLE_LOADING", MULTIPLY_NOTIFY_OPTION = "MULTIPLY_NOTIFY_OPTION", PARSE_ERROR = "PARSE_ERROR";
460
+ const INVALID_LOG_POSITION = "INVALID_LOG_POSITION", PLUGIN_ERROR = "PLUGIN_ERROR", INPUT_HOOK_IN_OUTPUT_PLUGIN = "INPUT_HOOK_IN_OUTPUT_PLUGIN", CYCLE_LOADING = "CYCLE_LOADING", MULTIPLY_NOTIFY_OPTION = "MULTIPLY_NOTIFY_OPTION", PARSE_ERROR = "PARSE_ERROR", DUPLICATE_JSX_CONFIG = "DUPLICATE_JSX_CONFIG";
461
461
  function logParseError(message) {
462
462
  return {
463
463
  code: PARSE_ERROR,
@@ -488,6 +488,12 @@ function logMultiplyNotifyOption() {
488
488
  message: `Found multiply notify option at watch options, using first one to start notify watcher.`
489
489
  };
490
490
  }
491
+ function logDuplicateJsxConfig() {
492
+ return {
493
+ code: DUPLICATE_JSX_CONFIG,
494
+ message: "Both `options.jsx` and `options.transform.jsx` are set so `options.jsx` is ignored"
495
+ };
496
+ }
491
497
  function logPluginError(error$1, plugin, { hook, id } = {}) {
492
498
  try {
493
499
  const code = error$1.code;
@@ -536,7 +542,7 @@ function augmentCodeLocation(properties, pos, source, id) {
536
542
  }
537
543
 
538
544
  //#endregion
539
- //#region ../../node_modules/.pnpm/oxc-parser@0.75.0/node_modules/oxc-parser/wrap.mjs
545
+ //#region ../../node_modules/.pnpm/oxc-parser@0.76.0/node_modules/oxc-parser/wrap.mjs
540
546
  function wrap$1(result) {
541
547
  let program, module$1, comments, errors;
542
548
  return {
@@ -613,4 +619,4 @@ async function parseAstAsync(sourceText, options, filename) {
613
619
  }
614
620
 
615
621
  //#endregion
616
- export { BindingAttachDebugInfo, BindingBundler, BindingCallableBuiltinPlugin, BindingHookSideEffects, BindingJsx, BindingLogLevel, BindingPluginOrder, BindingWatcher, ParallelJsPluginRegistry, ResolverFactory, __commonJS, __toESM, augmentCodeLocation, error, isolatedDeclaration, logCycleLoading, logInputHookInOutputPlugin, logInvalidLogPosition, logMultiplyNotifyOption, logPluginError, moduleRunnerTransform, parseAst, parseAstAsync, registerPlugins, shutdownAsyncRuntime, startAsyncRuntime, transform };
622
+ export { BindingAttachDebugInfo, BindingBundler, BindingCallableBuiltinPlugin, BindingChunkModuleOrderBy, BindingJsx, BindingLogLevel, BindingPluginOrder, BindingWatcher, ParallelJsPluginRegistry, ResolverFactory, __commonJS, __toESM, augmentCodeLocation, error, isolatedDeclaration, logCycleLoading, logDuplicateJsxConfig, logInputHookInOutputPlugin, logInvalidLogPosition, logMultiplyNotifyOption, logPluginError, moduleRunnerTransform, parseAst, parseAstAsync, registerPlugins, shutdownAsyncRuntime, startAsyncRuntime, transform };