@rspack/core 1.2.3 → 1.2.5

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.
@@ -1,5 +1,5 @@
1
1
  import { Buffer } from 'buffer';
2
- import { AsyncSeriesBailHook, SyncHook, AsyncSeriesHook } from 'tapable';
2
+ import { SyncHook, AsyncSeriesBailHook, AsyncSeriesHook } from 'tapable';
3
3
  import { URL } from 'url';
4
4
 
5
5
  /*
@@ -1,7 +1,7 @@
1
1
  /******/ (() => { // webpackBootstrap
2
2
  /******/ var __webpack_modules__ = ({
3
3
 
4
- /***/ 767:
4
+ /***/ 682:
5
5
  /***/ ((module) => {
6
6
 
7
7
  "use strict";
@@ -32,13 +32,13 @@ function clone (obj) {
32
32
 
33
33
  /***/ }),
34
34
 
35
- /***/ 219:
35
+ /***/ 658:
36
36
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
37
37
 
38
38
  var fs = __nccwpck_require__(896)
39
- var polyfills = __nccwpck_require__(190)
40
- var legacy = __nccwpck_require__(383)
41
- var clone = __nccwpck_require__(767)
39
+ var polyfills = __nccwpck_require__(443)
40
+ var legacy = __nccwpck_require__(248)
41
+ var clone = __nccwpck_require__(682)
42
42
 
43
43
  var util = __nccwpck_require__(23)
44
44
 
@@ -216,7 +216,7 @@ function patch (fs) {
216
216
 
217
217
  function go$copyFile (src, dest, flags, cb, startTime) {
218
218
  return fs$copyFile(src, dest, flags, function (err) {
219
- if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
219
+ if (err && (err.code === 'EMFILE' || err.code === 'ENFILE' || err.code === 'EBUSY'))
220
220
  enqueue([go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now()])
221
221
  else {
222
222
  if (typeof cb === 'function')
@@ -487,7 +487,7 @@ function retry () {
487
487
 
488
488
  /***/ }),
489
489
 
490
- /***/ 383:
490
+ /***/ 248:
491
491
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
492
492
 
493
493
  var Stream = (__nccwpck_require__(203).Stream)
@@ -612,7 +612,7 @@ function legacy (fs) {
612
612
 
613
613
  /***/ }),
614
614
 
615
- /***/ 190:
615
+ /***/ 443:
616
616
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
617
617
 
618
618
  var constants = __nccwpck_require__(140)
@@ -1056,7 +1056,7 @@ module.exports = require("util");
1056
1056
  /******/ // startup
1057
1057
  /******/ // Load entry module and return exports
1058
1058
  /******/ // This entry module is referenced by other modules so it can't be inlined
1059
- /******/ var __webpack_exports__ = __nccwpck_require__(219);
1059
+ /******/ var __webpack_exports__ = __nccwpck_require__(658);
1060
1060
  /******/ module.exports = __webpack_exports__;
1061
1061
  /******/
1062
1062
  /******/ })()
@@ -1,4 +1,5 @@
1
1
  import type { JsChunkGraph } from "@rspack/binding";
2
+ import type { RuntimeSpec } from "./util/runtime";
2
3
  import { Chunk } from "./Chunk";
3
4
  import { ChunkGroup } from "./ChunkGroup";
4
5
  import { DependenciesBlock } from "./DependenciesBlock";
@@ -6,7 +7,7 @@ import { Module } from "./Module";
6
7
  export declare class ChunkGraph {
7
8
  #private;
8
9
  static __from_binding(binding: JsChunkGraph): ChunkGraph;
9
- private constructor();
10
+ constructor(binding: JsChunkGraph);
10
11
  getChunkModules(chunk: Chunk): ReadonlyArray<Module>;
11
12
  getChunkModulesIterable(chunk: Chunk): Iterable<Module>;
12
13
  getChunkEntryModulesIterable(chunk: Chunk): Iterable<Module>;
@@ -16,5 +17,6 @@ export declare class ChunkGraph {
16
17
  getModuleChunks(module: Module): Chunk[];
17
18
  getModuleChunksIterable(module: Module): Iterable<Chunk>;
18
19
  getModuleId(module: Module): string | null;
20
+ getModuleHash(module: Module, runtime: RuntimeSpec): string | null;
19
21
  getBlockChunkGroup(depBlock: DependenciesBlock): ChunkGroup | null;
20
22
  }
@@ -310,7 +310,7 @@ export declare class Compilation {
310
310
  };
311
311
  getStats(): Stats;
312
312
  createChildCompiler(name: string, outputOptions: OutputNormalized, plugins: RspackPluginInstance[]): Compiler;
313
- rebuildModule(m: Module, f: (err: Error, m: Module) => void): void;
313
+ rebuildModule(m: Module, f: (err: Error | null, m: Module | null) => void): void;
314
314
  addRuntimeModule(chunk: Chunk, runtimeModule: RuntimeModule): void;
315
315
  addInclude(context: string, dependency: ReturnType<typeof EntryPlugin.createDependency>, options: EntryOptions, callback: (err?: null | WebpackError, module?: Module) => void): void;
316
316
  /**
@@ -1,5 +1,5 @@
1
1
  import type { JsExportsInfo } from "@rspack/binding";
2
- type RuntimeSpec = string | string[] | undefined;
2
+ import type { RuntimeSpec } from "./util/runtime";
3
3
  /**
4
4
  * Unused: 0
5
5
  * OnlyPropertiesUsed: 1
@@ -6,7 +6,7 @@ import { ModuleGraphConnection } from "./ModuleGraphConnection";
6
6
  export default class ModuleGraph {
7
7
  #private;
8
8
  static __from_binding(binding: JsModuleGraph): ModuleGraph;
9
- private constructor();
9
+ constructor(binding: JsModuleGraph);
10
10
  getModule(dependency: Dependency): Module | null;
11
11
  getResolvedModule(dependency: Dependency): Module | null;
12
12
  getParentModule(dependency: Dependency): Module | null;
@@ -0,0 +1,40 @@
1
+ import { BuiltinPluginName, type RawSubresourceIntegrityPluginOptions } from "@rspack/binding";
2
+ import type { Compiler } from "../Compiler";
3
+ export type SubresourceIntegrityHashFunction = "sha256" | "sha384" | "sha512";
4
+ export type SubresourceIntegrityPluginOptions = {
5
+ hashFuncNames?: [
6
+ SubresourceIntegrityHashFunction,
7
+ ...SubresourceIntegrityHashFunction[]
8
+ ];
9
+ htmlPlugin?: string | false;
10
+ enabled?: "auto" | boolean;
11
+ };
12
+ export type NativeSubresourceIntegrityPluginOptions = Omit<RawSubresourceIntegrityPluginOptions, "htmlPlugin"> & {
13
+ htmlPlugin: string | false;
14
+ };
15
+ /**
16
+ * Note: This is not a webpack public API, maybe removed in future.
17
+ * @internal
18
+ */
19
+ declare const NativeSubresourceIntegrityPlugin: {
20
+ new (options: NativeSubresourceIntegrityPluginOptions): {
21
+ name: BuiltinPluginName;
22
+ _args: [options: NativeSubresourceIntegrityPluginOptions];
23
+ affectedHooks: "done" | "environment" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
24
+ raw(compiler: Compiler): import("@rspack/binding").BuiltinPlugin;
25
+ apply(compiler: Compiler): void;
26
+ };
27
+ };
28
+ export declare class SubresourceIntegrityPlugin extends NativeSubresourceIntegrityPlugin {
29
+ private integrities;
30
+ private options;
31
+ private validateError;
32
+ constructor(options: SubresourceIntegrityPluginOptions);
33
+ private isEnabled;
34
+ private getIntegrityChecksumForAsset;
35
+ private handleHwpPluginArgs;
36
+ private handleHwpBodyTags;
37
+ private processTag;
38
+ apply(compiler: Compiler): void;
39
+ }
40
+ export {};
@@ -71,3 +71,4 @@ export * from "./LibManifestPlugin";
71
71
  export * from "./DllEntryPlugin";
72
72
  export * from "./DllReferenceAgencyPlugin";
73
73
  export * from "./RsdoctorPlugin";
74
+ export * from "./SubresourceIntegrityPlugin";
@@ -32,7 +32,7 @@ export interface LazyCompilationDefaultBackendOptions {
32
32
  export type ServerOptionsHttps<Request extends typeof IncomingMessage = typeof IncomingMessage, Response extends typeof ServerResponse = typeof ServerResponse> = SecureContextOptions & TlsOptions & ServerOptionsImport<Request, Response>;
33
33
  declare const getBackend: (options: Omit<LazyCompilationDefaultBackendOptions, "client"> & {
34
34
  client: NonNullable<LazyCompilationDefaultBackendOptions["client"]>;
35
- }) => (compiler: Compiler, callback: (err: any, obj?: {
35
+ }) => (compiler: Compiler, callback: (err: Error | null, obj?: {
36
36
  dispose: (callback: (err: any) => void) => void;
37
37
  module: (args: {
38
38
  module: string;
@@ -1,8 +1,10 @@
1
1
  import type { JsAssetInfo, RawFuncUseCtx } from "@rspack/binding";
2
2
  import type * as webpackDevServer from "webpack-dev-server";
3
+ import type { ChunkGraph } from "../ChunkGraph";
3
4
  import type { Compilation, PathData } from "../Compilation";
4
5
  import type { Compiler } from "../Compiler";
5
6
  import type { Module } from "../Module";
7
+ import type ModuleGraph from "../ModuleGraph";
6
8
  import type { LazyCompilationDefaultBackendOptions } from "../builtin-plugin/lazy-compilation/backend";
7
9
  import type { Chunk } from "../exports";
8
10
  export type FilenameTemplate = string;
@@ -1545,6 +1547,8 @@ type SharedOptimizationSplitChunksCacheGroup = {
1545
1547
  * @default false
1546
1548
  * */
1547
1549
  name?: false | OptimizationSplitChunksName;
1550
+ /** Allows to override the filename when and only when it's an initial chunk. */
1551
+ filename?: Filename;
1548
1552
  /**
1549
1553
  * Minimum size, in bytes, for a chunk to be generated.
1550
1554
  *
@@ -1552,6 +1556,7 @@ type SharedOptimizationSplitChunksCacheGroup = {
1552
1556
  * The value is `10000` in others mode.
1553
1557
  */
1554
1558
  minSize?: OptimizationSplitChunksSizes;
1559
+ minSizeReduction?: OptimizationSplitChunksSizes;
1555
1560
  /** Maximum size, in bytes, for a chunk to be generated. */
1556
1561
  maxSize?: OptimizationSplitChunksSizes;
1557
1562
  /** Maximum size, in bytes, for a async chunk to be generated. */
@@ -1575,10 +1580,14 @@ type SharedOptimizationSplitChunksCacheGroup = {
1575
1580
  */
1576
1581
  automaticNameDelimiter?: string;
1577
1582
  };
1583
+ export type OptimizationSplitChunksCacheGroupTestFn = (module: Module, ctx: {
1584
+ chunkGraph: ChunkGraph;
1585
+ moduleGraph: ModuleGraph;
1586
+ }) => boolean;
1578
1587
  /** How to splitting chunks. */
1579
1588
  export type OptimizationSplitChunksCacheGroup = {
1580
1589
  /** Controls which modules are selected by this cache group. */
1581
- test?: string | RegExp | ((module: Module) => unknown);
1590
+ test?: string | RegExp | OptimizationSplitChunksCacheGroupTestFn;
1582
1591
  /**
1583
1592
  * A module can belong to multiple cache groups.
1584
1593
  * @default -20
@@ -1588,8 +1597,6 @@ export type OptimizationSplitChunksCacheGroup = {
1588
1597
  * Tells Rspack to ignore `splitChunks.minSize`, `splitChunks.minChunks`, `splitChunks.maxAsyncRequests` and `splitChunks.maxInitialRequests` options and always create chunks for this cache group.
1589
1598
  */
1590
1599
  enforce?: boolean;
1591
- /** Allows to override the filename when and only when it's an initial chunk. */
1592
- filename?: Filename;
1593
1600
  /**
1594
1601
  * Whether to reuse existing chunks when possible.
1595
1602
  * @default false
@@ -1,8 +1,10 @@
1
1
  import type { JsAssetInfo } from "@rspack/binding";
2
2
  import { z } from "../../compiled/zod";
3
3
  import { Chunk } from "../Chunk";
4
+ import { ChunkGraph } from "../ChunkGraph";
4
5
  import type { Compilation, PathData } from "../Compilation";
5
6
  import { Module } from "../Module";
7
+ import ModuleGraph from "../ModuleGraph";
6
8
  import type * as t from "./types";
7
9
  import { ZodRspackCrossChecker } from "./utils";
8
10
  export declare const externalsType: z.ZodEnum<["var", "module", "assign", "this", "window", "self", "global", "commonjs", "commonjs2", "commonjs-module", "commonjs-static", "amd", "amd-require", "umd", "umd2", "jsonp", "system", "promise", "import", "module-import", "script", "node-commonjs", "commonjs-import"]>;
@@ -1540,6 +1542,7 @@ export declare const rspackOptions: z.ZodObject<{
1540
1542
  minChunks: z.ZodOptional<z.ZodNumber>;
1541
1543
  usedExports: z.ZodOptional<z.ZodBoolean>;
1542
1544
  name: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>, z.ZodFunction<z.ZodTuple<[z.ZodType<Module, z.ZodTypeDef, Module>, z.ZodArray<z.ZodType<Chunk, z.ZodTypeDef, Chunk>, "many">, z.ZodString], z.ZodUnknown>, z.ZodOptional<z.ZodString>>]>>;
1545
+ filename: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<PathData, z.ZodTypeDef, PathData>, z.ZodOptional<z.ZodType<JsAssetInfo, z.ZodTypeDef, JsAssetInfo>>], z.ZodUnknown>, z.ZodString>]>>;
1543
1546
  minSize: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodRecord<z.ZodString, z.ZodNumber>]>>;
1544
1547
  maxSize: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodRecord<z.ZodString, z.ZodNumber>]>>;
1545
1548
  maxAsyncSize: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodRecord<z.ZodString, z.ZodNumber>]>>;
@@ -1553,6 +1556,7 @@ export declare const rspackOptions: z.ZodObject<{
1553
1556
  minChunks: z.ZodOptional<z.ZodNumber>;
1554
1557
  usedExports: z.ZodOptional<z.ZodBoolean>;
1555
1558
  name: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>, z.ZodFunction<z.ZodTuple<[z.ZodType<Module, z.ZodTypeDef, Module>, z.ZodArray<z.ZodType<Chunk, z.ZodTypeDef, Chunk>, "many">, z.ZodString], z.ZodUnknown>, z.ZodOptional<z.ZodString>>]>>;
1559
+ filename: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<PathData, z.ZodTypeDef, PathData>, z.ZodOptional<z.ZodType<JsAssetInfo, z.ZodTypeDef, JsAssetInfo>>], z.ZodUnknown>, z.ZodString>]>>;
1556
1560
  minSize: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodRecord<z.ZodString, z.ZodNumber>]>>;
1557
1561
  maxSize: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodRecord<z.ZodString, z.ZodNumber>]>>;
1558
1562
  maxAsyncSize: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodRecord<z.ZodString, z.ZodNumber>]>>;
@@ -1560,10 +1564,18 @@ export declare const rspackOptions: z.ZodObject<{
1560
1564
  maxAsyncRequests: z.ZodOptional<z.ZodNumber>;
1561
1565
  maxInitialRequests: z.ZodOptional<z.ZodNumber>;
1562
1566
  automaticNameDelimiter: z.ZodOptional<z.ZodString>;
1563
- test: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodFunction<z.ZodTuple<[z.ZodType<Module, z.ZodTypeDef, Module>], z.ZodUnknown>, z.ZodUnknown>]>>;
1567
+ test: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodFunction<z.ZodTuple<[z.ZodType<Module, z.ZodTypeDef, Module>, z.ZodObject<{
1568
+ moduleGraph: z.ZodType<ModuleGraph, z.ZodTypeDef, ModuleGraph>;
1569
+ chunkGraph: z.ZodType<ChunkGraph, z.ZodTypeDef, ChunkGraph>;
1570
+ }, "strip", z.ZodTypeAny, {
1571
+ moduleGraph: ModuleGraph;
1572
+ chunkGraph: ChunkGraph;
1573
+ }, {
1574
+ moduleGraph: ModuleGraph;
1575
+ chunkGraph: ChunkGraph;
1576
+ }>], z.ZodUnknown>, z.ZodBoolean>]>>;
1564
1577
  priority: z.ZodOptional<z.ZodNumber>;
1565
1578
  enforce: z.ZodOptional<z.ZodBoolean>;
1566
- filename: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<PathData, z.ZodTypeDef, PathData>, z.ZodOptional<z.ZodType<JsAssetInfo, z.ZodTypeDef, JsAssetInfo>>], z.ZodUnknown>, z.ZodString>]>>;
1567
1579
  reuseExistingChunk: z.ZodOptional<z.ZodBoolean>;
1568
1580
  type: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>>;
1569
1581
  idHint: z.ZodOptional<z.ZodString>;
@@ -1578,6 +1590,10 @@ export declare const rspackOptions: z.ZodObject<{
1578
1590
  defaultSizeTypes?: string[] | undefined;
1579
1591
  maxSize?: number | Record<string, number> | undefined;
1580
1592
  priority?: number | undefined;
1593
+ test?: string | RegExp | ((args_0: Module, args_1: {
1594
+ moduleGraph: ModuleGraph;
1595
+ chunkGraph: ChunkGraph;
1596
+ }, ...args: unknown[]) => boolean) | undefined;
1581
1597
  minSize?: number | Record<string, number> | undefined;
1582
1598
  maxAsyncSize?: number | Record<string, number> | undefined;
1583
1599
  maxInitialSize?: number | Record<string, number> | undefined;
@@ -1585,7 +1601,6 @@ export declare const rspackOptions: z.ZodObject<{
1585
1601
  maxAsyncRequests?: number | undefined;
1586
1602
  maxInitialRequests?: number | undefined;
1587
1603
  automaticNameDelimiter?: string | undefined;
1588
- test?: string | RegExp | ((args_0: Module, ...args: unknown[]) => unknown) | undefined;
1589
1604
  enforce?: boolean | undefined;
1590
1605
  reuseExistingChunk?: boolean | undefined;
1591
1606
  idHint?: string | undefined;
@@ -1599,6 +1614,10 @@ export declare const rspackOptions: z.ZodObject<{
1599
1614
  defaultSizeTypes?: string[] | undefined;
1600
1615
  maxSize?: number | Record<string, number> | undefined;
1601
1616
  priority?: number | undefined;
1617
+ test?: string | RegExp | ((args_0: Module, args_1: {
1618
+ moduleGraph: ModuleGraph;
1619
+ chunkGraph: ChunkGraph;
1620
+ }, ...args: unknown[]) => boolean) | undefined;
1602
1621
  minSize?: number | Record<string, number> | undefined;
1603
1622
  maxAsyncSize?: number | Record<string, number> | undefined;
1604
1623
  maxInitialSize?: number | Record<string, number> | undefined;
@@ -1606,7 +1625,6 @@ export declare const rspackOptions: z.ZodObject<{
1606
1625
  maxAsyncRequests?: number | undefined;
1607
1626
  maxInitialRequests?: number | undefined;
1608
1627
  automaticNameDelimiter?: string | undefined;
1609
- test?: string | RegExp | ((args_0: Module, ...args: unknown[]) => unknown) | undefined;
1610
1628
  enforce?: boolean | undefined;
1611
1629
  reuseExistingChunk?: boolean | undefined;
1612
1630
  idHint?: string | undefined;
@@ -1637,6 +1655,7 @@ export declare const rspackOptions: z.ZodObject<{
1637
1655
  }, "strict", z.ZodTypeAny, {
1638
1656
  chunks?: RegExp | "initial" | "async" | "all" | ((args_0: Chunk, ...args: unknown[]) => boolean) | undefined;
1639
1657
  name?: string | false | ((args_0: Module, args_1: Chunk[], args_2: string, ...args: unknown[]) => string | undefined) | undefined;
1658
+ filename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined;
1640
1659
  usedExports?: boolean | undefined;
1641
1660
  defaultSizeTypes?: string[] | undefined;
1642
1661
  cacheGroups?: Record<string, false | {
@@ -1649,6 +1668,10 @@ export declare const rspackOptions: z.ZodObject<{
1649
1668
  defaultSizeTypes?: string[] | undefined;
1650
1669
  maxSize?: number | Record<string, number> | undefined;
1651
1670
  priority?: number | undefined;
1671
+ test?: string | RegExp | ((args_0: Module, args_1: {
1672
+ moduleGraph: ModuleGraph;
1673
+ chunkGraph: ChunkGraph;
1674
+ }, ...args: unknown[]) => boolean) | undefined;
1652
1675
  minSize?: number | Record<string, number> | undefined;
1653
1676
  maxAsyncSize?: number | Record<string, number> | undefined;
1654
1677
  maxInitialSize?: number | Record<string, number> | undefined;
@@ -1656,7 +1679,6 @@ export declare const rspackOptions: z.ZodObject<{
1656
1679
  maxAsyncRequests?: number | undefined;
1657
1680
  maxInitialRequests?: number | undefined;
1658
1681
  automaticNameDelimiter?: string | undefined;
1659
- test?: string | RegExp | ((args_0: Module, ...args: unknown[]) => unknown) | undefined;
1660
1682
  enforce?: boolean | undefined;
1661
1683
  reuseExistingChunk?: boolean | undefined;
1662
1684
  idHint?: string | undefined;
@@ -1681,6 +1703,7 @@ export declare const rspackOptions: z.ZodObject<{
1681
1703
  }, {
1682
1704
  chunks?: RegExp | "initial" | "async" | "all" | ((args_0: Chunk, ...args: unknown[]) => boolean) | undefined;
1683
1705
  name?: string | false | ((args_0: Module, args_1: Chunk[], args_2: string, ...args: unknown[]) => string | undefined) | undefined;
1706
+ filename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined;
1684
1707
  usedExports?: boolean | undefined;
1685
1708
  defaultSizeTypes?: string[] | undefined;
1686
1709
  cacheGroups?: Record<string, false | {
@@ -1693,6 +1716,10 @@ export declare const rspackOptions: z.ZodObject<{
1693
1716
  defaultSizeTypes?: string[] | undefined;
1694
1717
  maxSize?: number | Record<string, number> | undefined;
1695
1718
  priority?: number | undefined;
1719
+ test?: string | RegExp | ((args_0: Module, args_1: {
1720
+ moduleGraph: ModuleGraph;
1721
+ chunkGraph: ChunkGraph;
1722
+ }, ...args: unknown[]) => boolean) | undefined;
1696
1723
  minSize?: number | Record<string, number> | undefined;
1697
1724
  maxAsyncSize?: number | Record<string, number> | undefined;
1698
1725
  maxInitialSize?: number | Record<string, number> | undefined;
@@ -1700,7 +1727,6 @@ export declare const rspackOptions: z.ZodObject<{
1700
1727
  maxAsyncRequests?: number | undefined;
1701
1728
  maxInitialRequests?: number | undefined;
1702
1729
  automaticNameDelimiter?: string | undefined;
1703
- test?: string | RegExp | ((args_0: Module, ...args: unknown[]) => unknown) | undefined;
1704
1730
  enforce?: boolean | undefined;
1705
1731
  reuseExistingChunk?: boolean | undefined;
1706
1732
  idHint?: string | undefined;
@@ -1764,6 +1790,7 @@ export declare const rspackOptions: z.ZodObject<{
1764
1790
  splitChunks?: false | {
1765
1791
  chunks?: RegExp | "initial" | "async" | "all" | ((args_0: Chunk, ...args: unknown[]) => boolean) | undefined;
1766
1792
  name?: string | false | ((args_0: Module, args_1: Chunk[], args_2: string, ...args: unknown[]) => string | undefined) | undefined;
1793
+ filename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined;
1767
1794
  usedExports?: boolean | undefined;
1768
1795
  defaultSizeTypes?: string[] | undefined;
1769
1796
  cacheGroups?: Record<string, false | {
@@ -1776,6 +1803,10 @@ export declare const rspackOptions: z.ZodObject<{
1776
1803
  defaultSizeTypes?: string[] | undefined;
1777
1804
  maxSize?: number | Record<string, number> | undefined;
1778
1805
  priority?: number | undefined;
1806
+ test?: string | RegExp | ((args_0: Module, args_1: {
1807
+ moduleGraph: ModuleGraph;
1808
+ chunkGraph: ChunkGraph;
1809
+ }, ...args: unknown[]) => boolean) | undefined;
1779
1810
  minSize?: number | Record<string, number> | undefined;
1780
1811
  maxAsyncSize?: number | Record<string, number> | undefined;
1781
1812
  maxInitialSize?: number | Record<string, number> | undefined;
@@ -1783,7 +1814,6 @@ export declare const rspackOptions: z.ZodObject<{
1783
1814
  maxAsyncRequests?: number | undefined;
1784
1815
  maxInitialRequests?: number | undefined;
1785
1816
  automaticNameDelimiter?: string | undefined;
1786
- test?: string | RegExp | ((args_0: Module, ...args: unknown[]) => unknown) | undefined;
1787
1817
  enforce?: boolean | undefined;
1788
1818
  reuseExistingChunk?: boolean | undefined;
1789
1819
  idHint?: string | undefined;
@@ -1832,6 +1862,7 @@ export declare const rspackOptions: z.ZodObject<{
1832
1862
  splitChunks?: false | {
1833
1863
  chunks?: RegExp | "initial" | "async" | "all" | ((args_0: Chunk, ...args: unknown[]) => boolean) | undefined;
1834
1864
  name?: string | false | ((args_0: Module, args_1: Chunk[], args_2: string, ...args: unknown[]) => string | undefined) | undefined;
1865
+ filename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined;
1835
1866
  usedExports?: boolean | undefined;
1836
1867
  defaultSizeTypes?: string[] | undefined;
1837
1868
  cacheGroups?: Record<string, false | {
@@ -1844,6 +1875,10 @@ export declare const rspackOptions: z.ZodObject<{
1844
1875
  defaultSizeTypes?: string[] | undefined;
1845
1876
  maxSize?: number | Record<string, number> | undefined;
1846
1877
  priority?: number | undefined;
1878
+ test?: string | RegExp | ((args_0: Module, args_1: {
1879
+ moduleGraph: ModuleGraph;
1880
+ chunkGraph: ChunkGraph;
1881
+ }, ...args: unknown[]) => boolean) | undefined;
1847
1882
  minSize?: number | Record<string, number> | undefined;
1848
1883
  maxAsyncSize?: number | Record<string, number> | undefined;
1849
1884
  maxInitialSize?: number | Record<string, number> | undefined;
@@ -1851,7 +1886,6 @@ export declare const rspackOptions: z.ZodObject<{
1851
1886
  maxAsyncRequests?: number | undefined;
1852
1887
  maxInitialRequests?: number | undefined;
1853
1888
  automaticNameDelimiter?: string | undefined;
1854
- test?: string | RegExp | ((args_0: Module, ...args: unknown[]) => unknown) | undefined;
1855
1889
  enforce?: boolean | undefined;
1856
1890
  reuseExistingChunk?: boolean | undefined;
1857
1891
  idHint?: string | undefined;
@@ -3460,6 +3494,7 @@ export declare const rspackOptions: z.ZodObject<{
3460
3494
  splitChunks?: false | {
3461
3495
  chunks?: RegExp | "initial" | "async" | "all" | ((args_0: Chunk, ...args: unknown[]) => boolean) | undefined;
3462
3496
  name?: string | false | ((args_0: Module, args_1: Chunk[], args_2: string, ...args: unknown[]) => string | undefined) | undefined;
3497
+ filename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined;
3463
3498
  usedExports?: boolean | undefined;
3464
3499
  defaultSizeTypes?: string[] | undefined;
3465
3500
  cacheGroups?: Record<string, false | {
@@ -3472,6 +3507,10 @@ export declare const rspackOptions: z.ZodObject<{
3472
3507
  defaultSizeTypes?: string[] | undefined;
3473
3508
  maxSize?: number | Record<string, number> | undefined;
3474
3509
  priority?: number | undefined;
3510
+ test?: string | RegExp | ((args_0: Module, args_1: {
3511
+ moduleGraph: ModuleGraph;
3512
+ chunkGraph: ChunkGraph;
3513
+ }, ...args: unknown[]) => boolean) | undefined;
3475
3514
  minSize?: number | Record<string, number> | undefined;
3476
3515
  maxAsyncSize?: number | Record<string, number> | undefined;
3477
3516
  maxInitialSize?: number | Record<string, number> | undefined;
@@ -3479,7 +3518,6 @@ export declare const rspackOptions: z.ZodObject<{
3479
3518
  maxAsyncRequests?: number | undefined;
3480
3519
  maxInitialRequests?: number | undefined;
3481
3520
  automaticNameDelimiter?: string | undefined;
3482
- test?: string | RegExp | ((args_0: Module, ...args: unknown[]) => unknown) | undefined;
3483
3521
  enforce?: boolean | undefined;
3484
3522
  reuseExistingChunk?: boolean | undefined;
3485
3523
  idHint?: string | undefined;
@@ -4067,6 +4105,7 @@ export declare const rspackOptions: z.ZodObject<{
4067
4105
  splitChunks?: false | {
4068
4106
  chunks?: RegExp | "initial" | "async" | "all" | ((args_0: Chunk, ...args: unknown[]) => boolean) | undefined;
4069
4107
  name?: string | false | ((args_0: Module, args_1: Chunk[], args_2: string, ...args: unknown[]) => string | undefined) | undefined;
4108
+ filename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined;
4070
4109
  usedExports?: boolean | undefined;
4071
4110
  defaultSizeTypes?: string[] | undefined;
4072
4111
  cacheGroups?: Record<string, false | {
@@ -4079,6 +4118,10 @@ export declare const rspackOptions: z.ZodObject<{
4079
4118
  defaultSizeTypes?: string[] | undefined;
4080
4119
  maxSize?: number | Record<string, number> | undefined;
4081
4120
  priority?: number | undefined;
4121
+ test?: string | RegExp | ((args_0: Module, args_1: {
4122
+ moduleGraph: ModuleGraph;
4123
+ chunkGraph: ChunkGraph;
4124
+ }, ...args: unknown[]) => boolean) | undefined;
4082
4125
  minSize?: number | Record<string, number> | undefined;
4083
4126
  maxAsyncSize?: number | Record<string, number> | undefined;
4084
4127
  maxInitialSize?: number | Record<string, number> | undefined;
@@ -4086,7 +4129,6 @@ export declare const rspackOptions: z.ZodObject<{
4086
4129
  maxAsyncRequests?: number | undefined;
4087
4130
  maxInitialRequests?: number | undefined;
4088
4131
  automaticNameDelimiter?: string | undefined;
4089
- test?: string | RegExp | ((args_0: Module, ...args: unknown[]) => unknown) | undefined;
4090
4132
  enforce?: boolean | undefined;
4091
4133
  reuseExistingChunk?: boolean | undefined;
4092
4134
  idHint?: string | undefined;
package/dist/exports.d.ts CHANGED
@@ -65,7 +65,7 @@ export { EnvironmentPlugin } from "./lib/EnvironmentPlugin";
65
65
  export { LoaderOptionsPlugin } from "./lib/LoaderOptionsPlugin";
66
66
  export { LoaderTargetPlugin } from "./lib/LoaderTargetPlugin";
67
67
  export { NormalModuleReplacementPlugin } from "./lib/NormalModuleReplacementPlugin";
68
- import { FetchCompileAsyncWasmPlugin } from "./builtin-plugin";
68
+ import { FetchCompileAsyncWasmPlugin, SubresourceIntegrityPlugin } from "./builtin-plugin";
69
69
  interface Web {
70
70
  FetchCompileAsyncWasmPlugin: typeof FetchCompileAsyncWasmPlugin;
71
71
  }
@@ -160,6 +160,7 @@ export { CssExtractRspackPlugin } from "./builtin-plugin";
160
160
  export { ContextReplacementPlugin } from "./builtin-plugin";
161
161
  export type { SwcLoaderEnvConfig, SwcLoaderEsParserConfig, SwcLoaderJscConfig, SwcLoaderModuleConfig, SwcLoaderOptions, SwcLoaderParserConfig, SwcLoaderTransformConfig, SwcLoaderTsParserConfig } from "./builtin-loader/swc/index";
162
162
  export type { LoaderOptions as LightningcssLoaderOptions, FeatureOptions as LightningcssFeatureOptions } from "./builtin-loader/lightningcss/index";
163
+ export type { SubresourceIntegrityPluginOptions } from "./builtin-plugin";
163
164
  interface Experiments {
164
165
  globalTrace: {
165
166
  register: (filter: string, layer: "chrome" | "logger" | "otel", output: string) => Promise<void>;
@@ -167,5 +168,6 @@ interface Experiments {
167
168
  };
168
169
  RemoveDuplicateModulesPlugin: typeof RemoveDuplicateModulesPlugin;
169
170
  RsdoctorPlugin: typeof RsdoctorPlugin;
171
+ SubresourceIntegrityPlugin: typeof SubresourceIntegrityPlugin;
170
172
  }
171
173
  export declare const experiments: Experiments;