@ohos-ports/rspack-binding 1.7.11-beta.1 → 2.2.1-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/napi-binding.d.ts CHANGED
@@ -25,6 +25,10 @@ export const COMMIT_CUSTOM_FIELDS_SYMBOL: unique symbol;
25
25
 
26
26
  export const RUST_ERROR_SYMBOL: unique symbol;
27
27
 
28
+ export const CIRCULAR_CONNECTION_SYMBOL: unique symbol;
29
+ export const TRANSITIVE_ONLY_SYMBOL: unique symbol;
30
+ export type ConnectionState = boolean | typeof CIRCULAR_CONNECTION_SYMBOL | typeof TRANSITIVE_ONLY_SYMBOL;
31
+
28
32
  interface KnownBuildInfo {
29
33
  [BUILD_INFO_ASSETS_SYMBOL]: Assets,
30
34
  [BUILD_INFO_FILE_DEPENDENCIES_SYMBOL]: string[],
@@ -37,7 +41,6 @@ interface KnownBuildInfo {
37
41
  export type BuildInfo = KnownBuildInfo & Record<string, any>;
38
42
 
39
43
  export interface Module {
40
- [MODULE_IDENTIFIER_SYMBOL]: string;
41
44
  readonly type: string;
42
45
  get context(): string | undefined;
43
46
  get layer(): string | undefined;
@@ -65,6 +68,7 @@ export interface NormalModule extends Module {
65
68
  readonly loaders: JsLoaderItem[];
66
69
  get matchResource(): string | undefined;
67
70
  set matchResource(val: string | undefined);
71
+ get error(): RspackError | undefined;
68
72
  }
69
73
 
70
74
  export interface ConcatenatedModule extends Module {
@@ -95,6 +99,8 @@ export interface JsSource {
95
99
  source: string | Buffer
96
100
  map?: string
97
101
  }
102
+
103
+ export type CompilerId = void;
98
104
  /* -- banner.d.ts end -- */
99
105
 
100
106
  /* -- napi-rs generated below -- */
@@ -116,8 +122,8 @@ export declare class AsyncDependenciesBlock {
116
122
 
117
123
  export declare class Chunk {
118
124
  get name(): string | undefined
119
- get id(): string | undefined
120
- get ids(): Array<string>
125
+ get id(): string | number | undefined
126
+ get ids(): Array<string | number>
121
127
  get idNameHints(): Array<string>
122
128
  get filenameTemplate(): string | undefined
123
129
  get cssFilenameTemplate(): string | undefined
@@ -185,7 +191,7 @@ export declare class ConcatenatedModule {
185
191
  get rootModule(): Module
186
192
  get modules(): Module[]
187
193
  readableIdentifier(): string
188
- _originalSource(): JsSource
194
+ _originalSource(): JsSource | undefined
189
195
  nameForCondition(): string | undefined
190
196
  get blocks(): AsyncDependenciesBlock[]
191
197
  get dependencies(): Dependency[]
@@ -196,7 +202,7 @@ export declare class ConcatenatedModule {
196
202
 
197
203
  export declare class ContextModule {
198
204
  readableIdentifier(): string
199
- _originalSource(): JsSource
205
+ _originalSource(): JsSource | undefined
200
206
  nameForCondition(): string | undefined
201
207
  get blocks(): AsyncDependenciesBlock[]
202
208
  get dependencies(): Dependency[]
@@ -210,9 +216,11 @@ export declare class Dependency {
210
216
  get type(): string
211
217
  get category(): string
212
218
  get request(): string | undefined
219
+ get attributes(): Record<string, string> | undefined
213
220
  get critical(): boolean
214
221
  set critical(val: boolean)
215
222
  get ids(): Array<string> | undefined
223
+ get loc(): DependencyLocation | null
216
224
  }
217
225
 
218
226
  export declare class Diagnostics {
@@ -259,7 +267,7 @@ export type EntryOptionsDTO = EntryOptionsDto
259
267
 
260
268
  export declare class ExternalModule {
261
269
  readableIdentifier(): string
262
- _originalSource(): JsSource
270
+ _originalSource(): JsSource | undefined
263
271
  nameForCondition(): string | undefined
264
272
  get blocks(): AsyncDependenciesBlock[]
265
273
  get dependencies(): Dependency[]
@@ -326,7 +334,7 @@ export declare class JsCompilation {
326
334
  }
327
335
 
328
336
  export declare class JsCompiler {
329
- constructor(compilerPath: string, options: RawOptions, builtinPlugins: Array<BuiltinPlugin>, registerJsTaps: RegisterJsTaps, outputFilesystem: ThreadsafeNodeFS, intermediateFilesystem: ThreadsafeNodeFS | undefined | null, inputFilesystem: ThreadsafeNodeFS | undefined | null, resolverFactoryReference: JsResolverFactory, unsafeFastDrop: boolean, platform: RawCompilerPlatform)
337
+ constructor(compilerPath: string, options: RawOptions, builtinPlugins: BuiltinPlugin[], registerJsTaps: RegisterJsTaps, outputFilesystem: ThreadsafeNodeFS, intermediateFilesystem: ThreadsafeNodeFS | undefined | null, inputFilesystem: ThreadsafeNodeFS | undefined | null, resolverFactoryReference: JsResolverFactory, unsafeFastDrop: boolean, platform: RawCompilerPlatform)
330
338
  setNonSkippableRegisters(kinds: Array<RegisterJsTapKind>): void
331
339
  /** Build with the given option passed to the constructor */
332
340
  build(callback: (err: null | Error) => void): void
@@ -334,6 +342,7 @@ export declare class JsCompiler {
334
342
  rebuild(changed_files: string[], removed_files: string[], callback: (err: null | Error) => void): void
335
343
  close(): Promise<void>
336
344
  getVirtualFileStore(): VirtualFileStore | null
345
+ getCompilerId(): ExternalObject<CompilerId>
337
346
  }
338
347
 
339
348
  export declare class JsContextModuleFactoryAfterResolveData {
@@ -361,6 +370,10 @@ export declare class JsContextModuleFactoryBeforeResolveData {
361
370
  set recursive(recursive: boolean)
362
371
  }
363
372
 
373
+ export declare class JsCoordinator {
374
+ constructor()
375
+ }
376
+
364
377
  export declare class JsDependencies {
365
378
  get fileDependencies(): Array<string>
366
379
  get addedFileDependencies(): Array<string>
@@ -394,10 +407,16 @@ export declare class JsExportsInfo {
394
407
  getUsed(name: string | string[], runtime: string | string[] | undefined): 0 | 1 | 2 | 3 | 4
395
408
  }
396
409
 
410
+ export declare class JsLoaderCache {
411
+ get(loaderIndex: number, content: string | Uint8Array, existing: JsLoaderDependencies): JsLoaderCacheEntry | null
412
+ store(loaderIndex: number, output: JsLoaderCacheEntry): void
413
+ }
414
+
397
415
  export declare class JsModuleGraph {
398
416
  getModule(dependency: Dependency): Module | null
399
417
  getResolvedModule(dependency: Dependency): Module | null
400
418
  getUsedExports(module: Module, runtime: string | string[]): boolean | Array<string> | null
419
+ getProvidedExports(module: Module): true | string[] | null
401
420
  getIssuer(module: Module): Module | null
402
421
  getExportsInfo(module: Module): JsExportsInfo
403
422
  getConnection(dependency: Dependency): ModuleGraphConnection | null
@@ -430,7 +449,7 @@ export declare class KnownBuildInfo {
430
449
 
431
450
  export declare class Module {
432
451
  readableIdentifier(): string
433
- _originalSource(): JsSource
452
+ _originalSource(): JsSource | undefined
434
453
  nameForCondition(): string | undefined
435
454
  get blocks(): AsyncDependenciesBlock[]
436
455
  get dependencies(): Dependency[]
@@ -444,19 +463,13 @@ export declare class ModuleGraphConnection {
444
463
  get module(): Module | null
445
464
  get resolvedModule(): Module | null
446
465
  get originModule(): Module | null
466
+ getActiveState(runtime: string | string[] | undefined): ConnectionState
447
467
  }
448
468
 
449
469
  export declare class NativeWatcher {
450
470
  constructor(options: NativeWatcherOptions)
451
- watch(files: [Array<string>, Array<string>], directories: [Array<string>, Array<string>], missing: [Array<string>, Array<string>], startTime: bigint, callback: (err: Error | null, result: NativeWatchResult) => void, callbackUndelayed: (path: string) => void): void
471
+ watch(files: [Array<string>, Array<string>], directories: [Array<string>, Array<string>], missing: [Array<string>, Array<string>], startTime: bigint, callback: (err: Error | null, result: NativeWatchResult) => void, callbackUndelayed: (event: NativeWatchUndelayedEvent) => void): void
452
472
  triggerEvent(kind: 'change' | 'remove' | 'create', path: string): void
453
- /**
454
- * # Safety
455
- *
456
- * This function is unsafe because it uses `&mut self` to call the watcher asynchronously.
457
- * It's important to ensure that the watcher is not used in any other places before this function is finished.
458
- * You must ensure that the watcher not call watch, close or pause in the same time, otherwise it may lead to undefined behavior.
459
- */
460
473
  close(): Promise<void>
461
474
  pause(): void
462
475
  }
@@ -522,6 +535,7 @@ export declare enum BuiltinPluginName {
522
535
  DynamicEntryPlugin = 'DynamicEntryPlugin',
523
536
  ExternalsPlugin = 'ExternalsPlugin',
524
537
  NodeTargetPlugin = 'NodeTargetPlugin',
538
+ EsmNodeTargetPlugin = 'EsmNodeTargetPlugin',
525
539
  ElectronTargetPlugin = 'ElectronTargetPlugin',
526
540
  EnableChunkLoadingPlugin = 'EnableChunkLoadingPlugin',
527
541
  EnableLibraryPlugin = 'EnableLibraryPlugin',
@@ -535,23 +549,29 @@ export declare enum BuiltinPluginName {
535
549
  HotModuleReplacementPlugin = 'HotModuleReplacementPlugin',
536
550
  LimitChunkCountPlugin = 'LimitChunkCountPlugin',
537
551
  WorkerPlugin = 'WorkerPlugin',
538
- WebWorkerTemplatePlugin = 'WebWorkerTemplatePlugin',
539
552
  MergeDuplicateChunksPlugin = 'MergeDuplicateChunksPlugin',
540
553
  SplitChunksPlugin = 'SplitChunksPlugin',
541
554
  RemoveDuplicateModulesPlugin = 'RemoveDuplicateModulesPlugin',
542
555
  ShareRuntimePlugin = 'ShareRuntimePlugin',
556
+ SharedUsedExportsOptimizerPlugin = 'SharedUsedExportsOptimizerPlugin',
543
557
  ContainerPlugin = 'ContainerPlugin',
544
558
  ContainerReferencePlugin = 'ContainerReferencePlugin',
545
559
  ProvideSharedPlugin = 'ProvideSharedPlugin',
546
560
  ConsumeSharedPlugin = 'ConsumeSharedPlugin',
561
+ CollectSharedEntryPlugin = 'CollectSharedEntryPlugin',
562
+ SharedContainerPlugin = 'SharedContainerPlugin',
547
563
  ModuleFederationRuntimePlugin = 'ModuleFederationRuntimePlugin',
548
564
  ModuleFederationManifestPlugin = 'ModuleFederationManifestPlugin',
549
565
  NamedModuleIdsPlugin = 'NamedModuleIdsPlugin',
550
566
  NaturalModuleIdsPlugin = 'NaturalModuleIdsPlugin',
551
567
  DeterministicModuleIdsPlugin = 'DeterministicModuleIdsPlugin',
568
+ CompactHashedModuleIdsPlugin = 'CompactHashedModuleIdsPlugin',
569
+ SyncModuleIdsPlugin = 'SyncModuleIdsPlugin',
570
+ HashedModuleIdsPlugin = 'HashedModuleIdsPlugin',
552
571
  NaturalChunkIdsPlugin = 'NaturalChunkIdsPlugin',
553
572
  NamedChunkIdsPlugin = 'NamedChunkIdsPlugin',
554
573
  DeterministicChunkIdsPlugin = 'DeterministicChunkIdsPlugin',
574
+ CompactHashedChunkIdsPlugin = 'CompactHashedChunkIdsPlugin',
555
575
  OccurrenceChunkIdsPlugin = 'OccurrenceChunkIdsPlugin',
556
576
  RealContentHashPlugin = 'RealContentHashPlugin',
557
577
  RemoveEmptyChunksPlugin = 'RemoveEmptyChunksPlugin',
@@ -585,6 +605,7 @@ export declare enum BuiltinPluginName {
585
605
  DllReferenceAgencyPlugin = 'DllReferenceAgencyPlugin',
586
606
  LibManifestPlugin = 'LibManifestPlugin',
587
607
  FlagAllModulesAsUsedPlugin = 'FlagAllModulesAsUsedPlugin',
608
+ CssHttpExternalsRspackPlugin = 'CssHttpExternalsRspackPlugin',
588
609
  HttpExternalsRspackPlugin = 'HttpExternalsRspackPlugin',
589
610
  CopyRspackPlugin = 'CopyRspackPlugin',
590
611
  HtmlRspackPlugin = 'HtmlRspackPlugin',
@@ -596,13 +617,17 @@ export declare enum BuiltinPluginName {
596
617
  RsdoctorPlugin = 'RsdoctorPlugin',
597
618
  RstestPlugin = 'RstestPlugin',
598
619
  RslibPlugin = 'RslibPlugin',
620
+ CircularModulesInfoPlugin = 'CircularModulesInfoPlugin',
621
+ CircularCheckRspackPlugin = 'CircularCheckRspackPlugin',
599
622
  CircularDependencyRspackPlugin = 'CircularDependencyRspackPlugin',
600
623
  URLPlugin = 'URLPlugin',
601
624
  JsLoaderRspackPlugin = 'JsLoaderRspackPlugin',
602
625
  LazyCompilationPlugin = 'LazyCompilationPlugin',
603
626
  ModuleInfoHeaderPlugin = 'ModuleInfoHeaderPlugin',
604
627
  HttpUriPlugin = 'HttpUriPlugin',
605
- CssChunkingPlugin = 'CssChunkingPlugin'
628
+ CssChunkingPlugin = 'CssChunkingPlugin',
629
+ RscServerPlugin = 'RscServerPlugin',
630
+ RscClientPlugin = 'RscClientPlugin'
606
631
  }
607
632
 
608
633
  export declare function cleanupGlobalTrace(): void
@@ -720,13 +745,8 @@ export interface JsBuildMeta {
720
745
  hasTopLevelAwait?: boolean
721
746
  esm?: boolean
722
747
  exportsType?: undefined | 'unset' | 'default' | 'namespace' | 'flagged' | 'dynamic'
723
- defaultObject?: undefined | 'false' | 'redirect' | JsBuildMetaDefaultObjectRedirectWarn
748
+ defaultObject?: undefined | 'false' | 'redirect' | 'redirect-warn'
724
749
  sideEffectFree?: boolean
725
- exportsFinalName?: Array<[string, string]> | undefined
726
- }
727
-
728
- export interface JsBuildMetaDefaultObjectRedirectWarn {
729
- redirectWarn: JsDefaultObjectRedirectWarnObject
730
750
  }
731
751
 
732
752
  export interface JsBuildTimeExecutionOption {
@@ -749,6 +769,13 @@ export interface JsChunkGroupOrigin {
749
769
  loc?: string | RealDependencyLocation
750
770
  }
751
771
 
772
+ export interface JsChunkOptionNameBatch {
773
+ modules: Module[]
774
+ chunks: Chunk[]
775
+ chunkData: Uint32Array
776
+ cacheGroupKey: string
777
+ }
778
+
752
779
  export interface JsChunkOptionNameCtx {
753
780
  module: Module
754
781
  chunks: Chunk[]
@@ -790,10 +817,6 @@ export interface JsCreateScriptData {
790
817
  chunk: Chunk
791
818
  }
792
819
 
793
- export interface JsDefaultObjectRedirectWarnObject {
794
- ignore: boolean
795
- }
796
-
797
820
  export interface JsDiagnostic {
798
821
  message: string
799
822
  help?: string
@@ -933,6 +956,13 @@ export interface JsLinkPreloadData {
933
956
  chunk: Chunk
934
957
  }
935
958
 
959
+ export interface JsLoaderCacheEntry {
960
+ content: null | string | Uint8Array
961
+ sourceMap?: Uint8Array
962
+ addedDependencies: JsLoaderDependencies
963
+ removedDependencies: JsLoaderDependencies
964
+ }
965
+
936
966
  export interface JsLoaderContext {
937
967
  resource: string
938
968
  _module: Module
@@ -943,14 +973,12 @@ export interface JsLoaderContext {
943
973
  __internal__parseMeta: Record<string, string>
944
974
  sourceMap?: Buffer
945
975
  cacheable: boolean
946
- fileDependencies: Array<string>
947
- contextDependencies: Array<string>
948
- missingDependencies: Array<string>
949
- buildDependencies: Array<string>
976
+ dependencies: JsLoaderDependencies
950
977
  loaderItems: Array<JsLoaderItem>
951
978
  loaderIndex: number
952
979
  loaderState: Readonly<JsLoaderState>
953
980
  __internal__error?: RspackError
981
+ __internal__loaderCache?: JsLoaderCache | undefined
954
982
  /**
955
983
  * UTF-8 hint for `content`
956
984
  * - Some(true): `content` is a `UTF-8` encoded sequence
@@ -958,9 +986,17 @@ export interface JsLoaderContext {
958
986
  __internal__utf8Hint?: boolean
959
987
  }
960
988
 
989
+ export interface JsLoaderDependencies {
990
+ fileDependencies: Array<string>
991
+ contextDependencies: Array<string>
992
+ missingDependencies: Array<string>
993
+ buildDependencies: Array<string>
994
+ }
995
+
961
996
  export interface JsLoaderItem {
962
997
  loader: string
963
998
  type: string
999
+ cache: boolean
964
1000
  data: any
965
1001
  normalExecuted: boolean
966
1002
  pitchExecuted: boolean
@@ -1003,13 +1039,18 @@ export interface JsPathData {
1003
1039
  runtime?: string
1004
1040
  url?: string
1005
1041
  id?: string
1006
- chunk?: JsPathDataChunkLike
1042
+ chunk?: Chunk | JsPathDataChunkLike
1007
1043
  }
1008
1044
 
1009
1045
  export interface JsPathDataChunkLike {
1046
+ id?: string | number
1010
1047
  name?: string
1011
1048
  hash?: string
1012
- id?: string
1049
+ }
1050
+
1051
+ export interface JsRealContentHashPluginUpdateHashData {
1052
+ assets: Array<Buffer>
1053
+ oldHash: string
1013
1054
  }
1014
1055
 
1015
1056
  export interface JsResolveData {
@@ -1040,6 +1081,22 @@ export interface JsResourceData {
1040
1081
  descriptionFilePath?: string
1041
1082
  }
1042
1083
 
1084
+ export interface JsRscClientPluginOptions {
1085
+ coordinator: JsCoordinator
1086
+ }
1087
+
1088
+ export interface JsRscCssLinkOptions {
1089
+ precedence?: string | boolean
1090
+ props?: Record<string, string>
1091
+ }
1092
+
1093
+ export interface JsRscServerPluginOptions {
1094
+ coordinator: JsCoordinator
1095
+ cssLink?: JsRscCssLinkOptions | undefined | null
1096
+ onServerComponentChanges?: (() => void | Promise<void>) | undefined | null
1097
+ onManifest?: ((arg: string) => Promise<undefined>) | undefined | null
1098
+ }
1099
+
1043
1100
  export interface JsRsdoctorAsset {
1044
1101
  ukey: number
1045
1102
  path: string
@@ -1156,6 +1213,7 @@ export interface JsRsdoctorModuleGraph {
1156
1213
  dependencies: Array<JsRsdoctorDependency>
1157
1214
  chunkModules: Array<JsRsdoctorChunkModules>
1158
1215
  connectionsOnlyImports: Array<JsRsdoctorConnectionsOnlyImport>
1216
+ exportUsageEdges: Array<[number, Array<string> | null, number, Array<string> | null, string, string | null]>
1159
1217
  }
1160
1218
 
1161
1219
  export interface JsRsdoctorModuleGraphModule {
@@ -1300,10 +1358,10 @@ export interface JsStatsAsset {
1300
1358
  emitted: boolean
1301
1359
  chunkNames: Array<string>
1302
1360
  chunkIdHints: Array<string>
1303
- chunks: Array<string | undefined | null>
1361
+ chunks: Array<string | number | undefined | null>
1304
1362
  auxiliaryChunkNames: Array<string>
1305
1363
  auxiliaryChunkIdHints: Array<string>
1306
- auxiliaryChunks: Array<string | undefined | null>
1364
+ auxiliaryChunks: Array<string | number | undefined | null>
1307
1365
  }
1308
1366
 
1309
1367
  export interface JsStatsAssetInfo {
@@ -1340,17 +1398,17 @@ export interface JsStatsChunk {
1340
1398
  type: string
1341
1399
  files: Array<string>
1342
1400
  auxiliaryFiles: Array<string>
1343
- id?: string
1401
+ id?: string | number | undefined
1344
1402
  idHints: Array<string>
1345
1403
  hash?: string
1346
1404
  entry: boolean
1347
1405
  initial: boolean
1348
1406
  names: Array<string>
1349
1407
  size: number
1350
- parents?: Array<string>
1351
- children?: Array<string>
1352
- siblings?: Array<string>
1353
- childrenByOrder: Record<string, Array<string>>
1408
+ parents?: Array<string | number> | undefined
1409
+ children?: Array<string | number> | undefined
1410
+ siblings?: Array<string | number> | undefined
1411
+ childrenByOrder: Record<string, Array<string | number>>
1354
1412
  runtime: Array<string>
1355
1413
  reason?: string
1356
1414
  rendered: boolean
@@ -1361,7 +1419,7 @@ export interface JsStatsChunk {
1361
1419
 
1362
1420
  export interface JsStatsChunkGroup {
1363
1421
  name: string
1364
- chunks: Array<string>
1422
+ chunks: Array<string | number>
1365
1423
  assets: Array<JsStatsChunkGroupAsset>
1366
1424
  assetsSize: number
1367
1425
  auxiliaryAssets?: Array<JsStatsChunkGroupAsset>
@@ -1450,8 +1508,7 @@ export interface JsStatsModuleCommonAttributes {
1450
1508
  failed?: boolean
1451
1509
  errors?: number
1452
1510
  warnings?: number
1453
- profile?: JsStatsModuleProfile
1454
- chunks?: Array<string>
1511
+ chunks?: Array<string | number> | undefined
1455
1512
  assets?: Array<string>
1456
1513
  reasons?: Array<JsStatsModuleReason>
1457
1514
  providedExports?: Array<string>
@@ -1764,6 +1821,16 @@ export interface NativeWatcherOptions {
1764
1821
  ignored?: string | string[] | RegExp
1765
1822
  }
1766
1823
 
1824
+ /**
1825
+ * A single, undelayed file system event delivered to the `callbackUndelayed`
1826
+ * callback. Passed as one object so napi-rs delivers it as a single JS
1827
+ * argument unambiguously (a tuple would arrive as an array).
1828
+ */
1829
+ export interface NativeWatchUndelayedEvent {
1830
+ kind: string
1831
+ path: string
1832
+ }
1833
+
1767
1834
  export interface NodeFsStats {
1768
1835
  isFile: boolean
1769
1836
  isDirectory: boolean
@@ -1864,22 +1931,41 @@ export interface RawCacheGroupOptions {
1864
1931
  minChunks?: number
1865
1932
  minSize?: number | RawSplitChunkSizes
1866
1933
  minSizeReduction?: number | RawSplitChunkSizes
1934
+ enforceSizeThreshold?: number | RawSplitChunkSizes
1867
1935
  maxSize?: number | RawSplitChunkSizes
1868
1936
  maxAsyncSize?: number | RawSplitChunkSizes
1869
1937
  maxInitialSize?: number | RawSplitChunkSizes
1870
1938
  maxAsyncRequests?: number
1871
1939
  maxInitialRequests?: number
1872
- name?: string | false | Function
1940
+ name?: string | false | ((ctx: JsChunkOptionNameCtx) => string | undefined)
1941
+ nameBatch?: ((batch: JsChunkOptionNameBatch) => (string | undefined)[])
1873
1942
  reuseExistingChunk?: boolean
1874
1943
  enforce?: boolean
1875
1944
  usedExports?: boolean
1876
1945
  }
1877
1946
 
1878
- export interface RawCacheOptions {
1879
- type: string
1947
+ export interface RawCacheOptionsMemory {
1880
1948
  maxGenerations?: number
1881
1949
  }
1882
1950
 
1951
+ export interface RawCacheOptionsPersistent {
1952
+ buildDependencies?: Array<string>
1953
+ version?: string
1954
+ maxAge: number
1955
+ snapshot?: RawSnapshotOptions
1956
+ storage?: RawStorageOptions
1957
+ portable?: boolean
1958
+ readonly?: boolean
1959
+ }
1960
+
1961
+ export interface RawCircularCheckRspackPluginOptions {
1962
+ failOnError?: boolean
1963
+ exclude?: RegExp
1964
+ include?: RegExp
1965
+ onDetected?: (module: Module, paths: string[]) => void
1966
+ }
1967
+
1968
+ /** Deprecated. Use `RawCircularCheckRspackPluginOptions` instead. */
1883
1969
  export interface RawCircularDependencyRspackPluginOptions {
1884
1970
  failOnError?: boolean
1885
1971
  exclude?: RegExp
@@ -1890,6 +1976,19 @@ export interface RawCircularDependencyRspackPluginOptions {
1890
1976
  onEnd?: () => void
1891
1977
  }
1892
1978
 
1979
+ export interface RawCollectShareEntryPluginOptions {
1980
+ consumes: Array<RawConsumeOptions>
1981
+ filename?: string
1982
+ }
1983
+
1984
+ export interface RawCompactHashedChunkIdsPluginOptions {
1985
+ minLength?: number
1986
+ }
1987
+
1988
+ export interface RawCompactHashedModuleIdsPluginOptions {
1989
+ minLength?: number
1990
+ }
1991
+
1893
1992
  export interface RawCompilerPlatform {
1894
1993
  web?: boolean | null
1895
1994
  browser?: boolean | null
@@ -1910,6 +2009,7 @@ export interface RawConsumeOptions {
1910
2009
  strictVersion: boolean
1911
2010
  singleton: boolean
1912
2011
  eager: boolean
2012
+ treeShakingMode?: string
1913
2013
  }
1914
2014
 
1915
2015
  export interface RawConsumeSharedPluginOptions {
@@ -1930,7 +2030,7 @@ export interface RawContainerPluginOptions {
1930
2030
  export interface RawContainerReferencePluginOptions {
1931
2031
  remoteType: string
1932
2032
  remotes: Array<RawRemoteOptions>
1933
- shareScope?: string | Array<string> | undefined | null
2033
+ shareScope?: string | Array<string>
1934
2034
  enhanced: boolean
1935
2035
  }
1936
2036
 
@@ -2050,16 +2150,19 @@ export interface RawCopyRspackPluginOptions {
2050
2150
  patterns: Array<RawCopyPattern>
2051
2151
  }
2052
2152
 
2053
- export interface RawCssAutoGeneratorOptions {
2054
- exportsConvention?: "as-is" | "camel-case" | "camel-case-only" | "dashes" | "dashes-only"
2055
- exportsOnly?: boolean
2056
- localIdentName?: string
2057
- esModule?: boolean
2058
- }
2059
-
2060
- export interface RawCssAutoParserOptions {
2153
+ export interface RawCssAutoOrModuleParserOptions {
2154
+ exportType?: "link" | "text" | "css-style-sheet" | "style"
2061
2155
  namedExports?: boolean
2062
2156
  url?: boolean
2157
+ import?: boolean
2158
+ resolveImport?: boolean | ((context: { url: string, media: string | undefined, resourcePath: string, supports: string | undefined, layer: string | undefined }) => boolean)
2159
+ animation?: boolean
2160
+ container?: boolean
2161
+ customIdents?: boolean
2162
+ dashedIdents?: boolean
2163
+ function?: boolean
2164
+ grid?: boolean
2165
+ pure?: boolean
2063
2166
  }
2064
2167
 
2065
2168
  export interface RawCssChunkingPluginOptions {
@@ -2086,21 +2189,54 @@ export interface RawCssGeneratorOptions {
2086
2189
  esModule?: boolean
2087
2190
  }
2088
2191
 
2192
+ export interface RawCssImportContext {
2193
+ url: string
2194
+ media?: string
2195
+ resourcePath: string
2196
+ supports?: string
2197
+ layer?: string
2198
+ }
2199
+
2089
2200
  export interface RawCssModuleGeneratorOptions {
2090
2201
  exportsConvention?: "as-is" | "camel-case" | "camel-case-only" | "dashes" | "dashes-only"
2091
2202
  exportsOnly?: boolean
2203
+ localIdentHashDigest?: string
2204
+ localIdentHashDigestLength?: number
2205
+ localIdentHashFunction?: string
2206
+ localIdentHashSalt?: string
2092
2207
  localIdentName?: string
2093
2208
  esModule?: boolean
2094
2209
  }
2095
2210
 
2096
2211
  export interface RawCssModuleParserOptions {
2212
+ exportType?: "link" | "text" | "css-style-sheet" | "style"
2097
2213
  namedExports?: boolean
2098
2214
  url?: boolean
2215
+ import?: boolean
2216
+ resolveImport?: boolean | ((context: { url: string, media: string | undefined, resourcePath: string, supports: string | undefined, layer: string | undefined }) => boolean)
2217
+ animation?: boolean
2218
+ container?: boolean
2219
+ customIdents?: boolean
2220
+ dashedIdents?: boolean
2221
+ function?: boolean
2222
+ grid?: boolean
2099
2223
  }
2100
2224
 
2101
2225
  export interface RawCssParserOptions {
2226
+ exportType?: "link" | "text" | "css-style-sheet" | "style"
2102
2227
  namedExports?: boolean
2103
2228
  url?: boolean
2229
+ import?: boolean
2230
+ resolveImport?: boolean | ((context: { url: string, media: string | undefined, resourcePath: string, supports: string | undefined, layer: string | undefined }) => boolean)
2231
+ }
2232
+
2233
+ export interface RawDeterministicModuleIdsPluginOptions {
2234
+ context?: string
2235
+ test?: (module: Module) => boolean
2236
+ maxLength?: number
2237
+ salt?: number
2238
+ fixedLength?: boolean
2239
+ failOnConflict?: boolean
2104
2240
  }
2105
2241
 
2106
2242
  export interface RawDllEntryPluginOptions {
@@ -2141,32 +2277,41 @@ export interface RawDynamicEntryPluginOptions {
2141
2277
  entry: () => Promise<RawEntryDynamicResult[]>
2142
2278
  }
2143
2279
 
2280
+ export interface RawEnableLibraryPluginOptions {
2281
+ libraryType: string
2282
+ preserveModules?: string
2283
+ splitChunks?: RawSplitChunksOptions
2284
+ }
2285
+
2144
2286
  export interface RawEntryDynamicResult {
2145
2287
  import: Array<string>
2146
2288
  options: JsEntryOptions
2147
2289
  }
2148
2290
 
2149
2291
  export interface RawEnvironment {
2150
- const?: boolean
2151
- methodShorthand?: boolean
2152
- arrowFunction?: boolean
2153
- nodePrefixForCoreModules?: boolean
2154
- asyncFunction?: boolean
2155
- bigIntLiteral?: boolean
2156
- destructuring?: boolean
2157
- document?: boolean
2158
- dynamicImport?: boolean
2159
- forOf?: boolean
2160
- globalThis?: boolean
2161
- module?: boolean
2162
- optionalChaining?: boolean
2163
- templateLiteral?: boolean
2164
- dynamicImportInWorker?: boolean
2165
- importMetaDirnameAndFilename?: boolean
2292
+ const: boolean
2293
+ computedProperty: boolean
2294
+ methodShorthand: boolean
2295
+ arrowFunction: boolean
2296
+ nodePrefixForCoreModules: boolean
2297
+ asyncFunction: boolean
2298
+ bigIntLiteral: boolean
2299
+ destructuring: boolean
2300
+ document: boolean
2301
+ dynamicImport: boolean
2302
+ forOf: boolean
2303
+ globalThis: boolean
2304
+ module: boolean
2305
+ optionalChaining: boolean
2306
+ logicalAssignment: boolean
2307
+ templateLiteral: boolean
2308
+ dynamicImportInWorker: boolean
2309
+ importMetaDirnameAndFilename: boolean
2166
2310
  }
2167
2311
 
2168
2312
  export interface RawEsmLibraryPlugin {
2169
2313
  preserveModules?: string
2314
+ splitChunks?: RawSplitChunksOptions
2170
2315
  }
2171
2316
 
2172
2317
  export interface RawEvalDevToolModulePluginOptions {
@@ -2175,28 +2320,14 @@ export interface RawEvalDevToolModulePluginOptions {
2175
2320
  sourceUrlComment?: string
2176
2321
  }
2177
2322
 
2178
- export interface RawExperimentCacheOptionsPersistent {
2179
- buildDependencies?: Array<string>
2180
- version?: string
2181
- snapshot?: RawExperimentSnapshotOptions
2182
- storage?: RawStorageOptions
2183
- }
2184
-
2185
2323
  export interface RawExperiments {
2186
- topLevelAwait: boolean
2187
- incremental?: false | { [key: string]: boolean }
2188
- rspackFuture?: RawRspackFuture
2189
- cache: boolean | { type: "persistent" } & RawExperimentCacheOptionsPersistent | { type: "memory" }
2190
- useInputFileSystem?: false | Array<RegExp>
2191
- css?: boolean
2192
- lazyBarrel: boolean
2193
- deferImport: boolean
2194
- }
2195
-
2196
- export interface RawExperimentSnapshotOptions {
2197
- immutablePaths: Array<string|RegExp>
2198
- unmanagedPaths: Array<string|RegExp>
2199
- managedPaths: Array<string|RegExp>
2324
+ useInputFileSystem?: false | Array<RegExp>
2325
+ css?: boolean
2326
+ newCache: false | RawNewCache
2327
+ deferImport: boolean
2328
+ sourceImport: boolean
2329
+ pureFunctions: boolean
2330
+ runtimeMode?: "webpack" | "rspack"
2200
2331
  }
2201
2332
 
2202
2333
  export interface RawExposeOptions {
@@ -2219,6 +2350,7 @@ export interface RawExternalItemFnResult {
2219
2350
 
2220
2351
  export interface RawExternalsPluginOptions {
2221
2352
  type: string
2353
+ fallbackType?: string
2222
2354
  externals: (string | RegExp | Record<string, string | boolean | string[] | Record<string, string[]>> | ((...args: any[]) => any))[]
2223
2355
  placeInInitial: boolean
2224
2356
  }
@@ -2261,16 +2393,24 @@ export interface RawFuncUseCtx {
2261
2393
  }
2262
2394
 
2263
2395
  export interface RawGeneratorOptions {
2264
- type: "asset" | "asset/inline" | "asset/resource" | "css" | "css/auto" | "css/module" | "json"
2396
+ type: "asset" | "asset/inline" | "asset/resource" | "css" | "css/auto" | "css/global" | "css/module" | "json"
2265
2397
  asset?: RawAssetGeneratorOptions
2266
2398
  assetInline?: RawAssetInlineGeneratorOptions
2267
2399
  assetResource?: RawAssetResourceGeneratorOptions
2268
2400
  css?: RawCssGeneratorOptions
2269
- cssAuto?: RawCssAutoGeneratorOptions
2401
+ cssAuto?: RawCssModuleGeneratorOptions
2402
+ cssGlobal?: RawCssModuleGeneratorOptions
2270
2403
  cssModule?: RawCssModuleGeneratorOptions
2271
2404
  json?: RawJsonGeneratorOptions
2272
2405
  }
2273
2406
 
2407
+ export interface RawHashedModuleIdsPluginOptions {
2408
+ context?: string
2409
+ hashFunction?: string
2410
+ hashDigest?: string
2411
+ hashDigestLength?: number
2412
+ }
2413
+
2274
2414
  export interface RawHtmlRspackPluginBaseOptions {
2275
2415
  href?: string
2276
2416
  target?: "_self" | "_blank" | "_parent" | "_top"
@@ -2294,7 +2434,6 @@ export interface RawHtmlRspackPluginOptions {
2294
2434
  chunks?: Array<string>
2295
2435
  excludeChunks?: Array<string>
2296
2436
  chunksSortMode: "auto" | "manual"
2297
- sri?: "sha256" | "sha384" | "sha512"
2298
2437
  minify?: boolean
2299
2438
  title?: string
2300
2439
  favicon?: string
@@ -2305,7 +2444,6 @@ export interface RawHtmlRspackPluginOptions {
2305
2444
  }
2306
2445
 
2307
2446
  export interface RawHttpExternalsRspackPluginOptions {
2308
- css: boolean
2309
2447
  webAsync: boolean
2310
2448
  }
2311
2449
 
@@ -2325,12 +2463,11 @@ export interface RawIgnorePluginOptions {
2325
2463
 
2326
2464
  export interface RawIncremental {
2327
2465
  silent: boolean
2328
- make: boolean
2329
- inferAsyncModules: boolean
2330
- providedExports: boolean
2331
- dependenciesDiagnostics: boolean
2332
- sideEffects: boolean
2466
+ buildModuleGraph: boolean
2467
+ finishModules: boolean
2468
+ optimizeDependencies: boolean
2333
2469
  buildChunkGraph: boolean
2470
+ optimizeChunkModules: boolean
2334
2471
  moduleIds: boolean
2335
2472
  chunkIds: boolean
2336
2473
  modulesHashes: boolean
@@ -2338,7 +2475,7 @@ export interface RawIncremental {
2338
2475
  modulesRuntimeRequirements: boolean
2339
2476
  chunksRuntimeRequirements: boolean
2340
2477
  chunksHashes: boolean
2341
- chunksRender: boolean
2478
+ chunkAsset: boolean
2342
2479
  emitAssets: boolean
2343
2480
  }
2344
2481
 
@@ -2383,41 +2520,44 @@ export interface RawJavascriptParserOptions {
2383
2520
  exprContextCritical?: boolean
2384
2521
  unknownContextCritical?: boolean
2385
2522
  wrappedContextCritical?: boolean
2523
+ strictThisContextOnImports?: boolean
2386
2524
  wrappedContextRegExp?: RegExp
2387
2525
  exportsPresence?: string
2388
2526
  importExportsPresence?: string
2389
2527
  reexportExportsPresence?: string
2390
- strictExportPresence?: boolean
2391
- worker?: Array<string>
2528
+ worker?: boolean | Array<string> | RawJavascriptParserWorkerOptions
2392
2529
  overrideStrict?: string
2393
- importMeta?: boolean
2394
- /**
2395
- * This option is experimental in Rspack only and subject to change or be removed anytime.
2396
- * @experimental
2397
- */
2398
- requireAlias?: boolean
2399
- /**
2400
- * This option is experimental in Rspack only and subject to change or be removed anytime.
2401
- * @experimental
2402
- */
2403
- requireAsExpression?: boolean
2404
- /**
2405
- * This option is experimental in Rspack only and subject to change or be removed anytime.
2406
- * @experimental
2407
- */
2408
- requireDynamic?: boolean
2409
- /**
2410
- * This option is experimental in Rspack only and subject to change or be removed anytime.
2411
- * @experimental
2412
- */
2413
- requireResolve?: boolean
2530
+ importMeta?: string | Record<string, boolean>
2531
+ commonjsMagicComments?: boolean
2532
+ createRequire?: boolean | string
2414
2533
  commonjs?: boolean | { exports?: boolean | 'skipInEsm' }
2534
+ deferImport?: boolean
2535
+ sourceImport?: boolean
2536
+ /**
2537
+ * This option is experimental in Rspack only and subject to change or be removed anytime.
2538
+ * @experimental
2539
+ */
2540
+ requireAlias?: boolean
2541
+ /**
2542
+ * This option is experimental in Rspack only and subject to change or be removed anytime.
2543
+ * @experimental
2544
+ */
2545
+ requireAsExpression?: boolean
2546
+ /**
2547
+ * This option is experimental in Rspack only and subject to change or be removed anytime.
2548
+ * @experimental
2549
+ */
2550
+ requireDynamic?: boolean
2551
+ /**
2552
+ * This option is experimental in Rspack only and subject to change or be removed anytime.
2553
+ * @experimental
2554
+ */
2555
+ requireResolve?: boolean
2415
2556
  /**
2416
2557
  * This option is experimental in Rspack only and subject to change or be removed anytime.
2417
2558
  * @experimental
2418
2559
  */
2419
2560
  importDynamic?: boolean
2420
- commonjsMagicComments?: boolean
2421
2561
  /**
2422
2562
  * This option is experimental in Rspack only and subject to change or be removed anytime.
2423
2563
  * @experimental
@@ -2428,7 +2568,22 @@ typeReexportsPresence?: string
2428
2568
  * @experimental
2429
2569
  */
2430
2570
  jsx?: boolean
2431
- deferImport?: boolean
2571
+ /**
2572
+ * This option is experimental in Rspack only and subject to change or be removed anytime.
2573
+ * @experimental
2574
+ */
2575
+ importMetaResolve?: boolean
2576
+ /**
2577
+ * Flag top-level exported functions as side-effect-free for pure-function-based tree shaking.
2578
+ * This option is experimental in Rspack only and subject to change or be removed anytime.
2579
+ * @experimental
2580
+ */
2581
+ pureFunctions?: Array<string>
2582
+ }
2583
+
2584
+ export interface RawJavascriptParserWorkerOptions {
2585
+ alias?: Array<string>
2586
+ url?: string
2432
2587
  }
2433
2588
 
2434
2589
  export interface RawJsonGeneratorOptions {
@@ -2446,6 +2601,7 @@ export interface RawLazyCompilationOption {
2446
2601
  entries: boolean
2447
2602
  imports: boolean
2448
2603
  client: string
2604
+ reservedExternals: Array<string>
2449
2605
  }
2450
2606
 
2451
2607
  export interface RawLibManifestPluginOptions {
@@ -2471,10 +2627,9 @@ export interface RawLightningCssBrowsers {
2471
2627
 
2472
2628
  export interface RawLightningCssMinimizerOptions {
2473
2629
  errorRecovery: boolean
2474
- targets?: Array<string>
2630
+ targets?: string[] | RawLightningCssBrowsers
2475
2631
  include?: number
2476
2632
  exclude?: number
2477
- draft?: RawDraft
2478
2633
  drafts?: RawDraft
2479
2634
  nonStandard?: RawNonStandard
2480
2635
  pseudoClasses?: RawLightningCssPseudoClasses
@@ -2563,7 +2718,6 @@ export interface RawModuleOptions {
2563
2718
  parser?: Record<string, RawParserOptions>
2564
2719
  generator?: Record<string, RawGeneratorOptions>
2565
2720
  noParse?: string | RegExp | ((request: string) => boolean) | (string | RegExp | ((request: string) => boolean))[]
2566
- unsafeCache?: boolean | RegExp
2567
2721
  }
2568
2722
 
2569
2723
  export interface RawModuleRule {
@@ -2595,6 +2749,7 @@ export interface RawModuleRule {
2595
2749
  issuer?: RawRuleSetCondition
2596
2750
  issuerLayer?: RawRuleSetCondition
2597
2751
  dependency?: RawRuleSetCondition
2752
+ phase?: RawRuleSetCondition
2598
2753
  scheme?: RawRuleSetCondition
2599
2754
  mimetype?: RawRuleSetCondition
2600
2755
  oneOf?: Array<RawModuleRule>
@@ -2617,6 +2772,15 @@ export interface RawModuleRule {
2617
2772
  export interface RawModuleRuleUse {
2618
2773
  loader: string
2619
2774
  options?: string
2775
+ cache: boolean
2776
+ optionsCacheKey: string
2777
+ }
2778
+
2779
+ export interface RawNewCache {
2780
+ codeGeneration: boolean
2781
+ devtool: boolean
2782
+ loader: boolean
2783
+ minimize: boolean
2620
2784
  }
2621
2785
 
2622
2786
  export interface RawNodeOption {
@@ -2639,7 +2803,6 @@ export interface RawOccurrenceChunkIdsPluginOptions {
2639
2803
  }
2640
2804
 
2641
2805
  export interface RawOptimizationOptions {
2642
- removeAvailableModules: boolean
2643
2806
  sideEffects: boolean | string
2644
2807
  usedExports: boolean | string
2645
2808
  providedExports: boolean
@@ -2651,6 +2814,12 @@ export interface RawOptimizationOptions {
2651
2814
  avoidEntryIife: boolean
2652
2815
  }
2653
2816
 
2817
+ export interface RawOptimizeSharedConfig {
2818
+ shareKey: string
2819
+ treeShaking: boolean
2820
+ usedExports?: Array<string>
2821
+ }
2822
+
2654
2823
  export interface RawOptions {
2655
2824
  name?: string
2656
2825
  mode?: undefined | 'production' | 'development' | 'none'
@@ -2661,14 +2830,14 @@ export interface RawOptions {
2661
2830
  module: RawModuleOptions
2662
2831
  optimization: RawOptimizationOptions
2663
2832
  stats: RawStatsOptions
2664
- cache: RawCacheOptions
2833
+ cache: boolean | { type: "memory" } | ({ type: "persistent" } & RawCacheOptionsPersistent)
2665
2834
  experiments: RawExperiments
2666
- node?: RawNodeOption
2667
- profile: boolean
2668
- amd?: string
2669
- bail: boolean
2670
- __references: Record<string, any>
2671
- __virtual_files?: Array<JsVirtualFile>
2835
+ incremental?: false | { [key: string]: boolean }
2836
+ node?: RawNodeOption
2837
+ amd?: string
2838
+ bail: boolean
2839
+ __references: Record<string, any>
2840
+ __virtual_files?: Array<JsVirtualFile>
2672
2841
  }
2673
2842
 
2674
2843
  export interface RawOutputOptions {
@@ -2678,6 +2847,7 @@ export interface RawOutputOptions {
2678
2847
  publicPath: "auto" | JsFilename
2679
2848
  assetModuleFilename: JsFilename
2680
2849
  wasmLoading: string | false
2850
+ wasmStreamingFallback: boolean
2681
2851
  enabledWasmLoadingTypes: Array<string>
2682
2852
  webassemblyModuleFilename: string
2683
2853
  filename: JsFilename
@@ -2700,7 +2870,6 @@ export interface RawOutputOptions {
2700
2870
  module: boolean
2701
2871
  chunkLoading: string | false
2702
2872
  chunkLoadTimeout: number
2703
- charset: boolean
2704
2873
  enabledChunkLoadingTypes?: Array<string>
2705
2874
  trustedTypes?: RawTrustedTypes
2706
2875
  sourceMapFilename: string
@@ -2718,11 +2887,12 @@ export interface RawOutputOptions {
2718
2887
  }
2719
2888
 
2720
2889
  export interface RawParserOptions {
2721
- type: "asset" | "css" | "css/auto" | "css/module" | "javascript" | "javascript/auto" | "javascript/dynamic" | "javascript/esm" | "json"
2890
+ type: "asset" | "css" | "css/auto" | "css/global" | "css/module" | "javascript" | "javascript/auto" | "javascript/dynamic" | "javascript/esm" | "json"
2722
2891
  asset?: RawAssetParserOptions
2723
2892
  css?: RawCssParserOptions
2724
- cssAuto?: RawCssAutoParserOptions
2725
- cssModule?: RawCssModuleParserOptions
2893
+ cssAuto?: RawCssAutoOrModuleParserOptions
2894
+ cssGlobal?: RawCssModuleParserOptions
2895
+ cssModule?: RawCssAutoOrModuleParserOptions
2726
2896
  javascript?: RawJavascriptParserOptions
2727
2897
  json?: RawJsonParserOptions
2728
2898
  }
@@ -2733,13 +2903,20 @@ export interface RawPathData {
2733
2903
  url?: string
2734
2904
  }
2735
2905
 
2906
+ export interface RawProgressPluginHandlerInfo {
2907
+ /** Number of built modules */
2908
+ builtModules: number
2909
+ /** Identifier of the active module (only provided during `build modules` updates) */
2910
+ moduleIdentifier?: string
2911
+ }
2912
+
2736
2913
  export interface RawProgressPluginOptions {
2737
2914
  prefix?: string
2738
2915
  profile?: boolean
2739
2916
  template?: string
2740
2917
  tick?: string | Array<string>
2741
2918
  progressChars?: string
2742
- handler?: (percent: number, msg: string, items: string[]) => void
2919
+ handler?: (percent: number, msg: string, info: RawProgressPluginHandlerInfo) => void
2743
2920
  }
2744
2921
 
2745
2922
  export interface RawProvideOptions {
@@ -2751,6 +2928,7 @@ export interface RawProvideOptions {
2751
2928
  singleton?: boolean
2752
2929
  requiredVersion?: string | false | undefined
2753
2930
  strictVersion?: boolean
2931
+ treeShakingMode?: string
2754
2932
  }
2755
2933
 
2756
2934
  export interface RawRelated {
@@ -2830,6 +3008,7 @@ export interface RawRsdoctorPluginOptions {
2830
3008
  moduleGraphFeatures: boolean | Array<'graph' | 'ids' | 'sources'>
2831
3009
  chunkGraphFeatures: boolean | Array<'graph' | 'assets'>
2832
3010
  sourceMapFeatures?: { module?: boolean; cheap?: boolean } | undefined
3011
+ exportUsageGraph?: boolean
2833
3012
  }
2834
3013
 
2835
3014
  export interface RawRslibPluginOptions {
@@ -2843,10 +3022,17 @@ export interface RawRslibPluginOptions {
2843
3022
  * @default `false`
2844
3023
  */
2845
3024
  forceNodeShims?: boolean
3025
+ /**
3026
+ * Auto downgrade module external type to node-commonjs for CJS require of node builtins
3027
+ * @default `false`
3028
+ */
3029
+ autoCjsNodeBuiltin?: boolean
3030
+ /** Emit isolated declaration files for modules transformed by `builtin:swc-loader` */
3031
+ emitDts?: RawSwcEmitDtsOptions
2846
3032
  }
2847
3033
 
2848
- export interface RawRspackFuture {
2849
-
3034
+ export interface RawRstestDynamicImportOriginOptions {
3035
+ functionName?: string
2850
3036
  }
2851
3037
 
2852
3038
  export interface RawRstestPluginOptions {
@@ -2855,6 +3041,18 @@ export interface RawRstestPluginOptions {
2855
3041
  hoistMockModule: boolean
2856
3042
  manualMockRoot: string
2857
3043
  preserveNewUrl?: Array<string>
3044
+ globals?: boolean
3045
+ /**
3046
+ * Replaces each `import.meta.rstest` with
3047
+ * `globalThis['@rstest/core/import-meta']?.(<absolute source path>)`.
3048
+ */
3049
+ injectImportMetaRstestOrigin?: boolean
3050
+ injectDynamicImportOrigin?: boolean | { functionName?: string }
3051
+ injectRequireResolveOrigin?: boolean | { functionName?: string }
3052
+ }
3053
+
3054
+ export interface RawRstestRequireResolveOriginOptions {
3055
+ functionName?: string
2858
3056
  }
2859
3057
 
2860
3058
  export interface RawRuleSetCondition {
@@ -2888,6 +3086,21 @@ export interface RawRuntimeChunkOptions {
2888
3086
  name: string | ((entrypoint: { name: string }) => string)
2889
3087
  }
2890
3088
 
3089
+ export interface RawSharedContainerPluginOptions {
3090
+ name: string
3091
+ request: string
3092
+ version: string
3093
+ fileName?: string
3094
+ library: JsLibraryOptions
3095
+ }
3096
+
3097
+ export interface RawSharedUsedExportsOptimizerPluginOptions {
3098
+ shared: Array<RawOptimizeSharedConfig>
3099
+ injectTreeShakingUsedExports?: boolean
3100
+ manifestFileName?: string
3101
+ statsFileName?: string
3102
+ }
3103
+
2891
3104
  export interface RawSizeLimitsPluginOptions {
2892
3105
  assetFilter?: (assetFilename: string) => boolean
2893
3106
  hints?: "error" | "warning"
@@ -2895,13 +3108,20 @@ export interface RawSizeLimitsPluginOptions {
2895
3108
  maxEntrypointSize?: number
2896
3109
  }
2897
3110
 
3111
+ export interface RawSnapshotOptions {
3112
+ immutablePaths: Array<string|RegExp>
3113
+ unmanagedPaths: Array<string|RegExp>
3114
+ managedPaths: Array<string|RegExp>
3115
+ }
3116
+
2898
3117
  export interface RawSplitChunkSizes {
2899
3118
  sizes: Record<string, number>
2900
3119
  }
2901
3120
 
2902
3121
  export interface RawSplitChunksOptions {
2903
3122
  fallbackCacheGroup?: RawFallbackCacheGroupOptions
2904
- name?: string | false | Function
3123
+ name?: string | false | ((ctx: JsChunkOptionNameCtx) => string | undefined)
3124
+ nameBatch?: ((batch: JsChunkOptionNameBatch) => (string | undefined)[])
2905
3125
  filename?: JsFilename
2906
3126
  cacheGroups?: Array<RawCacheGroupOptions>
2907
3127
  /** What kind of chunks should be selected. */
@@ -2915,7 +3135,7 @@ export interface RawSplitChunksOptions {
2915
3135
  hidePathInfo?: boolean
2916
3136
  minSize?: number | RawSplitChunkSizes
2917
3137
  minSizeReduction?: number | RawSplitChunkSizes
2918
- enforceSizeThreshold?: number
3138
+ enforceSizeThreshold?: number | RawSplitChunkSizes
2919
3139
  minRemainingSize?: number | RawSplitChunkSizes
2920
3140
  maxSize?: number | RawSplitChunkSizes
2921
3141
  maxAsyncSize?: number | RawSplitChunkSizes
@@ -2925,6 +3145,8 @@ export interface RawSplitChunksOptions {
2925
3145
  export interface RawStatsBuildInfo {
2926
3146
  buildVersion: string
2927
3147
  buildName?: string
3148
+ target?: Array<string>
3149
+ plugins?: Array<string>
2928
3150
  }
2929
3151
 
2930
3152
  export interface RawStatsOptions {
@@ -2942,6 +3164,11 @@ export interface RawSubresourceIntegrityPluginOptions {
2942
3164
  htmlPlugin: "JavaScript" | "Native" | "Disabled"
2943
3165
  }
2944
3166
 
3167
+ export interface RawSwcEmitDtsOptions {
3168
+ rootDir: string
3169
+ declarationDir: string
3170
+ }
3171
+
2945
3172
  export interface RawSwcJsMinimizerOptions {
2946
3173
  ecma: any
2947
3174
  compress: any
@@ -2959,6 +3186,20 @@ export interface RawSwcJsMinimizerRspackPluginOptions {
2959
3186
  minimizerOptions: RawSwcJsMinimizerOptions
2960
3187
  }
2961
3188
 
3189
+ export declare enum RawSyncModuleIdsPluginMode {
3190
+ Read = 'read',
3191
+ Create = 'create',
3192
+ Merge = 'merge',
3193
+ Update = 'update'
3194
+ }
3195
+
3196
+ export interface RawSyncModuleIdsPluginOptions {
3197
+ path: string
3198
+ context?: string
3199
+ test?: (module: Module) => boolean
3200
+ mode?: 'read' | 'create' | 'merge' | 'update'
3201
+ }
3202
+
2962
3203
  export interface RawToOptions {
2963
3204
  context: string
2964
3205
  absoluteFilename?: string
@@ -2985,8 +3226,7 @@ export interface RealDependencyLocation {
2985
3226
  end?: SourcePosition
2986
3227
  }
2987
3228
 
2988
- /**
2989
- * this is a process level tracing, which means it would be shared by all compilers in the same process
3229
+ /** * this is a process level tracing, which means it would be shared by all compilers in the same process
2990
3230
  * only the first call would take effect, the following calls would be ignored
2991
3231
  * Some code is modified based on
2992
3232
  * https://github.com/swc-project/swc/blob/d1d0607158ab40463d1b123fed52cc526eba8385/bindings/binding_core_node/src/util.rs#L29-L58
@@ -3001,53 +3241,56 @@ export declare enum RegisterJsTapKind {
3001
3241
  CompilerCompilation = 1,
3002
3242
  CompilerMake = 2,
3003
3243
  CompilerFinishMake = 3,
3004
- CompilerShouldEmit = 4,
3005
- CompilerEmit = 5,
3006
- CompilerAfterEmit = 6,
3007
- CompilerAssetEmitted = 7,
3008
- CompilationBuildModule = 8,
3009
- CompilationStillValidModule = 9,
3010
- CompilationSucceedModule = 10,
3011
- CompilationExecuteModule = 11,
3012
- CompilationFinishModules = 12,
3013
- CompilationOptimizeModules = 13,
3014
- CompilationAfterOptimizeModules = 14,
3015
- CompilationOptimizeTree = 15,
3016
- CompilationOptimizeChunkModules = 16,
3017
- CompilationBeforeModuleIds = 17,
3018
- CompilationAdditionalTreeRuntimeRequirements = 18,
3019
- CompilationRuntimeRequirementInTree = 19,
3020
- CompilationRuntimeModule = 20,
3021
- CompilationChunkHash = 21,
3022
- CompilationChunkAsset = 22,
3023
- CompilationProcessAssets = 23,
3024
- CompilationAfterProcessAssets = 24,
3025
- CompilationSeal = 25,
3026
- CompilationAfterSeal = 26,
3027
- NormalModuleFactoryBeforeResolve = 27,
3028
- NormalModuleFactoryFactorize = 28,
3029
- NormalModuleFactoryResolve = 29,
3030
- NormalModuleFactoryAfterResolve = 30,
3031
- NormalModuleFactoryCreateModule = 31,
3032
- NormalModuleFactoryResolveForScheme = 32,
3033
- ContextModuleFactoryBeforeResolve = 33,
3034
- ContextModuleFactoryAfterResolve = 34,
3035
- JavascriptModulesChunkHash = 35,
3036
- HtmlPluginBeforeAssetTagGeneration = 36,
3037
- HtmlPluginAlterAssetTags = 37,
3038
- HtmlPluginAlterAssetTagGroups = 38,
3039
- HtmlPluginAfterTemplateExecution = 39,
3040
- HtmlPluginBeforeEmit = 40,
3041
- HtmlPluginAfterEmit = 41,
3042
- RuntimePluginCreateScript = 42,
3043
- RuntimePluginCreateLink = 43,
3044
- RuntimePluginLinkPreload = 44,
3045
- RuntimePluginLinkPrefetch = 45,
3046
- RsdoctorPluginModuleGraph = 46,
3047
- RsdoctorPluginChunkGraph = 47,
3048
- RsdoctorPluginModuleIds = 48,
3049
- RsdoctorPluginModuleSources = 49,
3050
- RsdoctorPluginAssets = 50
3244
+ CompilerAfterCompile = 4,
3245
+ CompilerShouldEmit = 5,
3246
+ CompilerEmit = 6,
3247
+ CompilerAfterEmit = 7,
3248
+ CompilerAssetEmitted = 8,
3249
+ CompilationBuildModule = 9,
3250
+ CompilationStillValidModule = 10,
3251
+ CompilationSucceedModule = 11,
3252
+ CompilationExecuteModule = 12,
3253
+ CompilationFinishModules = 13,
3254
+ CompilationOptimizeModules = 14,
3255
+ CompilationAfterOptimizeModules = 15,
3256
+ CompilationOptimizeTree = 16,
3257
+ CompilationOptimizeChunkModules = 17,
3258
+ CompilationBeforeModuleIds = 18,
3259
+ CompilationAdditionalTreeRuntimeRequirements = 19,
3260
+ CompilationRuntimeRequirementInTree = 20,
3261
+ CompilationRuntimeModule = 21,
3262
+ CompilationChunkHash = 22,
3263
+ CompilationChunkAsset = 23,
3264
+ CompilationProcessAssets = 24,
3265
+ CompilationAfterProcessAssets = 25,
3266
+ CompilationSeal = 26,
3267
+ CompilationAfterSeal = 27,
3268
+ NormalModuleFactoryBeforeResolve = 28,
3269
+ NormalModuleFactoryFactorize = 29,
3270
+ NormalModuleFactoryResolve = 30,
3271
+ NormalModuleFactoryAfterResolve = 31,
3272
+ NormalModuleFactoryCreateModule = 32,
3273
+ NormalModuleFactoryResolveForScheme = 33,
3274
+ ContextModuleFactoryBeforeResolve = 34,
3275
+ ContextModuleFactoryAfterResolve = 35,
3276
+ ExternalModuleChunkCondition = 36,
3277
+ JavascriptModulesChunkHash = 37,
3278
+ HtmlPluginBeforeAssetTagGeneration = 38,
3279
+ HtmlPluginAlterAssetTags = 39,
3280
+ HtmlPluginAlterAssetTagGroups = 40,
3281
+ HtmlPluginAfterTemplateExecution = 41,
3282
+ HtmlPluginBeforeEmit = 42,
3283
+ HtmlPluginAfterEmit = 43,
3284
+ RuntimePluginCreateScript = 44,
3285
+ RuntimePluginCreateLink = 45,
3286
+ RuntimePluginLinkPreload = 46,
3287
+ RuntimePluginLinkPrefetch = 47,
3288
+ RealContentHashPluginUpdateHash = 48,
3289
+ RsdoctorPluginModuleGraph = 49,
3290
+ RsdoctorPluginChunkGraph = 50,
3291
+ RsdoctorPluginModuleIds = 51,
3292
+ RsdoctorPluginModuleSources = 52,
3293
+ RsdoctorPluginAssets = 53
3051
3294
  }
3052
3295
 
3053
3296
  export interface RegisterJsTaps {
@@ -3055,6 +3298,7 @@ export interface RegisterJsTaps {
3055
3298
  registerCompilerCompilationTaps: (stages: Array<number>) => Array<{ function: ((arg: JsCompilation) => void); stage: number; }>
3056
3299
  registerCompilerMakeTaps: (stages: Array<number>) => Array<{ function: ((arg: JsCompilation) => Promise<void>); stage: number; }>
3057
3300
  registerCompilerFinishMakeTaps: (stages: Array<number>) => Array<{ function: ((arg: JsCompilation) => void); stage: number; }>
3301
+ registerCompilerAfterCompileTaps: (stages: Array<number>) => Array<{ function: ((arg: JsCompilation) => Promise<void>); stage: number; }>
3058
3302
  registerCompilerShouldEmitTaps: (stages: Array<number>) => Array<{ function: ((arg: JsCompilation) => boolean | undefined); stage: number; }>
3059
3303
  registerCompilerEmitTaps: (stages: Array<number>) => Array<{ function: (() => Promise<void>); stage: number; }>
3060
3304
  registerCompilerAfterEmitTaps: (stages: Array<number>) => Array<{ function: (() => Promise<void>); stage: number; }>
@@ -3086,6 +3330,7 @@ export interface RegisterJsTaps {
3086
3330
  registerNormalModuleFactoryCreateModuleTaps: (stages: Array<number>) => Array<{ function: ((arg: JsNormalModuleFactoryCreateModuleArgs) => Promise<void>); stage: number; }>
3087
3331
  registerContextModuleFactoryBeforeResolveTaps: (stages: Array<number>) => Array<{ function: ((arg: false | JsContextModuleFactoryBeforeResolveData) => Promise<false | JsContextModuleFactoryBeforeResolveData>); stage: number; }>
3088
3332
  registerContextModuleFactoryAfterResolveTaps: (stages: Array<number>) => Array<{ function: ((arg: false | JsContextModuleFactoryAfterResolveData) => Promise<false | JsContextModuleFactoryAfterResolveData>); stage: number; }>
3333
+ registerExternalModuleChunkConditionTaps: (stages: Array<number>) => Array<{ function: ((chunk: Chunk) => boolean | undefined); stage: number; }>
3089
3334
  registerJavascriptModulesChunkHashTaps: (stages: Array<number>) => Array<{ function: ((arg: Chunk) => Buffer); stage: number; }>
3090
3335
  registerHtmlPluginBeforeAssetTagGenerationTaps: (stages: Array<number>) => Array<{ function: ((arg: JsBeforeAssetTagGenerationData) => JsBeforeAssetTagGenerationData); stage: number; }>
3091
3336
  registerHtmlPluginAlterAssetTagsTaps: (stages: Array<number>) => Array<{ function: ((arg: JsAlterAssetTagsData) => JsAlterAssetTagsData); stage: number; }>
@@ -3097,6 +3342,7 @@ export interface RegisterJsTaps {
3097
3342
  registerRuntimePluginCreateLinkTaps: (stages: Array<number>) => Array<{ function: ((arg: JsLinkPreloadData) => String); stage: number; }>
3098
3343
  registerRuntimePluginLinkPreloadTaps: (stages: Array<number>) => Array<{ function: ((arg: JsCreateLinkData) => String); stage: number; }>
3099
3344
  registerRuntimePluginLinkPrefetchTaps: (stages: Array<number>) => Array<{ function: ((arg: JsLinkPrefetchData) => String); stage: number; }>
3345
+ registerRealContentHashPluginUpdateHashTaps: (stages: Array<number>) => Array<{ function: ((data: JsRealContentHashPluginUpdateHashData) => string | undefined); stage: number; }>
3100
3346
  registerRsdoctorPluginModuleGraphTaps: (stages: Array<number>) => Array<{ function: ((arg: JsRsdoctorModuleGraph) => Promise<boolean | undefined>); stage: number; }>
3101
3347
  registerRsdoctorPluginChunkGraphTaps: (stages: Array<number>) => Array<{ function: ((arg: JsRsdoctorChunkGraph) => Promise<boolean | undefined>); stage: number; }>
3102
3348
  registerRsdoctorPluginModuleIdsTaps: (stages: Array<number>) => Array<{ function: ((arg: JsRsdoctorModuleIdsPatch) => Promise<boolean | undefined>); stage: number; }>
@@ -3198,7 +3444,7 @@ export interface TsconfigOptions {
3198
3444
  */
3199
3445
  configFile: string
3200
3446
  /**
3201
- * Support for Typescript Project References.
3447
+ * Support for TypeScript Project References.
3202
3448
  *
3203
3449
  * * `'auto'`: use the `references` field from tsconfig of `config_file`.
3204
3450
  * * `string[]`: manually provided relative or absolute path.