@rspack-debug/core 2.0.0-canary.20260120 → 2.0.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/README.md +1 -1
  2. package/compiled/@rspack/lite-tapable/dist/index.d.ts +175 -0
  3. package/compiled/@rspack/lite-tapable/license +22 -0
  4. package/compiled/@rspack/lite-tapable/package.json +1 -0
  5. package/compiled/@swc/types/index.d.ts +15 -9
  6. package/compiled/@swc/types/package.json +1 -1
  7. package/compiled/connect-next/index.d.ts +56 -0
  8. package/compiled/connect-next/license +26 -0
  9. package/compiled/connect-next/package.json +1 -0
  10. package/compiled/http-proxy-middleware/index.d.ts +544 -0
  11. package/compiled/http-proxy-middleware/license +22 -0
  12. package/compiled/http-proxy-middleware/package.json +1 -0
  13. package/compiled/open/index.d.ts +161 -0
  14. package/compiled/open/package.json +1 -0
  15. package/compiled/watchpack/index.d.ts +2 -0
  16. package/compiled/webpack-sources/index.js +188 -131
  17. package/compiled/webpack-sources/package.json +1 -1
  18. package/compiled/webpack-sources/types.d.ts +6 -3
  19. package/dist/BuildInfo.d.ts +1 -1
  20. package/dist/Compilation.d.ts +5 -2
  21. package/dist/Compiler.d.ts +4 -3
  22. package/dist/ContextModuleFactory.d.ts +1 -1
  23. package/dist/FileSystem.d.ts +1 -1
  24. package/dist/Module.d.ts +1 -1
  25. package/dist/ModuleGraph.d.ts +3 -1
  26. package/dist/ModuleGraphConnection.d.ts +10 -0
  27. package/dist/MultiCompiler.d.ts +1 -1
  28. package/dist/MultiWatching.d.ts +1 -1
  29. package/dist/NativeWatchFileSystem.d.ts +1 -1
  30. package/dist/NormalModule.d.ts +1 -2
  31. package/dist/NormalModuleFactory.d.ts +1 -1
  32. package/dist/RuntimeGlobals.d.ts +1 -1
  33. package/dist/Watching.d.ts +1 -1
  34. package/dist/builtin-loader/swc/pluginImport.d.ts +1 -1
  35. package/dist/builtin-loader/swc/types.d.ts +37 -2
  36. package/dist/builtin-plugin/EsmLibraryPlugin.d.ts +4 -2
  37. package/dist/builtin-plugin/EsmNodeTargetPlugin.d.ts +9 -0
  38. package/dist/builtin-plugin/HashedModuleIdsPlugin.d.ts +10 -0
  39. package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +1 -1
  40. package/dist/builtin-plugin/ProgressPlugin.d.ts +5 -4
  41. package/dist/builtin-plugin/RsdoctorPlugin.d.ts +3 -3
  42. package/dist/builtin-plugin/RuntimePlugin.d.ts +1 -1
  43. package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +9 -9
  44. package/dist/builtin-plugin/SplitChunksPlugin.d.ts +2 -1
  45. package/dist/builtin-plugin/WorkerPlugin.d.ts +1 -0
  46. package/dist/builtin-plugin/html-plugin/hooks.d.ts +1 -1
  47. package/dist/builtin-plugin/index.d.ts +3 -0
  48. package/dist/builtin-plugin/lazy-compilation/middleware.d.ts +3 -3
  49. package/dist/builtin-plugin/rsc/Coordinator.d.ts +8 -0
  50. package/dist/builtin-plugin/rsc/RscClientPlugin.d.ts +13 -0
  51. package/dist/builtin-plugin/rsc/RscServerPlugin.d.ts +39 -0
  52. package/dist/builtin-plugin/rsc/index.d.ts +24 -0
  53. package/dist/checkNodeVersion.d.ts +1 -0
  54. package/dist/config/adapterRuleUse.d.ts +1 -1
  55. package/dist/config/devServer.d.ts +102 -237
  56. package/dist/config/normalization.d.ts +4 -4
  57. package/dist/config/types.d.ts +184 -71
  58. package/dist/container/ContainerPlugin.d.ts +3 -2
  59. package/dist/container/ContainerReferencePlugin.d.ts +4 -3
  60. package/dist/container/ModuleFederationManifestPlugin.d.ts +10 -3
  61. package/dist/container/ModuleFederationPlugin.d.ts +20 -1
  62. package/dist/container/ModuleFederationPluginV1.d.ts +2 -2
  63. package/dist/container/ModuleFederationRuntimePlugin.d.ts +4 -0
  64. package/dist/exports.d.ts +17 -8
  65. package/dist/index.d.ts +1 -0
  66. package/dist/index.js +1751 -636
  67. package/dist/lib/Cache.d.ts +1 -1
  68. package/dist/lib/HookWebpackError.d.ts +1 -1
  69. package/dist/moduleFederationDefaultRuntime.js +1 -1
  70. package/dist/node/NodeWatchFileSystem.d.ts +1 -1
  71. package/dist/rspack.d.ts +1 -1
  72. package/dist/sharing/CollectSharedEntryPlugin.d.ts +22 -0
  73. package/dist/sharing/ConsumeSharedPlugin.d.ts +16 -3
  74. package/dist/sharing/IndependentSharedPlugin.d.ts +35 -0
  75. package/dist/sharing/ProvideSharedPlugin.d.ts +22 -2
  76. package/dist/sharing/SharePlugin.d.ts +43 -5
  77. package/dist/sharing/SharedContainerPlugin.d.ts +23 -0
  78. package/dist/sharing/SharedUsedExportsOptimizerPlugin.d.ts +14 -0
  79. package/dist/sharing/TreeShakingSharedPlugin.d.ts +16 -0
  80. package/dist/sharing/utils.d.ts +1 -0
  81. package/dist/stats/StatsFactory.d.ts +1 -1
  82. package/dist/stats/StatsPrinter.d.ts +1 -1
  83. package/dist/swc.d.ts +2 -2
  84. package/dist/taps/types.d.ts +1 -1
  85. package/dist/util/createHash.d.ts +1 -1
  86. package/dist/util/source.d.ts +1 -1
  87. package/dist/util/supportsColor.d.ts +6 -0
  88. package/dist/worker.js +21 -20
  89. package/hot/dev-server.js +1 -1
  90. package/hot/emitter.js +0 -2
  91. package/hot/log.js +0 -2
  92. package/hot/only-dev-server.js +1 -1
  93. package/module.d.ts +4 -2
  94. package/package.json +20 -22
  95. package/dist/rslib-runtime.js +0 -29
@@ -63,7 +63,7 @@ export type AuxiliaryComment = string | LibraryCustomUmdCommentObject;
63
63
  /** Specify which export should be exposed as a library. */
64
64
  export type LibraryExport = string | string[];
65
65
  /** Configure how the library will be exposed. */
66
- export type LibraryType = LiteralUnion<'var' | 'module' | 'assign' | 'assign-properties' | 'this' | 'window' | 'self' | 'global' | 'commonjs' | 'commonjs2' | 'commonjs-module' | 'commonjs-static' | 'amd' | 'amd-require' | 'umd' | 'umd2' | 'jsonp' | 'system', string>;
66
+ export type LibraryType = LiteralUnion<'var' | 'module' | 'modern-module' | 'assign' | 'assign-properties' | 'this' | 'window' | 'self' | 'global' | 'commonjs' | 'commonjs2' | 'commonjs-module' | 'commonjs-static' | 'amd' | 'amd-require' | 'umd' | 'umd2' | 'jsonp' | 'system', string>;
67
67
  /** When using output.library.type: "umd", setting output.library.umdNamedDefine to true will name the AMD module of the UMD build. */
68
68
  export type UmdNamedDefine = boolean;
69
69
  /** Options for library. */
@@ -367,7 +367,6 @@ export type Output = {
367
367
  library?: Library;
368
368
  /**
369
369
  * Output JavaScript files as module type.
370
- * Disabled by default as it's an experimental feature. To use it, you must set experiments.outputModule to true.
371
370
  * @default false
372
371
  */
373
372
  module?: OutputModule;
@@ -593,7 +592,6 @@ export type ResolveOptions = {
593
592
  restrictions?: string[];
594
593
  /**
595
594
  * A list of directories where server-relative URLs (beginning with '/') are resolved.
596
- * It defaults to the context configuration option.
597
595
  * On systems other than Windows, these requests are initially resolved as an absolute path.
598
596
  * @default []
599
597
  */
@@ -633,8 +631,30 @@ export type RuleSetLoaderWithOptions = {
633
631
  };
634
632
  export type RuleSetUseItem = RuleSetLoader | RuleSetLoaderWithOptions;
635
633
  export type RuleSetUse = RuleSetUseItem | RuleSetUseItem[] | ((data: RawFuncUseCtx) => RuleSetUseItem[]);
634
+ export type RuleSetRuleUseAndLoader = {
635
+ /** A loader name */
636
+ loader: RuleSetLoader;
637
+ /** A loader options */
638
+ options?: RuleSetLoaderOptions;
639
+ /** An array to pass the Loader package name and its options. */
640
+ use?: never;
641
+ } | {
642
+ /** A loader name */
643
+ loader?: never;
644
+ /** A loader options */
645
+ options?: never;
646
+ /** An array to pass the Loader package name and its options. */
647
+ use: RuleSetUse;
648
+ } | {
649
+ /** A loader name */
650
+ loader?: never;
651
+ /** A loader options */
652
+ options?: never;
653
+ /** An array to pass the Loader package name and its options. */
654
+ use?: never;
655
+ };
636
656
  /** Rule defines the conditions for matching a module and the behavior of handling those modules. */
637
- export type RuleSetRule = {
657
+ export type RuleSetRule = RuleSetRuleUseAndLoader & {
638
658
  /** Matches all modules that match this resource, and will match against Resource. */
639
659
  test?: RuleSetCondition;
640
660
  /** Excludes all modules that match this condition and will match against the absolute path of the resource */
@@ -665,12 +685,6 @@ export type RuleSetRule = {
665
685
  type?: string;
666
686
  /** Used to mark the layer of the matching module. */
667
687
  layer?: string;
668
- /** A loader name */
669
- loader?: RuleSetLoader;
670
- /** A loader options */
671
- options?: RuleSetLoaderOptions;
672
- /** An array to pass the Loader package name and its options. */
673
- use?: RuleSetUse;
674
688
  /**
675
689
  * Parser options for the specific modules that matched by the rule conditions
676
690
  * It will override the parser options in module.parser.
@@ -718,6 +732,14 @@ export type AssetParserOptions = {
718
732
  };
719
733
  export type CssParserNamedExports = boolean;
720
734
  export type CssParserUrl = boolean;
735
+ export type CssParserResolveImportContext = {
736
+ url: string;
737
+ media: string | undefined;
738
+ resourcePath: string;
739
+ supports: string | undefined;
740
+ layer: string | undefined;
741
+ };
742
+ export type CssParserResolveImport = boolean | ((context: CssParserResolveImportContext) => boolean);
721
743
  /** Options object for `css` modules. */
722
744
  export type CssParserOptions = {
723
745
  /**
@@ -730,6 +752,11 @@ export type CssParserOptions = {
730
752
  * @default true
731
753
  * */
732
754
  url?: CssParserUrl;
755
+ /**
756
+ * Allow to enable/disables `@import` at-rules handling.
757
+ * @default true
758
+ * */
759
+ resolveImport?: CssParserResolveImport;
733
760
  };
734
761
  /** Options object for `css/auto` modules. */
735
762
  export type CssAutoParserOptions = {
@@ -743,6 +770,11 @@ export type CssAutoParserOptions = {
743
770
  * @default true
744
771
  * */
745
772
  url?: CssParserUrl;
773
+ /**
774
+ * Allow to enable/disables `@import` at-rules handling.
775
+ * @default true
776
+ * */
777
+ resolveImport?: CssParserResolveImport;
746
778
  };
747
779
  /** Options object for `css/module` modules. */
748
780
  export type CssModuleParserOptions = {
@@ -756,6 +788,11 @@ export type CssModuleParserOptions = {
756
788
  * @default true
757
789
  * */
758
790
  url?: CssParserUrl;
791
+ /**
792
+ * Allow to enable/disables `@import` at-rules handling.
793
+ * @default true
794
+ * */
795
+ resolveImport?: CssParserResolveImport;
759
796
  };
760
797
  type ExportsPresence = 'error' | 'warn' | 'auto' | false;
761
798
  export type JavascriptParserCommonjsExports = boolean | 'skipInEsm';
@@ -785,10 +822,9 @@ export type JavascriptParserOptions = {
785
822
  */
786
823
  dynamicImportFetchPriority?: 'low' | 'high' | 'auto';
787
824
  /**
788
- * Enable or disable evaluating import.meta.
789
- * @default true
825
+ * Enable or disable evaluating import.meta. Set to 'preserve-unknown' to preserve unknown properties for runtime evaluation.
790
826
  */
791
- importMeta?: boolean;
827
+ importMeta?: boolean | 'preserve-unknown';
792
828
  /**
793
829
  * Enable parsing of new URL() syntax.
794
830
  * @default true
@@ -815,15 +851,15 @@ export type JavascriptParserOptions = {
815
851
  wrappedContextRegExp?: RegExp;
816
852
  /**
817
853
  * Warn or error for using non-existent exports and conflicting re-exports.
818
- * @default 'auto'
854
+ * @default 'error'
819
855
  */
820
856
  exportsPresence?: ExportsPresence;
821
857
  /** Warn or error for using non-existent exports */
822
858
  importExportsPresence?: ExportsPresence;
823
859
  /** Warn or error for conflicting re-exports */
824
860
  reexportExportsPresence?: ExportsPresence;
825
- /** Emit errors instead of warnings when imported names don't exist in imported module. */
826
- strictExportPresence?: boolean;
861
+ /** Handle the this context correctly according to the spec for namespace objects. */
862
+ strictThisContextOnImports?: boolean;
827
863
  /** Provide custom syntax for Worker parsing, commonly used to support Worklet */
828
864
  worker?: string[] | boolean;
829
865
  /** Override the module to strict or non-strict. */
@@ -872,6 +908,16 @@ export type JavascriptParserOptions = {
872
908
  * @default false
873
909
  */
874
910
  deferImport?: boolean;
911
+ /**
912
+ * Whether to enable import.meta.resolve().
913
+ * @default false
914
+ */
915
+ importMetaResolve?: boolean;
916
+ /**
917
+ * Flag top-level exported functions as side-effect-free for pure-function-based tree shaking.
918
+ * @experimental
919
+ */
920
+ pureFunctions?: string[];
875
921
  };
876
922
  export type JsonParserOptions = {
877
923
  /**
@@ -1044,10 +1090,6 @@ export type ModuleOptions = {
1044
1090
  generator?: GeneratorOptionsByModuleType;
1045
1091
  /** Keep module mechanism of the matched modules as-is, such as module.exports, require, import. */
1046
1092
  noParse?: NoParseOption;
1047
- /**
1048
- * Cache the resolving of module requests.
1049
- */
1050
- unsafeCache?: boolean | RegExp;
1051
1093
  };
1052
1094
  type AllowTarget = 'web' | 'webworker' | 'es3' | 'es5' | 'es2015' | 'es2016' | 'es2017' | 'es2018' | 'es2019' | 'es2020' | 'es2021' | 'es2022' | 'es2023' | 'es2024' | 'es2025' | 'node' | 'async-node' | `node${number}` | `async-node${number}` | `node${number}.${number}` | `async-node${number}.${number}` | 'electron-main' | `electron${number}-main` | `electron${number}.${number}-main` | 'electron-renderer' | `electron${number}-renderer` | `electron${number}.${number}-renderer` | 'electron-preload' | `electron${number}-preload` | `electron${number}.${number}-preload` | 'nwjs' | `nwjs${number}` | `nwjs${number}.${number}` | 'node-webkit' | `node-webkit${number}` | `node-webkit${number}.${number}` | 'browserslist' | `browserslist:${string}`;
1053
1095
  /** Used to configure the target environment of Rspack output and the ECMAScript version of Rspack runtime code. */
@@ -1239,6 +1281,86 @@ export type NodeOptions = {
1239
1281
  export type Node = false | NodeOptions;
1240
1282
  export type Loader = Record<string, any>;
1241
1283
  export type SnapshotOptions = {};
1284
+ /**
1285
+ * Snapshot options for determining which files have been modified.
1286
+ */
1287
+ export type CacheSnapshotOptions = {
1288
+ /**
1289
+ * An array of paths to immutable files, changes to these paths will be ignored during hot restart.
1290
+ */
1291
+ immutablePaths?: (string | RegExp)[];
1292
+ /**
1293
+ * An array of paths in managedPaths that are not managed by the package manager.
1294
+ */
1295
+ unmanagedPaths?: (string | RegExp)[];
1296
+ /**
1297
+ * An array of paths managed by the package manager.
1298
+ * @default [/[\\/]node_modules[\\/][^.]/]
1299
+ */
1300
+ managedPaths?: (string | RegExp)[];
1301
+ };
1302
+ /**
1303
+ * Storage options for persistent cache.
1304
+ */
1305
+ export type CacheStorageOptions = {
1306
+ /**
1307
+ * Storage type, currently only supports 'filesystem'.
1308
+ */
1309
+ type: 'filesystem';
1310
+ /**
1311
+ * Cache directory path.
1312
+ * @default 'node_modules/.cache/rspack'
1313
+ */
1314
+ directory?: string;
1315
+ };
1316
+ /**
1317
+ * Persistent cache options.
1318
+ */
1319
+ export type PersistentCacheOptions = {
1320
+ /**
1321
+ * Cache type.
1322
+ */
1323
+ type: 'persistent';
1324
+ /**
1325
+ * An array of files containing build dependencies, Rspack will use the hash of each of these files to invalidate the persistent cache.
1326
+ * @default []
1327
+ */
1328
+ buildDependencies?: string[];
1329
+ /**
1330
+ * Cache version, different versions of caches are isolated from each other.
1331
+ * @default ""
1332
+ */
1333
+ version?: string;
1334
+ /**
1335
+ * Snapshot options for determining which files have been modified.
1336
+ */
1337
+ snapshot?: CacheSnapshotOptions;
1338
+ /**
1339
+ * Storage options for cache.
1340
+ */
1341
+ storage?: CacheStorageOptions;
1342
+ /**
1343
+ * Enable portable cache mode. When enabled, the generated cache content can be shared across different platforms and paths within the same project.
1344
+ * @description Portable cache makes the cache platform-independent by converting platform-specific data (e.g., absolute paths to relative paths) during serialization and deserialization.
1345
+ * @default false
1346
+ */
1347
+ portable?: boolean;
1348
+ /**
1349
+ * Enable read-only mode. When enabled, the cache will only be read from disk and never written to.
1350
+ * @description This is useful for CI environments where you want to use a pre-warmed cache without modifying it.
1351
+ * @default false
1352
+ */
1353
+ readonly?: boolean;
1354
+ };
1355
+ /**
1356
+ * Memory cache options.
1357
+ */
1358
+ export type MemoryCacheOptions = {
1359
+ /**
1360
+ * Cache type.
1361
+ */
1362
+ type: 'memory';
1363
+ };
1242
1364
  /**
1243
1365
  * Options for caching snapshots and intermediate products during the build process.
1244
1366
  * @description Controls whether caching is enabled or disabled.
@@ -1250,23 +1372,10 @@ export type SnapshotOptions = {};
1250
1372
  * // Disable caching
1251
1373
  * cache: false
1252
1374
  */
1253
- export type CacheOptions = boolean | {
1254
- type: 'memory';
1255
- } | {
1256
- type: 'persistent';
1257
- buildDependencies?: string[];
1258
- version?: string;
1259
- snapshot?: {
1260
- immutablePaths?: (string | RegExp)[];
1261
- unmanagedPaths?: (string | RegExp)[];
1262
- managedPaths?: (string | RegExp)[];
1263
- };
1264
- storage?: {
1265
- type: 'filesystem';
1266
- directory?: string;
1267
- };
1268
- };
1375
+ export type CacheOptions = boolean | MemoryCacheOptions | PersistentCacheOptions;
1269
1376
  export type StatsPresets = 'normal' | 'none' | 'verbose' | 'errors-only' | 'errors-warnings' | 'minimal' | 'detailed' | 'summary';
1377
+ type AssetFilterItemTypes = RegExp | string | ((name: string, asset: any) => boolean);
1378
+ type AssetFilterTypes = boolean | AssetFilterItemTypes | AssetFilterItemTypes[];
1270
1379
  type ModuleFilterItemTypes = RegExp | string | ((name: string, module: any, type: any) => boolean);
1271
1380
  type ModuleFilterTypes = boolean | ModuleFilterItemTypes | ModuleFilterItemTypes[];
1272
1381
  export type StatsColorOptions = {
@@ -1352,7 +1461,8 @@ export type StatsOptions = {
1352
1461
  errorsCount?: boolean;
1353
1462
  /**
1354
1463
  * Enables or disables the use of colors in the output.
1355
- * @default false
1464
+ * When undefined, defaults to true if the environment supports color (TTY, FORCE_COLOR, or NO_COLOR unset), otherwise false.
1465
+ * @default environment-dependent (see above)
1356
1466
  */
1357
1467
  colors?: boolean | StatsColorOptions;
1358
1468
  /**
@@ -1550,7 +1660,7 @@ export type StatsOptions = {
1550
1660
  * Exclude the matching assets information.
1551
1661
  * @default false
1552
1662
  */
1553
- excludeAssets?: ModuleFilterTypes;
1663
+ excludeAssets?: AssetFilterTypes;
1554
1664
  /**
1555
1665
  * Specifies the sorting order for modules.
1556
1666
  * @default 'id'
@@ -1730,6 +1840,13 @@ type SharedOptimizationSplitChunksCacheGroup = {
1730
1840
  */
1731
1841
  minSize?: OptimizationSplitChunksSizes;
1732
1842
  minSizeReduction?: OptimizationSplitChunksSizes;
1843
+ /**
1844
+ * Size threshold at which splitting is enforced and other restrictions
1845
+ * (minRemainingSize, maxAsyncRequests, maxInitialRequests) are ignored.
1846
+ * The value is `50000` in production mode.
1847
+ * The value is `30000` in others mode.
1848
+ */
1849
+ enforceSizeThreshold?: OptimizationSplitChunksSizes;
1733
1850
  /** Maximum size, in bytes, for a chunk to be generated. */
1734
1851
  maxSize?: OptimizationSplitChunksSizes;
1735
1852
  /** Maximum size, in bytes, for a async chunk to be generated. */
@@ -1812,8 +1929,10 @@ export type OptimizationSplitChunksOptions = {
1812
1929
  export type Optimization = {
1813
1930
  /**
1814
1931
  * Which algorithm to use when choosing module ids.
1932
+ * Setting to `false` disables the built-in algorithm, allowing a custom plugin
1933
+ * (e.g. HashedModuleIdsPlugin) to provide module ids instead.
1815
1934
  */
1816
- moduleIds?: 'named' | 'natural' | 'deterministic';
1935
+ moduleIds?: false | 'named' | 'natural' | 'deterministic' | 'hashed';
1817
1936
  /**
1818
1937
  * Which algorithm to use when choosing chunk ids.
1819
1938
  */
@@ -1848,8 +1967,6 @@ export type Optimization = {
1848
1967
  * @default false
1849
1968
  */
1850
1969
  runtimeChunk?: OptimizationRuntimeChunk;
1851
- /** Detect and remove modules from chunks these modules are already included in all parents. */
1852
- removeAvailableModules?: boolean;
1853
1970
  /**
1854
1971
  * Remove empty chunks generated in the compilation.
1855
1972
  * @default true
@@ -1976,7 +2093,7 @@ export type LazyCompilationOptions = {
1976
2093
  serverUrl?: string;
1977
2094
  /**
1978
2095
  * Customize the prefix used for lazy compilation endpoint.
1979
- * @default "/lazy-compilation-using-"
2096
+ * @default "/_rspack/lazy/trigger"
1980
2097
  */
1981
2098
  prefix?: string;
1982
2099
  };
@@ -1989,29 +2106,25 @@ export type Incremental = {
1989
2106
  */
1990
2107
  silent?: boolean;
1991
2108
  /**
1992
- * Enable incremental make.
1993
- */
1994
- make?: boolean;
1995
- /**
1996
- * Enable inference of async modules.
2109
+ * Enable incremental build module graph.
1997
2110
  */
1998
- inferAsyncModules?: boolean;
2111
+ buildModuleGraph?: boolean;
1999
2112
  /**
2000
- * Enable incremental provided exports.
2113
+ * Enable incremental finish modules.
2001
2114
  */
2002
- providedExports?: boolean;
2115
+ finishModules?: boolean;
2003
2116
  /**
2004
- * Enables diagnostics for dependencies.
2117
+ * Enable incremental optimize dependencies.
2005
2118
  */
2006
- dependenciesDiagnostics?: boolean;
2007
- /**
2008
- * Enables incremental side effects optimization.
2009
- */
2010
- sideEffects?: boolean;
2119
+ optimizeDependencies?: boolean;
2011
2120
  /**
2012
2121
  * Enable incremental build chunk graph.
2013
2122
  */
2014
2123
  buildChunkGraph?: boolean;
2124
+ /**
2125
+ * Enable incremental optimize chunk modules.
2126
+ */
2127
+ optimizeChunkModules?: boolean;
2015
2128
  /**
2016
2129
  * Enable incremental module ids.
2017
2130
  */
@@ -2041,11 +2154,11 @@ export type Incremental = {
2041
2154
  */
2042
2155
  chunksHashes?: boolean;
2043
2156
  /**
2044
- * Enable incremental chunk render.
2157
+ * Enable incremental chunk asset.
2045
2158
  */
2046
- chunksRender?: boolean;
2159
+ chunkAsset?: boolean;
2047
2160
  /**
2048
- * Enable incremental asset emission.
2161
+ * Enable incremental emit assets.
2049
2162
  */
2050
2163
  emitAssets?: boolean;
2051
2164
  };
@@ -2071,11 +2184,6 @@ export type Experiments = {
2071
2184
  * @default false
2072
2185
  */
2073
2186
  asyncWebAssembly?: boolean;
2074
- /**
2075
- * Enable output as ES module.
2076
- * @default false
2077
- */
2078
- outputModule?: boolean;
2079
2187
  /**
2080
2188
  * Enable CSS support.
2081
2189
  *
@@ -2097,10 +2205,6 @@ export type Experiments = {
2097
2205
  * ```
2098
2206
  */
2099
2207
  css?: boolean;
2100
- /**
2101
- * Enable incremental builds.
2102
- */
2103
- incremental?: IncrementalPresets | Incremental;
2104
2208
  /**
2105
2209
  * Enable future default options.
2106
2210
  * @default false
@@ -2126,6 +2230,11 @@ export type Experiments = {
2126
2230
  * @default false
2127
2231
  */
2128
2232
  deferImport?: boolean;
2233
+ /**
2234
+ * Enable pure-function-based side-effects analysis.
2235
+ * @default false
2236
+ */
2237
+ pureFunctions?: boolean;
2129
2238
  };
2130
2239
  export type Watch = boolean;
2131
2240
  /** Options for watch mode. */
@@ -2156,10 +2265,10 @@ export type WatchOptions = {
2156
2265
  stdin?: boolean;
2157
2266
  };
2158
2267
  /**
2159
- * Options for devServer, it based on `webpack-dev-server@5`
2268
+ * Options for dev server
2160
2269
  * */
2161
2270
  export type DevServer = DevServerOptions;
2162
- export type { Middleware as DevServerMiddleware } from './devServer.js';
2271
+ export type { DevServerClient, DevServerHeaders, DevServerHost, DevServerMiddleware, DevServerMiddlewareHandler, DevServerMiddlewareObject, DevServerOpenOptions, DevServerProxyConfigArray, DevServerProxyConfigArrayItem, DevServerStatic, DevServerStaticItem, DevServerWebSocketURL, } from './devServer.js';
2163
2272
  /**
2164
2273
  * Ignore specific warnings.
2165
2274
  */
@@ -2327,7 +2436,7 @@ export type RspackOptions = {
2327
2436
  /**
2328
2437
  * Configuration for the development server.
2329
2438
  */
2330
- devServer?: DevServer;
2439
+ devServer?: false | DevServer;
2331
2440
  /**
2332
2441
  * Options for module configuration.
2333
2442
  */
@@ -2350,6 +2459,10 @@ export type RspackOptions = {
2350
2459
  * @default false
2351
2460
  */
2352
2461
  lazyCompilation?: boolean | LazyCompilationOptions;
2462
+ /**
2463
+ * Enable incremental builds.
2464
+ */
2465
+ incremental?: IncrementalPresets | Incremental;
2353
2466
  };
2354
2467
  /** Configuration for Rspack */
2355
2468
  export type Configuration = RspackOptions;
@@ -2,13 +2,14 @@ import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
2
2
  import { RspackBuiltinPlugin } from '../builtin-plugin/base.js';
3
3
  import type { Compiler } from '../Compiler.js';
4
4
  import type { EntryRuntime, FilenameTemplate, LibraryOptions } from '../config/index.js';
5
+ import { type ShareScope } from '../sharing/SharePlugin.js';
5
6
  export type ContainerPluginOptions = {
6
7
  exposes: Exposes;
7
8
  filename?: FilenameTemplate;
8
9
  library?: LibraryOptions;
9
10
  name: string;
10
11
  runtime?: EntryRuntime;
11
- shareScope?: string;
12
+ shareScope?: ShareScope;
12
13
  enhanced?: boolean;
13
14
  };
14
15
  export type Exposes = (ExposesItem | ExposesObject)[] | ExposesObject;
@@ -25,7 +26,7 @@ export declare class ContainerPlugin extends RspackBuiltinPlugin {
25
26
  name: BuiltinPluginName;
26
27
  _options: {
27
28
  name: string;
28
- shareScope: string;
29
+ shareScope: ShareScope;
29
30
  library: LibraryOptions;
30
31
  runtime: EntryRuntime | undefined;
31
32
  filename: string | undefined;
@@ -2,10 +2,11 @@ import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
2
2
  import { RspackBuiltinPlugin } from '../builtin-plugin/base.js';
3
3
  import type { Compiler } from '../Compiler.js';
4
4
  import type { ExternalsType } from '../config/index.js';
5
+ import { type ShareScope } from '../sharing/SharePlugin.js';
5
6
  export type ContainerReferencePluginOptions = {
6
7
  remoteType: ExternalsType;
7
8
  remotes: Remotes;
8
- shareScope?: string;
9
+ shareScope?: ShareScope;
9
10
  enhanced?: boolean;
10
11
  };
11
12
  export type Remotes = (RemotesItem | RemotesObject)[] | RemotesObject;
@@ -16,7 +17,7 @@ export type RemotesObject = {
16
17
  };
17
18
  export type RemotesConfig = {
18
19
  external: RemotesItem | RemotesItems;
19
- shareScope?: string;
20
+ shareScope?: ShareScope;
20
21
  };
21
22
  export declare class ContainerReferencePlugin extends RspackBuiltinPlugin {
22
23
  name: BuiltinPluginName;
@@ -24,7 +25,7 @@ export declare class ContainerReferencePlugin extends RspackBuiltinPlugin {
24
25
  remoteType: ExternalsType;
25
26
  remotes: [string, {
26
27
  external: string[];
27
- shareScope: string;
28
+ shareScope: ShareScope;
28
29
  }][];
29
30
  enhanced: boolean;
30
31
  };
@@ -1,6 +1,7 @@
1
1
  import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
2
2
  import { RspackBuiltinPlugin } from '../builtin-plugin/base.js';
3
3
  import type { Compiler } from '../Compiler.js';
4
+ import { type ModuleFederationPluginOptions } from './ModuleFederationPlugin.js';
4
5
  export type RemoteAliasMap = Record<string, {
5
6
  name: string;
6
7
  entry?: string;
@@ -15,7 +16,7 @@ export type ManifestSharedOption = {
15
16
  requiredVersion?: string;
16
17
  singleton?: boolean;
17
18
  };
18
- export type ModuleFederationManifestPluginOptions = {
19
+ type InternalManifestPluginOptions = {
19
20
  name?: string;
20
21
  globalName?: string;
21
22
  filePath?: string;
@@ -25,13 +26,19 @@ export type ModuleFederationManifestPluginOptions = {
25
26
  exposes?: ManifestExposeOption[];
26
27
  shared?: ManifestSharedOption[];
27
28
  };
29
+ export type ModuleFederationManifestPluginOptions = boolean | Pick<InternalManifestPluginOptions, 'disableAssetsAnalyze' | 'filePath' | 'fileName'>;
30
+ export declare function getFileName(manifestOptions: ModuleFederationManifestPluginOptions): {
31
+ statsFileName: string;
32
+ manifestFileName: string;
33
+ };
28
34
  /**
29
35
  * JS-side post-processing plugin: reads mf-manifest.json and mf-stats.json, executes additionalData callback and merges/overwrites manifest.
30
36
  * To avoid cross-NAPI callback complexity, this plugin runs at the afterProcessAssets stage to ensure Rust-side MfManifestPlugin has already output its artifacts.
31
37
  */
32
38
  export declare class ModuleFederationManifestPlugin extends RspackBuiltinPlugin {
33
39
  name: BuiltinPluginName;
34
- private opts;
35
- constructor(opts: ModuleFederationManifestPluginOptions);
40
+ private rawOpts;
41
+ constructor(opts: ModuleFederationPluginOptions);
36
42
  raw(compiler: Compiler): BuiltinPlugin;
37
43
  }
44
+ export {};
@@ -1,15 +1,34 @@
1
1
  import type { Compiler } from '../Compiler.js';
2
+ import type { ExternalsType } from '../config/index.js';
3
+ import type { ShareScope } from '../sharing/SharePlugin.js';
2
4
  import { type ModuleFederationManifestPluginOptions } from './ModuleFederationManifestPlugin.js';
3
5
  import type { ModuleFederationPluginV1Options } from './ModuleFederationPluginV1.js';
6
+ import { type ModuleFederationRuntimeExperimentsOptions } from './ModuleFederationRuntimePlugin.js';
4
7
  export interface ModuleFederationPluginOptions extends Omit<ModuleFederationPluginV1Options, 'enhanced'> {
5
8
  runtimePlugins?: RuntimePlugins;
6
9
  implementation?: string;
7
10
  shareStrategy?: 'version-first' | 'loaded-first';
8
- manifest?: boolean | Omit<ModuleFederationManifestPluginOptions, 'remoteAliasMap' | 'globalName' | 'name' | 'exposes' | 'shared'>;
11
+ manifest?: ModuleFederationManifestPluginOptions;
12
+ injectTreeShakingUsedExports?: boolean;
13
+ treeShakingSharedDir?: string;
14
+ treeShakingSharedExcludePlugins?: string[];
15
+ treeShakingSharedPlugins?: string[];
16
+ experiments?: ModuleFederationRuntimeExperimentsOptions;
9
17
  }
10
18
  export type RuntimePlugins = string[] | [string, Record<string, unknown>][];
11
19
  export declare class ModuleFederationPlugin {
12
20
  private _options;
21
+ private _treeShakingSharedPlugin?;
13
22
  constructor(_options: ModuleFederationPluginOptions);
14
23
  apply(compiler: Compiler): void;
15
24
  }
25
+ interface RemoteInfo {
26
+ alias: string;
27
+ name?: string;
28
+ entry?: string;
29
+ externalType: ExternalsType;
30
+ shareScope: ShareScope;
31
+ }
32
+ type RemoteInfos = Record<string, RemoteInfo[]>;
33
+ export declare function getRemoteInfos(options: ModuleFederationPluginOptions): RemoteInfos;
34
+ export {};
@@ -1,6 +1,6 @@
1
1
  import type { Compiler } from '../Compiler.js';
2
2
  import type { EntryRuntime, ExternalsType, LibraryOptions } from '../config/index.js';
3
- import { type Shared } from '../sharing/SharePlugin.js';
3
+ import { type Shared, type ShareScope } from '../sharing/SharePlugin.js';
4
4
  import { type Exposes } from './ContainerPlugin.js';
5
5
  import { type Remotes } from './ContainerReferencePlugin.js';
6
6
  export interface ModuleFederationPluginV1Options {
@@ -11,7 +11,7 @@ export interface ModuleFederationPluginV1Options {
11
11
  remoteType?: ExternalsType;
12
12
  remotes?: Remotes;
13
13
  runtime?: EntryRuntime;
14
- shareScope?: string;
14
+ shareScope?: ShareScope;
15
15
  shared?: Shared;
16
16
  enhanced?: boolean;
17
17
  }
@@ -1,5 +1,9 @@
1
+ export interface ModuleFederationRuntimeExperimentsOptions {
2
+ asyncStartup?: boolean;
3
+ }
1
4
  export interface ModuleFederationRuntimeOptions {
2
5
  entryRuntime?: string;
6
+ experiments?: ModuleFederationRuntimeExperimentsOptions;
3
7
  }
4
8
  export declare const ModuleFederationRuntimePlugin: {
5
9
  new (options?: ModuleFederationRuntimeOptions | undefined): {