@rolldown/browser 1.0.0-beta.29-commit.fe1bea3 → 1.0.0-beta.30

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 (41) hide show
  1. package/dist/cli.cjs +8 -8
  2. package/dist/cli.mjs +8 -8
  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 +2 -2
  8. package/dist/experimental-index.cjs +2 -3
  9. package/dist/experimental-index.d.cts +3 -3
  10. package/dist/experimental-index.d.mts +3 -3
  11. package/dist/experimental-index.mjs +3 -3
  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 +3 -3
  17. package/dist/index.d.mts +3 -3
  18. package/dist/index.mjs +2 -2
  19. package/dist/parallel-plugin-worker.cjs +2 -2
  20. package/dist/parallel-plugin-worker.mjs +2 -2
  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 +0 -1
  28. package/dist/rolldown-binding.wasi.cjs +0 -1
  29. package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
  30. package/dist/shared/{binding-BO7hG1pA.d.mts → binding-BAyrv67G.d.cts} +29 -45
  31. package/dist/shared/{binding-D1lW862e.d.cts → binding-DUz1Q2JW.d.mts} +29 -45
  32. package/dist/shared/{define-config-CKxZwWu_.d.mts → define-config-5ALh7WDx.d.mts} +67 -9
  33. package/dist/shared/{define-config-O6TCZLYU.d.cts → define-config-CMH1jWhX.d.cts} +67 -9
  34. package/dist/shared/{load-config-C2Df0pqb.mjs → load-config-Uk19Sezh.mjs} +2 -2
  35. package/dist/shared/{load-config-CPJ15pW3.cjs → load-config-XQT0YfAt.cjs} +2 -2
  36. package/dist/shared/{parse-ast-index-rwZvDBjW.mjs → parse-ast-index-Z-sG_A0I.mjs} +2 -2
  37. package/dist/shared/{parse-ast-index-CLjgl4c8.cjs → parse-ast-index-ZiMOspE_.cjs} +2 -2
  38. package/dist/shared/{src-BLxfrK6S.cjs → src-CXCXfLrc.cjs} +88 -136
  39. package/dist/shared/{src-BWVOVy_u.mjs → src-CkG0t1KT.mjs} +89 -131
  40. package/dist/{src-CVDDqNxL.js → src-DGzv-S-Z.js} +57 -46
  41. package/package.json +2 -2
@@ -1077,15 +1077,11 @@ declare class BindingBundlerImpl {
1077
1077
  close(): Promise<void>;
1078
1078
  get closed(): boolean;
1079
1079
  getWatchFiles(): Promise<Array<string>>;
1080
- generateHmrPatch(changedFiles: Array<string>): Promise<BindingHmrOutput>;
1081
- hmrInvalidate(file: string, firstInvalidatedBy?: string | undefined | null): Promise<BindingHmrOutput>;
1082
- }
1083
- declare class BindingError {
1084
- kind: string;
1085
- message: string;
1080
+ generateHmrPatch(changedFiles: Array<string>): Promise<BindingGenerateHmrPatchReturn>;
1081
+ hmrInvalidate(caller: string, firstInvalidatedBy?: string | undefined | null): Promise<BindingHmrOutput>;
1086
1082
  }
1087
1083
  declare class BindingHmrOutput {
1088
- get patch(): BindingHmrOutputPatch | null;
1084
+ get patch(): BindingHmrUpdate | null;
1089
1085
  get errors(): Array<Error | BindingError>;
1090
1086
  }
1091
1087
  declare class BindingOutputAsset {
@@ -1145,10 +1141,12 @@ declare class BindingWatcherEvent {
1145
1141
  bundleErrorData(): BindingBundleErrorEventData;
1146
1142
  }
1147
1143
  interface BindingAssetPluginConfig {
1148
- isServer?: boolean;
1144
+ isLib?: boolean;
1149
1145
  urlBase?: string;
1150
1146
  publicDir?: string;
1147
+ isSkipAssets?: boolean;
1151
1148
  assetsInclude?: Array<BindingStringOrRegex>;
1149
+ assetInlineLimit?: number;
1152
1150
  }
1153
1151
  interface BindingAssetSource {
1154
1152
  inner: string | Uint8Array;
@@ -1160,27 +1158,40 @@ interface BindingBuildImportAnalysisPluginConfig {
1160
1158
  renderBuiltUrl: boolean;
1161
1159
  isRelativeBase: boolean;
1162
1160
  }
1163
- 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-federation' | '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';
1161
+ 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';
1164
1162
  interface BindingDynamicImportVarsPluginConfig {
1165
1163
  include?: Array<BindingStringOrRegex>;
1166
1164
  exclude?: Array<BindingStringOrRegex>;
1167
1165
  resolver?: (id: string, importer: string) => MaybePromise<string | undefined>;
1168
1166
  }
1167
+ interface BindingError {
1168
+ kind: string;
1169
+ message: string;
1170
+ }
1171
+ type BindingGenerateHmrPatchReturn = {
1172
+ type: 'Ok';
1173
+ field0: Array<BindingHmrUpdate>;
1174
+ } | {
1175
+ type: 'Error';
1176
+ field0: Array<Error | BindingError>;
1177
+ };
1169
1178
  interface BindingHmrBoundaryOutput {
1170
1179
  boundary: string;
1171
1180
  acceptedVia: string;
1172
1181
  }
1173
- interface BindingHmrOutputPatch {
1182
+ type BindingHmrUpdate = {
1183
+ type: 'Patch';
1174
1184
  code: string;
1175
1185
  filename: string;
1176
1186
  sourcemap?: string;
1177
1187
  sourcemapFilename?: string;
1178
1188
  hmrBoundaries: Array<BindingHmrBoundaryOutput>;
1179
- fullReload: boolean;
1180
- firstInvalidatedBy?: string;
1181
- isSelfAccepting: boolean;
1182
- fullReloadReason?: string;
1183
- }
1189
+ } | {
1190
+ type: 'FullReload';
1191
+ reason?: string;
1192
+ } | {
1193
+ type: 'Noop';
1194
+ };
1184
1195
  interface BindingHookResolveIdExtraArgs {
1185
1196
  custom?: number;
1186
1197
  isEntry: boolean;
@@ -1212,26 +1223,11 @@ interface BindingManifestPluginConfig {
1212
1223
  root: string;
1213
1224
  outPath: string;
1214
1225
  }
1215
- interface BindingMfManifest {
1216
- filePath?: string;
1217
- disableAssetsAnalyze?: boolean;
1218
- fileName?: string;
1219
- }
1220
1226
  interface BindingMinifyOptions {
1221
1227
  mangle?: boolean;
1222
1228
  compress?: boolean;
1223
1229
  removeWhitespace?: boolean;
1224
1230
  }
1225
- interface BindingModuleFederationPluginOption {
1226
- name: string;
1227
- filename?: string;
1228
- exposes?: Record<string, string>;
1229
- remotes?: Array<BindingRemote>;
1230
- shared?: Record<string, BindingShared>;
1231
- runtimePlugins?: Array<string>;
1232
- manifest?: BindingMfManifest;
1233
- getPublicPath?: string;
1234
- }
1235
1231
  interface BindingModulePreloadPolyfillPluginConfig {
1236
1232
  isServer?: boolean;
1237
1233
  }
@@ -1239,13 +1235,6 @@ interface BindingModules {
1239
1235
  values: Array<BindingRenderedModule>;
1240
1236
  keys: Array<string>;
1241
1237
  }
1242
- interface BindingRemote {
1243
- type?: string;
1244
- entry: string;
1245
- name: string;
1246
- entryGlobalName?: string;
1247
- shareScope?: string;
1248
- }
1249
1238
  interface BindingReplacePluginConfig {
1250
1239
  values: Record<string, string>;
1251
1240
  delimiters?: [string, string];
@@ -1261,13 +1250,6 @@ interface BindingReporterPluginConfig {
1261
1250
  shouldLogInfo: boolean;
1262
1251
  reportCompressedSize: boolean;
1263
1252
  }
1264
- interface BindingShared {
1265
- version?: string;
1266
- shareScope?: string;
1267
- singleton?: boolean;
1268
- requiredVersion?: string;
1269
- strictVersion?: boolean;
1270
- }
1271
1253
  interface BindingTransformHookExtraArgs {
1272
1254
  moduleType: string;
1273
1255
  }
@@ -1292,6 +1274,8 @@ interface BindingViteResolvePluginConfig {
1292
1274
  finalizeBareSpecifier?: (resolvedId: string, rawId: string, importer: string | null | undefined) => VoidNullable<string>;
1293
1275
  finalizeOtherSpecifiers?: (resolvedId: string, rawId: string) => VoidNullable<string>;
1294
1276
  resolveSubpathImports: (id: string, importer: string, isRequire: boolean, scan: boolean) => VoidNullable<string>;
1277
+ onWarn?: (message: string) => void;
1278
+ onDebug?: (message: string) => void;
1295
1279
  }
1296
1280
  interface BindingViteResolvePluginResolveOptions {
1297
1281
  isBuild: boolean;
@@ -1322,4 +1306,4 @@ interface PreRenderedChunk {
1322
1306
  exports: Array<string>;
1323
1307
  }
1324
1308
  //#endregion
1325
- export { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingBuiltinPluginName, BindingBundlerImpl, BindingDynamicImportVarsPluginConfig, BindingHmrOutputPatch, BindingHookResolveIdExtraArgs, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingMfManifest, BindingMinifyOptions, BindingModuleFederationPluginOption, BindingModulePreloadPolyfillPluginConfig, BindingRemote, BindingRenderedChunk, BindingReplacePluginConfig, BindingReporterPluginConfig, BindingTransformHookExtraArgs, BindingTransformPluginConfig, BindingViteResolvePluginConfig, BindingWasmHelperPluginConfig, BindingWatcherEvent, IsolatedDeclarationsOptions, IsolatedDeclarationsResult, NapiResolveOptions, ParseResult, ParserOptions, PreRenderedChunk, ResolveResult, ResolverFactory, TransformOptions, TransformResult, isolatedDeclaration, moduleRunnerTransform, transform };
1309
+ 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 };
@@ -1,4 +1,4 @@
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-BO7hG1pA.mjs";
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-DUz1Q2JW.mjs";
2
2
  import { Program } from "@oxc-project/types";
3
3
  import { TopLevelFilterExpression } from "@rolldown/pluginutils";
4
4
 
@@ -168,6 +168,7 @@ interface OutputOptions {
168
168
  */
169
169
  format?: ModuleFormat;
170
170
  sourcemap?: boolean | "inline" | "hidden";
171
+ sourcemapBaseUrl?: string;
171
172
  sourcemapDebugIds?: boolean;
172
173
  sourcemapIgnoreList?: boolean | SourcemapIgnoreListOption;
173
174
  sourcemapPathTransform?: SourcemapPathTransformOption;
@@ -461,8 +462,8 @@ declare class RolldownBuild {
461
462
  write(outputOptions?: OutputOptions): Promise<RolldownOutput>;
462
463
  close(): Promise<void>;
463
464
  [Symbol.asyncDispose](): Promise<void>;
464
- generateHmrPatch(changedFiles: string[]): Promise<BindingHmrOutputPatch | undefined>;
465
- hmrInvalidate(file: string, firstInvalidatedBy?: string): Promise<BindingHmrOutputPatch>;
465
+ generateHmrPatch(changedFiles: string[]): Promise<BindingHmrUpdate[]>;
466
+ hmrInvalidate(file: string, firstInvalidatedBy?: string): Promise<BindingHmrUpdate>;
466
467
  get watchFiles(): Promise<string[]>;
467
468
  }
468
469
  //#endregion
@@ -567,6 +568,67 @@ interface NormalizedOutputOptions {
567
568
  minifyInternalExports?: boolean;
568
569
  }
569
570
  //#endregion
571
+ //#region src/plugin/fs.d.ts
572
+ interface RolldownFsModule {
573
+ appendFile(path: string, data: string | Uint8Array, options?: {
574
+ encoding?: BufferEncoding | null;
575
+ mode?: string | number;
576
+ flag?: string | number;
577
+ }): Promise<void>;
578
+ copyFile(source: string, destination: string, mode?: string | number): Promise<void>;
579
+ mkdir(path: string, options?: {
580
+ recursive?: boolean;
581
+ mode?: string | number;
582
+ }): Promise<void>;
583
+ mkdtemp(prefix: string): Promise<string>;
584
+ readdir(path: string, options?: {
585
+ withFileTypes?: false;
586
+ }): Promise<string[]>;
587
+ readdir(path: string, options?: {
588
+ withFileTypes: true;
589
+ }): Promise<RolldownDirectoryEntry[]>;
590
+ readFile(path: string, options?: {
591
+ encoding?: null;
592
+ flag?: string | number;
593
+ signal?: AbortSignal;
594
+ }): Promise<Uint8Array>;
595
+ readFile(path: string, options?: {
596
+ encoding: BufferEncoding;
597
+ flag?: string | number;
598
+ signal?: AbortSignal;
599
+ }): Promise<string>;
600
+ realpath(path: string): Promise<string>;
601
+ rename(oldPath: string, newPath: string): Promise<void>;
602
+ rmdir(path: string, options?: {
603
+ recursive?: boolean;
604
+ }): Promise<void>;
605
+ stat(path: string): Promise<RolldownFileStats>;
606
+ lstat(path: string): Promise<RolldownFileStats>;
607
+ unlink(path: string): Promise<void>;
608
+ writeFile(path: string, data: string | Uint8Array, options?: {
609
+ encoding?: BufferEncoding | null;
610
+ mode?: string | number;
611
+ flag?: string | number;
612
+ }): Promise<void>;
613
+ }
614
+ type BufferEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "base64" | "base64url" | "latin1" | "binary" | "hex";
615
+ interface RolldownDirectoryEntry {
616
+ isFile(): boolean;
617
+ isDirectory(): boolean;
618
+ isSymbolicLink(): boolean;
619
+ name: string;
620
+ }
621
+ interface RolldownFileStats {
622
+ isFile(): boolean;
623
+ isDirectory(): boolean;
624
+ isSymbolicLink(): boolean;
625
+ size: number;
626
+ mtime: Date;
627
+ ctime: Date;
628
+ atime: Date;
629
+ birthtime: Date;
630
+ }
631
+ //#endregion
570
632
  //#region src/plugin/hook-filter.d.ts
571
633
  type GeneralHookFilter<Value = StringOrRegExp> = MaybeArray<Value> | {
572
634
  include?: MaybeArray<Value>;
@@ -665,6 +727,7 @@ interface PluginContextResolveOptions {
665
727
  }
666
728
  type GetModuleInfo = (moduleId: string) => ModuleInfo | null;
667
729
  interface PluginContext extends MinimalPluginContext {
730
+ fs: RolldownFsModule;
668
731
  emitFile(file: EmittedFile): string;
669
732
  getFileName(referenceId: string): string;
670
733
  getModuleIds(): IterableIterator<string>;
@@ -747,11 +810,6 @@ declare function loadFallbackPlugin(): BuiltinPlugin;
747
810
  declare function jsonPlugin(config?: BindingJsonPluginConfig): BuiltinPlugin;
748
811
  declare function buildImportAnalysisPlugin(config: BindingBuildImportAnalysisPluginConfig): BuiltinPlugin;
749
812
  declare function viteResolvePlugin(config: BindingViteResolvePluginConfig): BuiltinPlugin;
750
- type ModuleFederationPluginOption = Omit<BindingModuleFederationPluginOption, "remotes"> & {
751
- remotes?: Record<string, string | BindingRemote>;
752
- manifest?: boolean | BindingMfManifest;
753
- };
754
- declare function moduleFederationPlugin(config: ModuleFederationPluginOption): BuiltinPlugin;
755
813
  declare function isolatedDeclarationPlugin(config?: BindingIsolatedDeclarationPluginConfig): BuiltinPlugin;
756
814
  declare function assetPlugin(config?: BindingAssetPluginConfig): BuiltinPlugin;
757
815
  declare function webWorkerPostPlugin(): BuiltinPlugin;
@@ -1270,4 +1328,4 @@ declare function defineConfig(config: RolldownOptions): RolldownOptions;
1270
1328
  declare function defineConfig(config: RolldownOptions[]): RolldownOptions[];
1271
1329
  declare function defineConfig(config: ConfigExport): ConfigExport;
1272
1330
  //#endregion
1273
- export { type AddonFunction, type AsyncPluginHooks, 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 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, moduleFederationPlugin, modulePreloadPolyfillPlugin, reporterPlugin, rolldown, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch, webWorkerPostPlugin, withFilter };
1331
+ 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 };
@@ -1,4 +1,4 @@
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-D1lW862e.cjs";
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-BAyrv67G.cjs";
2
2
  import { Program } from "@oxc-project/types";
3
3
  import { TopLevelFilterExpression } from "@rolldown/pluginutils";
4
4
 
@@ -168,6 +168,7 @@ interface OutputOptions {
168
168
  */
169
169
  format?: ModuleFormat;
170
170
  sourcemap?: boolean | "inline" | "hidden";
171
+ sourcemapBaseUrl?: string;
171
172
  sourcemapDebugIds?: boolean;
172
173
  sourcemapIgnoreList?: boolean | SourcemapIgnoreListOption;
173
174
  sourcemapPathTransform?: SourcemapPathTransformOption;
@@ -461,8 +462,8 @@ declare class RolldownBuild {
461
462
  write(outputOptions?: OutputOptions): Promise<RolldownOutput>;
462
463
  close(): Promise<void>;
463
464
  [Symbol.asyncDispose](): Promise<void>;
464
- generateHmrPatch(changedFiles: string[]): Promise<BindingHmrOutputPatch | undefined>;
465
- hmrInvalidate(file: string, firstInvalidatedBy?: string): Promise<BindingHmrOutputPatch>;
465
+ generateHmrPatch(changedFiles: string[]): Promise<BindingHmrUpdate[]>;
466
+ hmrInvalidate(file: string, firstInvalidatedBy?: string): Promise<BindingHmrUpdate>;
466
467
  get watchFiles(): Promise<string[]>;
467
468
  }
468
469
  //#endregion
@@ -567,6 +568,67 @@ interface NormalizedOutputOptions {
567
568
  minifyInternalExports?: boolean;
568
569
  }
569
570
  //#endregion
571
+ //#region src/plugin/fs.d.ts
572
+ interface RolldownFsModule {
573
+ appendFile(path: string, data: string | Uint8Array, options?: {
574
+ encoding?: BufferEncoding | null;
575
+ mode?: string | number;
576
+ flag?: string | number;
577
+ }): Promise<void>;
578
+ copyFile(source: string, destination: string, mode?: string | number): Promise<void>;
579
+ mkdir(path: string, options?: {
580
+ recursive?: boolean;
581
+ mode?: string | number;
582
+ }): Promise<void>;
583
+ mkdtemp(prefix: string): Promise<string>;
584
+ readdir(path: string, options?: {
585
+ withFileTypes?: false;
586
+ }): Promise<string[]>;
587
+ readdir(path: string, options?: {
588
+ withFileTypes: true;
589
+ }): Promise<RolldownDirectoryEntry[]>;
590
+ readFile(path: string, options?: {
591
+ encoding?: null;
592
+ flag?: string | number;
593
+ signal?: AbortSignal;
594
+ }): Promise<Uint8Array>;
595
+ readFile(path: string, options?: {
596
+ encoding: BufferEncoding;
597
+ flag?: string | number;
598
+ signal?: AbortSignal;
599
+ }): Promise<string>;
600
+ realpath(path: string): Promise<string>;
601
+ rename(oldPath: string, newPath: string): Promise<void>;
602
+ rmdir(path: string, options?: {
603
+ recursive?: boolean;
604
+ }): Promise<void>;
605
+ stat(path: string): Promise<RolldownFileStats>;
606
+ lstat(path: string): Promise<RolldownFileStats>;
607
+ unlink(path: string): Promise<void>;
608
+ writeFile(path: string, data: string | Uint8Array, options?: {
609
+ encoding?: BufferEncoding | null;
610
+ mode?: string | number;
611
+ flag?: string | number;
612
+ }): Promise<void>;
613
+ }
614
+ type BufferEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "base64" | "base64url" | "latin1" | "binary" | "hex";
615
+ interface RolldownDirectoryEntry {
616
+ isFile(): boolean;
617
+ isDirectory(): boolean;
618
+ isSymbolicLink(): boolean;
619
+ name: string;
620
+ }
621
+ interface RolldownFileStats {
622
+ isFile(): boolean;
623
+ isDirectory(): boolean;
624
+ isSymbolicLink(): boolean;
625
+ size: number;
626
+ mtime: Date;
627
+ ctime: Date;
628
+ atime: Date;
629
+ birthtime: Date;
630
+ }
631
+ //#endregion
570
632
  //#region src/plugin/hook-filter.d.ts
571
633
  type GeneralHookFilter<Value = StringOrRegExp> = MaybeArray<Value> | {
572
634
  include?: MaybeArray<Value>;
@@ -665,6 +727,7 @@ interface PluginContextResolveOptions {
665
727
  }
666
728
  type GetModuleInfo = (moduleId: string) => ModuleInfo | null;
667
729
  interface PluginContext extends MinimalPluginContext {
730
+ fs: RolldownFsModule;
668
731
  emitFile(file: EmittedFile): string;
669
732
  getFileName(referenceId: string): string;
670
733
  getModuleIds(): IterableIterator<string>;
@@ -747,11 +810,6 @@ declare function loadFallbackPlugin(): BuiltinPlugin;
747
810
  declare function jsonPlugin(config?: BindingJsonPluginConfig): BuiltinPlugin;
748
811
  declare function buildImportAnalysisPlugin(config: BindingBuildImportAnalysisPluginConfig): BuiltinPlugin;
749
812
  declare function viteResolvePlugin(config: BindingViteResolvePluginConfig): BuiltinPlugin;
750
- type ModuleFederationPluginOption = Omit<BindingModuleFederationPluginOption, "remotes"> & {
751
- remotes?: Record<string, string | BindingRemote>;
752
- manifest?: boolean | BindingMfManifest;
753
- };
754
- declare function moduleFederationPlugin(config: ModuleFederationPluginOption): BuiltinPlugin;
755
813
  declare function isolatedDeclarationPlugin(config?: BindingIsolatedDeclarationPluginConfig): BuiltinPlugin;
756
814
  declare function assetPlugin(config?: BindingAssetPluginConfig): BuiltinPlugin;
757
815
  declare function webWorkerPostPlugin(): BuiltinPlugin;
@@ -1270,4 +1328,4 @@ declare function defineConfig(config: RolldownOptions): RolldownOptions;
1270
1328
  declare function defineConfig(config: RolldownOptions[]): RolldownOptions[];
1271
1329
  declare function defineConfig(config: ConfigExport): ConfigExport;
1272
1330
  //#endregion
1273
- export { type AddonFunction, type AsyncPluginHooks, 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 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, moduleFederationPlugin, modulePreloadPolyfillPlugin, reporterPlugin, rolldown, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch, webWorkerPostPlugin, withFilter };
1331
+ 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 };
@@ -1,9 +1,9 @@
1
- import { rolldown } from "./src-BWVOVy_u.mjs";
1
+ import { rolldown } from "./src-CkG0t1KT.mjs";
2
2
  import path from "node:path";
3
3
  import { pathToFileURL } from "node:url";
4
+ import { readdir } from "node:fs/promises";
4
5
  import { cwd } from "node:process";
5
6
  import fs from "node:fs";
6
- import { readdir } from "node:fs/promises";
7
7
 
8
8
  //#region src/utils/load-config.ts
9
9
  async function bundleTsConfig(configFile, isEsm) {
@@ -1,10 +1,10 @@
1
1
  const require_chunk = require('./chunk-DDkG_k5U.cjs');
2
- const require_src = require('./src-BLxfrK6S.cjs');
2
+ const require_src = require('./src-CXCXfLrc.cjs');
3
3
  const node_path = require_chunk.__toESM(require("node:path"));
4
4
  const node_url = require_chunk.__toESM(require("node:url"));
5
+ const node_fs_promises = require_chunk.__toESM(require("node:fs/promises"));
5
6
  const node_process = require_chunk.__toESM(require("node:process"));
6
7
  const node_fs = require_chunk.__toESM(require("node:fs"));
7
- const node_fs_promises = require_chunk.__toESM(require("node:fs/promises"));
8
8
 
9
9
  //#region src/utils/load-config.ts
10
10
  async function bundleTsConfig(configFile, isEsm) {
@@ -101,7 +101,7 @@ function locate(source, search, options) {
101
101
 
102
102
  //#endregion
103
103
  //#region src/log/logs.ts
104
- 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";
104
+ 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", NO_FS_IN_BROWSER = "NO_FS_IN_BROWSER";
105
105
  function logParseError(message) {
106
106
  return {
107
107
  code: PARSE_ERROR,
@@ -186,7 +186,7 @@ function augmentCodeLocation(properties, pos, source, id) {
186
186
  }
187
187
 
188
188
  //#endregion
189
- //#region ../../node_modules/.pnpm/oxc-parser@0.77.3/node_modules/oxc-parser/wrap.mjs
189
+ //#region ../../node_modules/.pnpm/oxc-parser@0.78.0/node_modules/oxc-parser/wrap.mjs
190
190
  function wrap$1(result) {
191
191
  let program, module, comments, errors;
192
192
  return {
@@ -102,7 +102,7 @@ function locate(source, search, options) {
102
102
 
103
103
  //#endregion
104
104
  //#region src/log/logs.ts
105
- 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";
105
+ 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", NO_FS_IN_BROWSER = "NO_FS_IN_BROWSER";
106
106
  function logParseError(message) {
107
107
  return {
108
108
  code: PARSE_ERROR,
@@ -187,7 +187,7 @@ function augmentCodeLocation(properties, pos, source, id) {
187
187
  }
188
188
 
189
189
  //#endregion
190
- //#region ../../node_modules/.pnpm/oxc-parser@0.77.3/node_modules/oxc-parser/wrap.mjs
190
+ //#region ../../node_modules/.pnpm/oxc-parser@0.78.0/node_modules/oxc-parser/wrap.mjs
191
191
  function wrap$1(result) {
192
192
  let program, module$1, comments, errors;
193
193
  return {