@ohos-ports/rspack-binding 1.7.11-beta.1 → 2.2.2-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[]
@@ -301,7 +309,7 @@ export declare class JsCompilation {
301
309
  getWarnings(): Array<RspackError>
302
310
  getStats(): JsStats
303
311
  getAssetPath(filename: string, data: JsPathData): string
304
- getAssetPathWithInfo(filename: string, data: JsPathData): PathWithInfo
312
+ getAssetPathWithInfo(filename: string, data: JsPathData, assetInfo?: AssetInfo | undefined | null): PathWithInfo
305
313
  getPath(filename: string, data: JsPathData): string
306
314
  getPathWithInfo(filename: string, data: JsPathData): PathWithInfo
307
315
  addFileDependencies(deps: Array<string>): void
@@ -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, infrastructureLogCallback: (logs: JsLog[]) => void)
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): Promise<JsLoaderCacheEntry | null>
412
+ store(loaderIndex: number, output: JsLoaderCacheEntry): Promise<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
@@ -421,7 +440,7 @@ export declare class JsResolverFactory {
421
440
 
422
441
  export declare class JsStats {
423
442
  toJson(jsOptions: JsStatsOptions): JsStatsCompilation
424
- getLogging(acceptedTypes: number): Array<JsStatsLogging>
443
+ getLogging(acceptedTypes: number): Array<JsLog>
425
444
  }
426
445
 
427
446
  export declare class KnownBuildInfo {
@@ -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
@@ -972,6 +1008,13 @@ export declare enum JsLoaderState {
972
1008
  Normal = 'Normal'
973
1009
  }
974
1010
 
1011
+ export interface JsLog {
1012
+ name: string
1013
+ type: string
1014
+ args: Array<string | number>
1015
+ trace?: Array<string>
1016
+ }
1017
+
975
1018
  export interface JsModuleDescriptor {
976
1019
  identifier: string
977
1020
  name: string
@@ -1003,13 +1046,18 @@ export interface JsPathData {
1003
1046
  runtime?: string
1004
1047
  url?: string
1005
1048
  id?: string
1006
- chunk?: JsPathDataChunkLike
1049
+ chunk?: Chunk | JsPathDataChunkLike
1007
1050
  }
1008
1051
 
1009
1052
  export interface JsPathDataChunkLike {
1053
+ id?: string | number
1010
1054
  name?: string
1011
1055
  hash?: string
1012
- id?: string
1056
+ }
1057
+
1058
+ export interface JsRealContentHashPluginUpdateHashData {
1059
+ assets: Array<Buffer>
1060
+ oldHash: string
1013
1061
  }
1014
1062
 
1015
1063
  export interface JsResolveData {
@@ -1040,6 +1088,22 @@ export interface JsResourceData {
1040
1088
  descriptionFilePath?: string
1041
1089
  }
1042
1090
 
1091
+ export interface JsRscClientPluginOptions {
1092
+ coordinator: JsCoordinator
1093
+ }
1094
+
1095
+ export interface JsRscCssLinkOptions {
1096
+ precedence?: string | boolean
1097
+ props?: Record<string, string>
1098
+ }
1099
+
1100
+ export interface JsRscServerPluginOptions {
1101
+ coordinator: JsCoordinator
1102
+ cssLink?: JsRscCssLinkOptions | undefined | null
1103
+ onServerComponentChanges?: (() => void | Promise<void>) | undefined | null
1104
+ onManifest?: ((arg: string) => Promise<undefined>) | undefined | null
1105
+ }
1106
+
1043
1107
  export interface JsRsdoctorAsset {
1044
1108
  ukey: number
1045
1109
  path: string
@@ -1156,6 +1220,7 @@ export interface JsRsdoctorModuleGraph {
1156
1220
  dependencies: Array<JsRsdoctorDependency>
1157
1221
  chunkModules: Array<JsRsdoctorChunkModules>
1158
1222
  connectionsOnlyImports: Array<JsRsdoctorConnectionsOnlyImport>
1223
+ exportUsageEdges: Array<[number, Array<string> | null, number, Array<string> | null, string, string | null]>
1159
1224
  }
1160
1225
 
1161
1226
  export interface JsRsdoctorModuleGraphModule {
@@ -1300,10 +1365,10 @@ export interface JsStatsAsset {
1300
1365
  emitted: boolean
1301
1366
  chunkNames: Array<string>
1302
1367
  chunkIdHints: Array<string>
1303
- chunks: Array<string | undefined | null>
1368
+ chunks: Array<string | number | undefined | null>
1304
1369
  auxiliaryChunkNames: Array<string>
1305
1370
  auxiliaryChunkIdHints: Array<string>
1306
- auxiliaryChunks: Array<string | undefined | null>
1371
+ auxiliaryChunks: Array<string | number | undefined | null>
1307
1372
  }
1308
1373
 
1309
1374
  export interface JsStatsAssetInfo {
@@ -1340,17 +1405,17 @@ export interface JsStatsChunk {
1340
1405
  type: string
1341
1406
  files: Array<string>
1342
1407
  auxiliaryFiles: Array<string>
1343
- id?: string
1408
+ id?: string | number | undefined
1344
1409
  idHints: Array<string>
1345
1410
  hash?: string
1346
1411
  entry: boolean
1347
1412
  initial: boolean
1348
1413
  names: Array<string>
1349
1414
  size: number
1350
- parents?: Array<string>
1351
- children?: Array<string>
1352
- siblings?: Array<string>
1353
- childrenByOrder: Record<string, Array<string>>
1415
+ parents?: Array<string | number> | undefined
1416
+ children?: Array<string | number> | undefined
1417
+ siblings?: Array<string | number> | undefined
1418
+ childrenByOrder: Record<string, Array<string | number>>
1354
1419
  runtime: Array<string>
1355
1420
  reason?: string
1356
1421
  rendered: boolean
@@ -1361,7 +1426,7 @@ export interface JsStatsChunk {
1361
1426
 
1362
1427
  export interface JsStatsChunkGroup {
1363
1428
  name: string
1364
- chunks: Array<string>
1429
+ chunks: Array<string | number>
1365
1430
  assets: Array<JsStatsChunkGroupAsset>
1366
1431
  assetsSize: number
1367
1432
  auxiliaryAssets?: Array<JsStatsChunkGroupAsset>
@@ -1414,13 +1479,6 @@ export interface JsStatsGetAssets {
1414
1479
  assetsByChunkName: Array<JsStatsAssetsByChunkName>
1415
1480
  }
1416
1481
 
1417
- export interface JsStatsLogging {
1418
- name: string
1419
- type: string
1420
- args?: Array<string>
1421
- trace?: Array<string>
1422
- }
1423
-
1424
1482
  export interface JsStatsModule {
1425
1483
  commonAttributes: JsStatsModuleCommonAttributes
1426
1484
  dependent?: boolean
@@ -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,42 @@ 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
1949
+ snapshot?: RawSnapshotOptions
1950
+ }
1951
+
1952
+ export interface RawCacheOptionsPersistent {
1953
+ buildDependencies?: Array<string>
1954
+ version?: string
1955
+ maxAge: number
1956
+ snapshot?: RawSnapshotOptions
1957
+ storage?: RawStorageOptions
1958
+ portable?: boolean
1959
+ readonly?: boolean
1960
+ }
1961
+
1962
+ export interface RawCircularCheckRspackPluginOptions {
1963
+ failOnError?: boolean
1964
+ exclude?: RegExp
1965
+ include?: RegExp
1966
+ onDetected?: (module: Module, paths: string[]) => void
1881
1967
  }
1882
1968
 
1969
+ /** Deprecated. Use `RawCircularCheckRspackPluginOptions` instead. */
1883
1970
  export interface RawCircularDependencyRspackPluginOptions {
1884
1971
  failOnError?: boolean
1885
1972
  exclude?: RegExp
@@ -1890,6 +1977,19 @@ export interface RawCircularDependencyRspackPluginOptions {
1890
1977
  onEnd?: () => void
1891
1978
  }
1892
1979
 
1980
+ export interface RawCollectShareEntryPluginOptions {
1981
+ consumes: Array<RawConsumeOptions>
1982
+ filename?: string
1983
+ }
1984
+
1985
+ export interface RawCompactHashedChunkIdsPluginOptions {
1986
+ minLength?: number
1987
+ }
1988
+
1989
+ export interface RawCompactHashedModuleIdsPluginOptions {
1990
+ minLength?: number
1991
+ }
1992
+
1893
1993
  export interface RawCompilerPlatform {
1894
1994
  web?: boolean | null
1895
1995
  browser?: boolean | null
@@ -1910,6 +2010,7 @@ export interface RawConsumeOptions {
1910
2010
  strictVersion: boolean
1911
2011
  singleton: boolean
1912
2012
  eager: boolean
2013
+ treeShakingMode?: string
1913
2014
  }
1914
2015
 
1915
2016
  export interface RawConsumeSharedPluginOptions {
@@ -1930,7 +2031,7 @@ export interface RawContainerPluginOptions {
1930
2031
  export interface RawContainerReferencePluginOptions {
1931
2032
  remoteType: string
1932
2033
  remotes: Array<RawRemoteOptions>
1933
- shareScope?: string | Array<string> | undefined | null
2034
+ shareScope?: string | Array<string>
1934
2035
  enhanced: boolean
1935
2036
  }
1936
2037
 
@@ -2050,16 +2151,19 @@ export interface RawCopyRspackPluginOptions {
2050
2151
  patterns: Array<RawCopyPattern>
2051
2152
  }
2052
2153
 
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 {
2154
+ export interface RawCssAutoOrModuleParserOptions {
2155
+ exportType?: "link" | "text" | "css-style-sheet" | "style"
2061
2156
  namedExports?: boolean
2062
2157
  url?: boolean
2158
+ import?: boolean
2159
+ resolveImport?: boolean | ((context: { url: string, media: string | undefined, resourcePath: string, supports: string | undefined, layer: string | undefined }) => boolean)
2160
+ animation?: boolean
2161
+ container?: boolean
2162
+ customIdents?: boolean
2163
+ dashedIdents?: boolean
2164
+ function?: boolean
2165
+ grid?: boolean
2166
+ pure?: boolean
2063
2167
  }
2064
2168
 
2065
2169
  export interface RawCssChunkingPluginOptions {
@@ -2086,21 +2190,54 @@ export interface RawCssGeneratorOptions {
2086
2190
  esModule?: boolean
2087
2191
  }
2088
2192
 
2193
+ export interface RawCssImportContext {
2194
+ url: string
2195
+ media?: string
2196
+ resourcePath: string
2197
+ supports?: string
2198
+ layer?: string
2199
+ }
2200
+
2089
2201
  export interface RawCssModuleGeneratorOptions {
2090
2202
  exportsConvention?: "as-is" | "camel-case" | "camel-case-only" | "dashes" | "dashes-only"
2091
2203
  exportsOnly?: boolean
2204
+ localIdentHashDigest?: string
2205
+ localIdentHashDigestLength?: number
2206
+ localIdentHashFunction?: string
2207
+ localIdentHashSalt?: string
2092
2208
  localIdentName?: string
2093
2209
  esModule?: boolean
2094
2210
  }
2095
2211
 
2096
2212
  export interface RawCssModuleParserOptions {
2213
+ exportType?: "link" | "text" | "css-style-sheet" | "style"
2097
2214
  namedExports?: boolean
2098
2215
  url?: boolean
2216
+ import?: boolean
2217
+ resolveImport?: boolean | ((context: { url: string, media: string | undefined, resourcePath: string, supports: string | undefined, layer: string | undefined }) => boolean)
2218
+ animation?: boolean
2219
+ container?: boolean
2220
+ customIdents?: boolean
2221
+ dashedIdents?: boolean
2222
+ function?: boolean
2223
+ grid?: boolean
2099
2224
  }
2100
2225
 
2101
2226
  export interface RawCssParserOptions {
2227
+ exportType?: "link" | "text" | "css-style-sheet" | "style"
2102
2228
  namedExports?: boolean
2103
2229
  url?: boolean
2230
+ import?: boolean
2231
+ resolveImport?: boolean | ((context: { url: string, media: string | undefined, resourcePath: string, supports: string | undefined, layer: string | undefined }) => boolean)
2232
+ }
2233
+
2234
+ export interface RawDeterministicModuleIdsPluginOptions {
2235
+ context?: string
2236
+ test?: (module: Module) => boolean
2237
+ maxLength?: number
2238
+ salt?: number
2239
+ fixedLength?: boolean
2240
+ failOnConflict?: boolean
2104
2241
  }
2105
2242
 
2106
2243
  export interface RawDllEntryPluginOptions {
@@ -2141,32 +2278,41 @@ export interface RawDynamicEntryPluginOptions {
2141
2278
  entry: () => Promise<RawEntryDynamicResult[]>
2142
2279
  }
2143
2280
 
2281
+ export interface RawEnableLibraryPluginOptions {
2282
+ libraryType: string
2283
+ preserveModules?: string
2284
+ splitChunks?: RawSplitChunksOptions
2285
+ }
2286
+
2144
2287
  export interface RawEntryDynamicResult {
2145
2288
  import: Array<string>
2146
2289
  options: JsEntryOptions
2147
2290
  }
2148
2291
 
2149
2292
  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
2293
+ const: boolean
2294
+ computedProperty: boolean
2295
+ methodShorthand: boolean
2296
+ arrowFunction: boolean
2297
+ nodePrefixForCoreModules: boolean
2298
+ asyncFunction: boolean
2299
+ bigIntLiteral: boolean
2300
+ destructuring: boolean
2301
+ document: boolean
2302
+ dynamicImport: boolean
2303
+ forOf: boolean
2304
+ globalThis: boolean
2305
+ module: boolean
2306
+ optionalChaining: boolean
2307
+ logicalAssignment: boolean
2308
+ templateLiteral: boolean
2309
+ dynamicImportInWorker: boolean
2310
+ importMetaDirnameAndFilename: boolean
2166
2311
  }
2167
2312
 
2168
2313
  export interface RawEsmLibraryPlugin {
2169
2314
  preserveModules?: string
2315
+ splitChunks?: RawSplitChunksOptions
2170
2316
  }
2171
2317
 
2172
2318
  export interface RawEvalDevToolModulePluginOptions {
@@ -2175,28 +2321,14 @@ export interface RawEvalDevToolModulePluginOptions {
2175
2321
  sourceUrlComment?: string
2176
2322
  }
2177
2323
 
2178
- export interface RawExperimentCacheOptionsPersistent {
2179
- buildDependencies?: Array<string>
2180
- version?: string
2181
- snapshot?: RawExperimentSnapshotOptions
2182
- storage?: RawStorageOptions
2183
- }
2184
-
2185
2324
  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>
2325
+ useInputFileSystem?: false | Array<RegExp>
2326
+ css?: boolean
2327
+ newCache: false | RawNewCache
2328
+ deferImport: boolean
2329
+ sourceImport: boolean
2330
+ pureFunctions: boolean
2331
+ runtimeMode?: "webpack" | "rspack"
2200
2332
  }
2201
2333
 
2202
2334
  export interface RawExposeOptions {
@@ -2219,6 +2351,7 @@ export interface RawExternalItemFnResult {
2219
2351
 
2220
2352
  export interface RawExternalsPluginOptions {
2221
2353
  type: string
2354
+ fallbackType?: string
2222
2355
  externals: (string | RegExp | Record<string, string | boolean | string[] | Record<string, string[]>> | ((...args: any[]) => any))[]
2223
2356
  placeInInitial: boolean
2224
2357
  }
@@ -2261,16 +2394,24 @@ export interface RawFuncUseCtx {
2261
2394
  }
2262
2395
 
2263
2396
  export interface RawGeneratorOptions {
2264
- type: "asset" | "asset/inline" | "asset/resource" | "css" | "css/auto" | "css/module" | "json"
2397
+ type: "asset" | "asset/inline" | "asset/resource" | "css" | "css/auto" | "css/global" | "css/module" | "json"
2265
2398
  asset?: RawAssetGeneratorOptions
2266
2399
  assetInline?: RawAssetInlineGeneratorOptions
2267
2400
  assetResource?: RawAssetResourceGeneratorOptions
2268
2401
  css?: RawCssGeneratorOptions
2269
- cssAuto?: RawCssAutoGeneratorOptions
2402
+ cssAuto?: RawCssModuleGeneratorOptions
2403
+ cssGlobal?: RawCssModuleGeneratorOptions
2270
2404
  cssModule?: RawCssModuleGeneratorOptions
2271
2405
  json?: RawJsonGeneratorOptions
2272
2406
  }
2273
2407
 
2408
+ export interface RawHashedModuleIdsPluginOptions {
2409
+ context?: string
2410
+ hashFunction?: string
2411
+ hashDigest?: string
2412
+ hashDigestLength?: number
2413
+ }
2414
+
2274
2415
  export interface RawHtmlRspackPluginBaseOptions {
2275
2416
  href?: string
2276
2417
  target?: "_self" | "_blank" | "_parent" | "_top"
@@ -2294,7 +2435,6 @@ export interface RawHtmlRspackPluginOptions {
2294
2435
  chunks?: Array<string>
2295
2436
  excludeChunks?: Array<string>
2296
2437
  chunksSortMode: "auto" | "manual"
2297
- sri?: "sha256" | "sha384" | "sha512"
2298
2438
  minify?: boolean
2299
2439
  title?: string
2300
2440
  favicon?: string
@@ -2305,7 +2445,6 @@ export interface RawHtmlRspackPluginOptions {
2305
2445
  }
2306
2446
 
2307
2447
  export interface RawHttpExternalsRspackPluginOptions {
2308
- css: boolean
2309
2448
  webAsync: boolean
2310
2449
  }
2311
2450
 
@@ -2325,12 +2464,11 @@ export interface RawIgnorePluginOptions {
2325
2464
 
2326
2465
  export interface RawIncremental {
2327
2466
  silent: boolean
2328
- make: boolean
2329
- inferAsyncModules: boolean
2330
- providedExports: boolean
2331
- dependenciesDiagnostics: boolean
2332
- sideEffects: boolean
2467
+ buildModuleGraph: boolean
2468
+ finishModules: boolean
2469
+ optimizeDependencies: boolean
2333
2470
  buildChunkGraph: boolean
2471
+ optimizeChunkModules: boolean
2334
2472
  moduleIds: boolean
2335
2473
  chunkIds: boolean
2336
2474
  modulesHashes: boolean
@@ -2338,7 +2476,7 @@ export interface RawIncremental {
2338
2476
  modulesRuntimeRequirements: boolean
2339
2477
  chunksRuntimeRequirements: boolean
2340
2478
  chunksHashes: boolean
2341
- chunksRender: boolean
2479
+ chunkAsset: boolean
2342
2480
  emitAssets: boolean
2343
2481
  }
2344
2482
 
@@ -2383,41 +2521,44 @@ export interface RawJavascriptParserOptions {
2383
2521
  exprContextCritical?: boolean
2384
2522
  unknownContextCritical?: boolean
2385
2523
  wrappedContextCritical?: boolean
2524
+ strictThisContextOnImports?: boolean
2386
2525
  wrappedContextRegExp?: RegExp
2387
2526
  exportsPresence?: string
2388
2527
  importExportsPresence?: string
2389
2528
  reexportExportsPresence?: string
2390
- strictExportPresence?: boolean
2391
- worker?: Array<string>
2529
+ worker?: boolean | Array<string> | RawJavascriptParserWorkerOptions
2392
2530
  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
2531
+ importMeta?: string | Record<string, boolean>
2532
+ commonjsMagicComments?: boolean
2533
+ createRequire?: boolean | string
2414
2534
  commonjs?: boolean | { exports?: boolean | 'skipInEsm' }
2535
+ deferImport?: boolean
2536
+ sourceImport?: boolean
2537
+ /**
2538
+ * This option is experimental in Rspack only and subject to change or be removed anytime.
2539
+ * @experimental
2540
+ */
2541
+ requireAlias?: boolean
2542
+ /**
2543
+ * This option is experimental in Rspack only and subject to change or be removed anytime.
2544
+ * @experimental
2545
+ */
2546
+ requireAsExpression?: boolean
2547
+ /**
2548
+ * This option is experimental in Rspack only and subject to change or be removed anytime.
2549
+ * @experimental
2550
+ */
2551
+ requireDynamic?: boolean
2552
+ /**
2553
+ * This option is experimental in Rspack only and subject to change or be removed anytime.
2554
+ * @experimental
2555
+ */
2556
+ requireResolve?: boolean
2415
2557
  /**
2416
2558
  * This option is experimental in Rspack only and subject to change or be removed anytime.
2417
2559
  * @experimental
2418
2560
  */
2419
2561
  importDynamic?: boolean
2420
- commonjsMagicComments?: boolean
2421
2562
  /**
2422
2563
  * This option is experimental in Rspack only and subject to change or be removed anytime.
2423
2564
  * @experimental
@@ -2428,7 +2569,22 @@ typeReexportsPresence?: string
2428
2569
  * @experimental
2429
2570
  */
2430
2571
  jsx?: boolean
2431
- deferImport?: boolean
2572
+ /**
2573
+ * This option is experimental in Rspack only and subject to change or be removed anytime.
2574
+ * @experimental
2575
+ */
2576
+ importMetaResolve?: boolean
2577
+ /**
2578
+ * Flag top-level exported functions as side-effect-free for pure-function-based tree shaking.
2579
+ * This option is experimental in Rspack only and subject to change or be removed anytime.
2580
+ * @experimental
2581
+ */
2582
+ pureFunctions?: Array<string>
2583
+ }
2584
+
2585
+ export interface RawJavascriptParserWorkerOptions {
2586
+ alias?: Array<string>
2587
+ url?: string
2432
2588
  }
2433
2589
 
2434
2590
  export interface RawJsonGeneratorOptions {
@@ -2446,6 +2602,7 @@ export interface RawLazyCompilationOption {
2446
2602
  entries: boolean
2447
2603
  imports: boolean
2448
2604
  client: string
2605
+ reservedExternals: Array<string>
2449
2606
  }
2450
2607
 
2451
2608
  export interface RawLibManifestPluginOptions {
@@ -2471,10 +2628,9 @@ export interface RawLightningCssBrowsers {
2471
2628
 
2472
2629
  export interface RawLightningCssMinimizerOptions {
2473
2630
  errorRecovery: boolean
2474
- targets?: Array<string>
2631
+ targets?: string[] | RawLightningCssBrowsers
2475
2632
  include?: number
2476
2633
  exclude?: number
2477
- draft?: RawDraft
2478
2634
  drafts?: RawDraft
2479
2635
  nonStandard?: RawNonStandard
2480
2636
  pseudoClasses?: RawLightningCssPseudoClasses
@@ -2563,7 +2719,6 @@ export interface RawModuleOptions {
2563
2719
  parser?: Record<string, RawParserOptions>
2564
2720
  generator?: Record<string, RawGeneratorOptions>
2565
2721
  noParse?: string | RegExp | ((request: string) => boolean) | (string | RegExp | ((request: string) => boolean))[]
2566
- unsafeCache?: boolean | RegExp
2567
2722
  }
2568
2723
 
2569
2724
  export interface RawModuleRule {
@@ -2595,6 +2750,7 @@ export interface RawModuleRule {
2595
2750
  issuer?: RawRuleSetCondition
2596
2751
  issuerLayer?: RawRuleSetCondition
2597
2752
  dependency?: RawRuleSetCondition
2753
+ phase?: RawRuleSetCondition
2598
2754
  scheme?: RawRuleSetCondition
2599
2755
  mimetype?: RawRuleSetCondition
2600
2756
  oneOf?: Array<RawModuleRule>
@@ -2617,6 +2773,15 @@ export interface RawModuleRule {
2617
2773
  export interface RawModuleRuleUse {
2618
2774
  loader: string
2619
2775
  options?: string
2776
+ cache: boolean
2777
+ optionsCacheKey: string
2778
+ }
2779
+
2780
+ export interface RawNewCache {
2781
+ codeGeneration: boolean
2782
+ devtool: boolean
2783
+ loader: boolean
2784
+ minimize: boolean
2620
2785
  }
2621
2786
 
2622
2787
  export interface RawNodeOption {
@@ -2639,7 +2804,6 @@ export interface RawOccurrenceChunkIdsPluginOptions {
2639
2804
  }
2640
2805
 
2641
2806
  export interface RawOptimizationOptions {
2642
- removeAvailableModules: boolean
2643
2807
  sideEffects: boolean | string
2644
2808
  usedExports: boolean | string
2645
2809
  providedExports: boolean
@@ -2651,6 +2815,12 @@ export interface RawOptimizationOptions {
2651
2815
  avoidEntryIife: boolean
2652
2816
  }
2653
2817
 
2818
+ export interface RawOptimizeSharedConfig {
2819
+ shareKey: string
2820
+ treeShaking: boolean
2821
+ usedExports?: Array<string>
2822
+ }
2823
+
2654
2824
  export interface RawOptions {
2655
2825
  name?: string
2656
2826
  mode?: undefined | 'production' | 'development' | 'none'
@@ -2661,14 +2831,14 @@ export interface RawOptions {
2661
2831
  module: RawModuleOptions
2662
2832
  optimization: RawOptimizationOptions
2663
2833
  stats: RawStatsOptions
2664
- cache: RawCacheOptions
2834
+ cache: boolean | { type: "memory", snapshot: RawSnapshotOptions } | ({ type: "persistent" } & RawCacheOptionsPersistent)
2665
2835
  experiments: RawExperiments
2666
- node?: RawNodeOption
2667
- profile: boolean
2668
- amd?: string
2669
- bail: boolean
2670
- __references: Record<string, any>
2671
- __virtual_files?: Array<JsVirtualFile>
2836
+ incremental?: false | { [key: string]: boolean }
2837
+ node?: RawNodeOption
2838
+ amd?: string
2839
+ bail: boolean
2840
+ __references: Record<string, any>
2841
+ __virtual_files?: Array<JsVirtualFile>
2672
2842
  }
2673
2843
 
2674
2844
  export interface RawOutputOptions {
@@ -2678,6 +2848,7 @@ export interface RawOutputOptions {
2678
2848
  publicPath: "auto" | JsFilename
2679
2849
  assetModuleFilename: JsFilename
2680
2850
  wasmLoading: string | false
2851
+ wasmStreamingFallback: boolean
2681
2852
  enabledWasmLoadingTypes: Array<string>
2682
2853
  webassemblyModuleFilename: string
2683
2854
  filename: JsFilename
@@ -2700,7 +2871,6 @@ export interface RawOutputOptions {
2700
2871
  module: boolean
2701
2872
  chunkLoading: string | false
2702
2873
  chunkLoadTimeout: number
2703
- charset: boolean
2704
2874
  enabledChunkLoadingTypes?: Array<string>
2705
2875
  trustedTypes?: RawTrustedTypes
2706
2876
  sourceMapFilename: string
@@ -2718,11 +2888,12 @@ export interface RawOutputOptions {
2718
2888
  }
2719
2889
 
2720
2890
  export interface RawParserOptions {
2721
- type: "asset" | "css" | "css/auto" | "css/module" | "javascript" | "javascript/auto" | "javascript/dynamic" | "javascript/esm" | "json"
2891
+ type: "asset" | "css" | "css/auto" | "css/global" | "css/module" | "javascript" | "javascript/auto" | "javascript/dynamic" | "javascript/esm" | "json"
2722
2892
  asset?: RawAssetParserOptions
2723
2893
  css?: RawCssParserOptions
2724
- cssAuto?: RawCssAutoParserOptions
2725
- cssModule?: RawCssModuleParserOptions
2894
+ cssAuto?: RawCssAutoOrModuleParserOptions
2895
+ cssGlobal?: RawCssModuleParserOptions
2896
+ cssModule?: RawCssAutoOrModuleParserOptions
2726
2897
  javascript?: RawJavascriptParserOptions
2727
2898
  json?: RawJsonParserOptions
2728
2899
  }
@@ -2733,13 +2904,20 @@ export interface RawPathData {
2733
2904
  url?: string
2734
2905
  }
2735
2906
 
2907
+ export interface RawProgressPluginHandlerInfo {
2908
+ /** Number of built modules */
2909
+ builtModules: number
2910
+ /** Identifier of the active module (only provided during `build modules` updates) */
2911
+ moduleIdentifier?: string
2912
+ }
2913
+
2736
2914
  export interface RawProgressPluginOptions {
2737
2915
  prefix?: string
2738
2916
  profile?: boolean
2739
2917
  template?: string
2740
2918
  tick?: string | Array<string>
2741
2919
  progressChars?: string
2742
- handler?: (percent: number, msg: string, items: string[]) => void
2920
+ handler?: (percent: number, msg: string, info: RawProgressPluginHandlerInfo) => void
2743
2921
  }
2744
2922
 
2745
2923
  export interface RawProvideOptions {
@@ -2751,6 +2929,7 @@ export interface RawProvideOptions {
2751
2929
  singleton?: boolean
2752
2930
  requiredVersion?: string | false | undefined
2753
2931
  strictVersion?: boolean
2932
+ treeShakingMode?: string
2754
2933
  }
2755
2934
 
2756
2935
  export interface RawRelated {
@@ -2830,6 +3009,7 @@ export interface RawRsdoctorPluginOptions {
2830
3009
  moduleGraphFeatures: boolean | Array<'graph' | 'ids' | 'sources'>
2831
3010
  chunkGraphFeatures: boolean | Array<'graph' | 'assets'>
2832
3011
  sourceMapFeatures?: { module?: boolean; cheap?: boolean } | undefined
3012
+ exportUsageGraph?: boolean
2833
3013
  }
2834
3014
 
2835
3015
  export interface RawRslibPluginOptions {
@@ -2843,10 +3023,17 @@ export interface RawRslibPluginOptions {
2843
3023
  * @default `false`
2844
3024
  */
2845
3025
  forceNodeShims?: boolean
3026
+ /**
3027
+ * Auto downgrade module external type to node-commonjs for CJS require of node builtins
3028
+ * @default `false`
3029
+ */
3030
+ autoCjsNodeBuiltin?: boolean
3031
+ /** Emit isolated declaration files for modules transformed by `builtin:swc-loader` */
3032
+ emitDts?: RawSwcEmitDtsOptions
2846
3033
  }
2847
3034
 
2848
- export interface RawRspackFuture {
2849
-
3035
+ export interface RawRstestDynamicImportOriginOptions {
3036
+ functionName?: string
2850
3037
  }
2851
3038
 
2852
3039
  export interface RawRstestPluginOptions {
@@ -2855,6 +3042,18 @@ export interface RawRstestPluginOptions {
2855
3042
  hoistMockModule: boolean
2856
3043
  manualMockRoot: string
2857
3044
  preserveNewUrl?: Array<string>
3045
+ globals?: boolean
3046
+ /**
3047
+ * Replaces each `import.meta.rstest` with
3048
+ * `globalThis['@rstest/core/import-meta']?.(<absolute source path>)`.
3049
+ */
3050
+ injectImportMetaRstestOrigin?: boolean
3051
+ injectDynamicImportOrigin?: boolean | { functionName?: string }
3052
+ injectRequireResolveOrigin?: boolean | { functionName?: string }
3053
+ }
3054
+
3055
+ export interface RawRstestRequireResolveOriginOptions {
3056
+ functionName?: string
2858
3057
  }
2859
3058
 
2860
3059
  export interface RawRuleSetCondition {
@@ -2888,6 +3087,21 @@ export interface RawRuntimeChunkOptions {
2888
3087
  name: string | ((entrypoint: { name: string }) => string)
2889
3088
  }
2890
3089
 
3090
+ export interface RawSharedContainerPluginOptions {
3091
+ name: string
3092
+ request: string
3093
+ version: string
3094
+ fileName?: string
3095
+ library: JsLibraryOptions
3096
+ }
3097
+
3098
+ export interface RawSharedUsedExportsOptimizerPluginOptions {
3099
+ shared: Array<RawOptimizeSharedConfig>
3100
+ injectTreeShakingUsedExports?: boolean
3101
+ manifestFileName?: string
3102
+ statsFileName?: string
3103
+ }
3104
+
2891
3105
  export interface RawSizeLimitsPluginOptions {
2892
3106
  assetFilter?: (assetFilename: string) => boolean
2893
3107
  hints?: "error" | "warning"
@@ -2895,13 +3109,20 @@ export interface RawSizeLimitsPluginOptions {
2895
3109
  maxEntrypointSize?: number
2896
3110
  }
2897
3111
 
3112
+ export interface RawSnapshotOptions {
3113
+ immutablePaths: Array<string|RegExp>
3114
+ unmanagedPaths: Array<string|RegExp>
3115
+ managedPaths: Array<string|RegExp>
3116
+ }
3117
+
2898
3118
  export interface RawSplitChunkSizes {
2899
3119
  sizes: Record<string, number>
2900
3120
  }
2901
3121
 
2902
3122
  export interface RawSplitChunksOptions {
2903
3123
  fallbackCacheGroup?: RawFallbackCacheGroupOptions
2904
- name?: string | false | Function
3124
+ name?: string | false | ((ctx: JsChunkOptionNameCtx) => string | undefined)
3125
+ nameBatch?: ((batch: JsChunkOptionNameBatch) => (string | undefined)[])
2905
3126
  filename?: JsFilename
2906
3127
  cacheGroups?: Array<RawCacheGroupOptions>
2907
3128
  /** What kind of chunks should be selected. */
@@ -2915,7 +3136,7 @@ export interface RawSplitChunksOptions {
2915
3136
  hidePathInfo?: boolean
2916
3137
  minSize?: number | RawSplitChunkSizes
2917
3138
  minSizeReduction?: number | RawSplitChunkSizes
2918
- enforceSizeThreshold?: number
3139
+ enforceSizeThreshold?: number | RawSplitChunkSizes
2919
3140
  minRemainingSize?: number | RawSplitChunkSizes
2920
3141
  maxSize?: number | RawSplitChunkSizes
2921
3142
  maxAsyncSize?: number | RawSplitChunkSizes
@@ -2925,6 +3146,8 @@ export interface RawSplitChunksOptions {
2925
3146
  export interface RawStatsBuildInfo {
2926
3147
  buildVersion: string
2927
3148
  buildName?: string
3149
+ target?: Array<string>
3150
+ plugins?: Array<string>
2928
3151
  }
2929
3152
 
2930
3153
  export interface RawStatsOptions {
@@ -2942,6 +3165,11 @@ export interface RawSubresourceIntegrityPluginOptions {
2942
3165
  htmlPlugin: "JavaScript" | "Native" | "Disabled"
2943
3166
  }
2944
3167
 
3168
+ export interface RawSwcEmitDtsOptions {
3169
+ rootDir: string
3170
+ declarationDir: string
3171
+ }
3172
+
2945
3173
  export interface RawSwcJsMinimizerOptions {
2946
3174
  ecma: any
2947
3175
  compress: any
@@ -2959,6 +3187,20 @@ export interface RawSwcJsMinimizerRspackPluginOptions {
2959
3187
  minimizerOptions: RawSwcJsMinimizerOptions
2960
3188
  }
2961
3189
 
3190
+ export declare enum RawSyncModuleIdsPluginMode {
3191
+ Read = 'read',
3192
+ Create = 'create',
3193
+ Merge = 'merge',
3194
+ Update = 'update'
3195
+ }
3196
+
3197
+ export interface RawSyncModuleIdsPluginOptions {
3198
+ path: string
3199
+ context?: string
3200
+ test?: (module: Module) => boolean
3201
+ mode?: 'read' | 'create' | 'merge' | 'update'
3202
+ }
3203
+
2962
3204
  export interface RawToOptions {
2963
3205
  context: string
2964
3206
  absoluteFilename?: string
@@ -2985,8 +3227,7 @@ export interface RealDependencyLocation {
2985
3227
  end?: SourcePosition
2986
3228
  }
2987
3229
 
2988
- /**
2989
- * this is a process level tracing, which means it would be shared by all compilers in the same process
3230
+ /** * this is a process level tracing, which means it would be shared by all compilers in the same process
2990
3231
  * only the first call would take effect, the following calls would be ignored
2991
3232
  * Some code is modified based on
2992
3233
  * https://github.com/swc-project/swc/blob/d1d0607158ab40463d1b123fed52cc526eba8385/bindings/binding_core_node/src/util.rs#L29-L58
@@ -3001,53 +3242,56 @@ export declare enum RegisterJsTapKind {
3001
3242
  CompilerCompilation = 1,
3002
3243
  CompilerMake = 2,
3003
3244
  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
3245
+ CompilerAfterCompile = 4,
3246
+ CompilerShouldEmit = 5,
3247
+ CompilerEmit = 6,
3248
+ CompilerAfterEmit = 7,
3249
+ CompilerAssetEmitted = 8,
3250
+ CompilationBuildModule = 9,
3251
+ CompilationStillValidModule = 10,
3252
+ CompilationSucceedModule = 11,
3253
+ CompilationExecuteModule = 12,
3254
+ CompilationFinishModules = 13,
3255
+ CompilationOptimizeModules = 14,
3256
+ CompilationAfterOptimizeModules = 15,
3257
+ CompilationOptimizeTree = 16,
3258
+ CompilationOptimizeChunkModules = 17,
3259
+ CompilationBeforeModuleIds = 18,
3260
+ CompilationAdditionalTreeRuntimeRequirements = 19,
3261
+ CompilationRuntimeRequirementInTree = 20,
3262
+ CompilationRuntimeModule = 21,
3263
+ CompilationChunkHash = 22,
3264
+ CompilationChunkAsset = 23,
3265
+ CompilationProcessAssets = 24,
3266
+ CompilationAfterProcessAssets = 25,
3267
+ CompilationSeal = 26,
3268
+ CompilationAfterSeal = 27,
3269
+ NormalModuleFactoryBeforeResolve = 28,
3270
+ NormalModuleFactoryFactorize = 29,
3271
+ NormalModuleFactoryResolve = 30,
3272
+ NormalModuleFactoryAfterResolve = 31,
3273
+ NormalModuleFactoryCreateModule = 32,
3274
+ NormalModuleFactoryResolveForScheme = 33,
3275
+ ContextModuleFactoryBeforeResolve = 34,
3276
+ ContextModuleFactoryAfterResolve = 35,
3277
+ ExternalModuleChunkCondition = 36,
3278
+ JavascriptModulesChunkHash = 37,
3279
+ HtmlPluginBeforeAssetTagGeneration = 38,
3280
+ HtmlPluginAlterAssetTags = 39,
3281
+ HtmlPluginAlterAssetTagGroups = 40,
3282
+ HtmlPluginAfterTemplateExecution = 41,
3283
+ HtmlPluginBeforeEmit = 42,
3284
+ HtmlPluginAfterEmit = 43,
3285
+ RuntimePluginCreateScript = 44,
3286
+ RuntimePluginCreateLink = 45,
3287
+ RuntimePluginLinkPreload = 46,
3288
+ RuntimePluginLinkPrefetch = 47,
3289
+ RealContentHashPluginUpdateHash = 48,
3290
+ RsdoctorPluginModuleGraph = 49,
3291
+ RsdoctorPluginChunkGraph = 50,
3292
+ RsdoctorPluginModuleIds = 51,
3293
+ RsdoctorPluginModuleSources = 52,
3294
+ RsdoctorPluginAssets = 53
3051
3295
  }
3052
3296
 
3053
3297
  export interface RegisterJsTaps {
@@ -3055,6 +3299,7 @@ export interface RegisterJsTaps {
3055
3299
  registerCompilerCompilationTaps: (stages: Array<number>) => Array<{ function: ((arg: JsCompilation) => void); stage: number; }>
3056
3300
  registerCompilerMakeTaps: (stages: Array<number>) => Array<{ function: ((arg: JsCompilation) => Promise<void>); stage: number; }>
3057
3301
  registerCompilerFinishMakeTaps: (stages: Array<number>) => Array<{ function: ((arg: JsCompilation) => void); stage: number; }>
3302
+ registerCompilerAfterCompileTaps: (stages: Array<number>) => Array<{ function: ((arg: JsCompilation) => Promise<void>); stage: number; }>
3058
3303
  registerCompilerShouldEmitTaps: (stages: Array<number>) => Array<{ function: ((arg: JsCompilation) => boolean | undefined); stage: number; }>
3059
3304
  registerCompilerEmitTaps: (stages: Array<number>) => Array<{ function: (() => Promise<void>); stage: number; }>
3060
3305
  registerCompilerAfterEmitTaps: (stages: Array<number>) => Array<{ function: (() => Promise<void>); stage: number; }>
@@ -3086,6 +3331,7 @@ export interface RegisterJsTaps {
3086
3331
  registerNormalModuleFactoryCreateModuleTaps: (stages: Array<number>) => Array<{ function: ((arg: JsNormalModuleFactoryCreateModuleArgs) => Promise<void>); stage: number; }>
3087
3332
  registerContextModuleFactoryBeforeResolveTaps: (stages: Array<number>) => Array<{ function: ((arg: false | JsContextModuleFactoryBeforeResolveData) => Promise<false | JsContextModuleFactoryBeforeResolveData>); stage: number; }>
3088
3333
  registerContextModuleFactoryAfterResolveTaps: (stages: Array<number>) => Array<{ function: ((arg: false | JsContextModuleFactoryAfterResolveData) => Promise<false | JsContextModuleFactoryAfterResolveData>); stage: number; }>
3334
+ registerExternalModuleChunkConditionTaps: (stages: Array<number>) => Array<{ function: ((chunk: Chunk) => boolean | undefined); stage: number; }>
3089
3335
  registerJavascriptModulesChunkHashTaps: (stages: Array<number>) => Array<{ function: ((arg: Chunk) => Buffer); stage: number; }>
3090
3336
  registerHtmlPluginBeforeAssetTagGenerationTaps: (stages: Array<number>) => Array<{ function: ((arg: JsBeforeAssetTagGenerationData) => JsBeforeAssetTagGenerationData); stage: number; }>
3091
3337
  registerHtmlPluginAlterAssetTagsTaps: (stages: Array<number>) => Array<{ function: ((arg: JsAlterAssetTagsData) => JsAlterAssetTagsData); stage: number; }>
@@ -3097,6 +3343,7 @@ export interface RegisterJsTaps {
3097
3343
  registerRuntimePluginCreateLinkTaps: (stages: Array<number>) => Array<{ function: ((arg: JsLinkPreloadData) => String); stage: number; }>
3098
3344
  registerRuntimePluginLinkPreloadTaps: (stages: Array<number>) => Array<{ function: ((arg: JsCreateLinkData) => String); stage: number; }>
3099
3345
  registerRuntimePluginLinkPrefetchTaps: (stages: Array<number>) => Array<{ function: ((arg: JsLinkPrefetchData) => String); stage: number; }>
3346
+ registerRealContentHashPluginUpdateHashTaps: (stages: Array<number>) => Array<{ function: ((data: JsRealContentHashPluginUpdateHashData) => string | undefined); stage: number; }>
3100
3347
  registerRsdoctorPluginModuleGraphTaps: (stages: Array<number>) => Array<{ function: ((arg: JsRsdoctorModuleGraph) => Promise<boolean | undefined>); stage: number; }>
3101
3348
  registerRsdoctorPluginChunkGraphTaps: (stages: Array<number>) => Array<{ function: ((arg: JsRsdoctorChunkGraph) => Promise<boolean | undefined>); stage: number; }>
3102
3349
  registerRsdoctorPluginModuleIdsTaps: (stages: Array<number>) => Array<{ function: ((arg: JsRsdoctorModuleIdsPatch) => Promise<boolean | undefined>); stage: number; }>
@@ -3198,7 +3445,7 @@ export interface TsconfigOptions {
3198
3445
  */
3199
3446
  configFile: string
3200
3447
  /**
3201
- * Support for Typescript Project References.
3448
+ * Support for TypeScript Project References.
3202
3449
  *
3203
3450
  * * `'auto'`: use the `references` field from tsconfig of `config_file`.
3204
3451
  * * `string[]`: manually provided relative or absolute path.