@rspack/core 1.0.7 → 1.0.8

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.
@@ -164,10 +164,7 @@ export declare class Compilation {
164
164
  Chunk,
165
165
  Set<string>
166
166
  ], void>;
167
- runtimeRequirementInTree: liteTapable.SyncBailHook<[
168
- Chunk,
169
- Set<string>
170
- ], void>;
167
+ runtimeRequirementInTree: liteTapable.HookMap<liteTapable.SyncBailHook<[Chunk, Set<string>], void>>;
171
168
  runtimeModule: liteTapable.SyncHook<[JsRuntimeModule, Chunk], void>;
172
169
  seal: liteTapable.SyncHook<[], void>;
173
170
  afterSeal: liteTapable.AsyncSeriesHook<[], void>;
@@ -206,6 +203,7 @@ export declare class Compilation {
206
203
  */
207
204
  get namedChunkGroups(): ReadonlyMap<string, Readonly<ChunkGroup>>;
208
205
  get modules(): ReadonlySet<Module>;
206
+ get builtModules(): ReadonlySet<Module>;
209
207
  get chunks(): ReadonlySet<Chunk>;
210
208
  /**
211
209
  * Get the named chunks.
@@ -160,10 +160,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
160
160
  "chunk",
161
161
  "runtimeRequirements"
162
162
  ]),
163
- runtimeRequirementInTree: new liteTapable.SyncBailHook([
164
- "chunk",
165
- "runtimeRequirements"
166
- ]),
163
+ runtimeRequirementInTree: new liteTapable.HookMap(() => new liteTapable.SyncBailHook(["chunk", "runtimeRequirements"])),
167
164
  runtimeModule: new liteTapable.SyncHook(["module", "chunk"]),
168
165
  seal: new liteTapable.SyncHook([]),
169
166
  afterSeal: new liteTapable.AsyncSeriesHook([])
@@ -224,6 +221,9 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
224
221
  get modules() {
225
222
  return new Set(__classPrivateFieldGet(this, _Compilation_inner, "f").modules.map(module => Module_1.Module.__from_binding(module, this)));
226
223
  }
224
+ get builtModules() {
225
+ return new Set(__classPrivateFieldGet(this, _Compilation_inner, "f").builtModules.map(module => Module_1.Module.__from_binding(module, this)));
226
+ }
227
227
  get chunks() {
228
228
  return (0, memoize_1.memoizeValue)(() => new Set(this.__internal__getChunks()));
229
229
  }
@@ -452,10 +452,10 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
452
452
  }
453
453
  ];
454
454
  for (const item of proxyMethod) {
455
- const proxyedMethod = new Proxy(errors[item.method], {
455
+ const proxiedMethod = new Proxy(errors[item.method], {
456
456
  apply: item.handler
457
457
  });
458
- errors[item.method] = proxyedMethod;
458
+ errors[item.method] = proxiedMethod;
459
459
  }
460
460
  return errors;
461
461
  }
@@ -514,10 +514,10 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
514
514
  }
515
515
  ];
516
516
  for (const item of proxyMethod) {
517
- const proxyedMethod = new Proxy(warnings[item.method], {
517
+ const proxiedMethod = new Proxy(warnings[item.method], {
518
518
  apply: item.handler
519
519
  });
520
- warnings[item.method] = proxyedMethod;
520
+ warnings[item.method] = proxiedMethod;
521
521
  }
522
522
  return warnings;
523
523
  }
package/dist/Compiler.js CHANGED
@@ -594,9 +594,12 @@ _Compiler_instance = new WeakMap(), _Compiler_initial = new WeakMap(), _Compiler
594
594
  runtimeRequirements: (0, RuntimeGlobals_1.__to_binding_runtime_globals)(set)
595
595
  };
596
596
  }),
597
- registerCompilationRuntimeRequirementInTree: __classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_createHookRegisterTaps).call(this, binding.RegisterJsTapKind.CompilationRuntimeRequirementInTree, () => __classPrivateFieldGet(this, _Compiler_compilation, "f").hooks.runtimeRequirementInTree, queried => ({ chunk, runtimeRequirements }) => {
597
+ registerCompilationRuntimeRequirementInTree: __classPrivateFieldGet(this, _Compiler_instances, "m", _Compiler_createHookMapRegisterTaps).call(this, binding.RegisterJsTapKind.CompilationRuntimeRequirementInTree, () => __classPrivateFieldGet(this, _Compiler_compilation, "f").hooks.runtimeRequirementInTree, queried => ({ chunk: rawChunk, runtimeRequirements }) => {
598
598
  const set = (0, RuntimeGlobals_1.__from_binding_runtime_globals)(runtimeRequirements);
599
- queried.call(Chunk_1.Chunk.__from_binding(chunk, __classPrivateFieldGet(this, _Compiler_compilation, "f")), set);
599
+ const chunk = Chunk_1.Chunk.__from_binding(rawChunk, __classPrivateFieldGet(this, _Compiler_compilation, "f"));
600
+ for (const r of set) {
601
+ queried.for(r).call(chunk, set);
602
+ }
600
603
  return {
601
604
  runtimeRequirements: (0, RuntimeGlobals_1.__to_binding_runtime_globals)(set)
602
605
  };
@@ -28,5 +28,5 @@ export declare class RuntimeModule {
28
28
  identifier(): string;
29
29
  readableIdentifier(): string;
30
30
  shouldIsolate(): boolean;
31
- generate(compilation: Compilation): string;
31
+ generate(): string;
32
32
  }
@@ -13,7 +13,7 @@ class RuntimeModule {
13
13
  return {
14
14
  name: module.name,
15
15
  stage: module.stage,
16
- generator: () => module.generate(compilation),
16
+ generator: module.generate.bind(module),
17
17
  cacheable: !(module.fullHash || module.dependentHash),
18
18
  isolate: module.shouldIsolate()
19
19
  };
@@ -47,7 +47,7 @@ class RuntimeModule {
47
47
  shouldIsolate() {
48
48
  return true;
49
49
  }
50
- generate(compilation) {
50
+ generate() {
51
51
  throw new Error(`Should implement "generate" method of runtime module "${this.name}"`);
52
52
  }
53
53
  }
@@ -1,188 +1,40 @@
1
1
  import { BuiltinPluginName, type JsChunk } from "@rspack/binding";
2
- import { z } from "../../compiled/zod";
3
- declare const rule: z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>;
4
- export type Rule = z.infer<typeof rule>;
5
- declare const rules: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">]>;
6
- export type Rules = z.infer<typeof rules>;
7
- declare const bannerFunction: z.ZodFunction<z.ZodTuple<[z.ZodObject<{
8
- hash: z.ZodString;
9
- chunk: z.ZodType<JsChunk, z.ZodTypeDef, JsChunk>;
10
- filename: z.ZodString;
11
- }, "strip", z.ZodTypeAny, {
12
- filename: string;
13
- hash: string;
14
- chunk: JsChunk;
15
- }, {
16
- filename: string;
17
- hash: string;
18
- chunk: JsChunk;
19
- }>], z.ZodUnknown>, z.ZodString>;
20
- export type BannerFunction = z.infer<typeof bannerFunction>;
21
- declare const bannerContent: z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodObject<{
22
- hash: z.ZodString;
23
- chunk: z.ZodType<JsChunk, z.ZodTypeDef, JsChunk>;
24
- filename: z.ZodString;
25
- }, "strip", z.ZodTypeAny, {
26
- filename: string;
27
- hash: string;
28
- chunk: JsChunk;
29
- }, {
30
- filename: string;
31
- hash: string;
32
- chunk: JsChunk;
33
- }>], z.ZodUnknown>, z.ZodString>]>;
34
- export type BannerContent = z.infer<typeof bannerContent>;
35
- declare const bannerPluginOptions: z.ZodObject<{
36
- banner: z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodObject<{
37
- hash: z.ZodString;
38
- chunk: z.ZodType<JsChunk, z.ZodTypeDef, JsChunk>;
39
- filename: z.ZodString;
40
- }, "strip", z.ZodTypeAny, {
41
- filename: string;
42
- hash: string;
43
- chunk: JsChunk;
44
- }, {
45
- filename: string;
46
- hash: string;
47
- chunk: JsChunk;
48
- }>], z.ZodUnknown>, z.ZodString>]>;
49
- entryOnly: z.ZodOptional<z.ZodBoolean>;
50
- exclude: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">]>>;
51
- include: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">]>>;
52
- raw: z.ZodOptional<z.ZodBoolean>;
53
- footer: z.ZodOptional<z.ZodBoolean>;
54
- stage: z.ZodOptional<z.ZodNumber>;
55
- test: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">]>>;
56
- }, "strict", z.ZodTypeAny, {
57
- banner: string | ((args_0: {
58
- filename: string;
59
- hash: string;
60
- chunk: JsChunk;
61
- }, ...args_1: unknown[]) => string);
62
- entryOnly?: boolean | undefined;
63
- exclude?: string | RegExp | (string | RegExp)[] | undefined;
64
- include?: string | RegExp | (string | RegExp)[] | undefined;
65
- raw?: boolean | undefined;
66
- footer?: boolean | undefined;
67
- stage?: number | undefined;
68
- test?: string | RegExp | (string | RegExp)[] | undefined;
69
- }, {
70
- banner: string | ((args_0: {
71
- filename: string;
72
- hash: string;
73
- chunk: JsChunk;
74
- }, ...args_1: unknown[]) => string);
75
- entryOnly?: boolean | undefined;
76
- exclude?: string | RegExp | (string | RegExp)[] | undefined;
77
- include?: string | RegExp | (string | RegExp)[] | undefined;
78
- raw?: boolean | undefined;
79
- footer?: boolean | undefined;
80
- stage?: number | undefined;
81
- test?: string | RegExp | (string | RegExp)[] | undefined;
82
- }>;
83
- export type BannerPluginOptions = z.infer<typeof bannerPluginOptions>;
84
- declare const bannerPluginArgument: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodObject<{
85
- hash: z.ZodString;
86
- chunk: z.ZodType<JsChunk, z.ZodTypeDef, JsChunk>;
87
- filename: z.ZodString;
88
- }, "strip", z.ZodTypeAny, {
89
- filename: string;
2
+ export type Rule = string | RegExp;
3
+ export type Rules = Rule[] | Rule;
4
+ export type BannerFunction = (args: {
90
5
  hash: string;
91
6
  chunk: JsChunk;
92
- }, {
93
7
  filename: string;
94
- hash: string;
95
- chunk: JsChunk;
96
- }>], z.ZodUnknown>, z.ZodString>]>, z.ZodObject<{
97
- banner: z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodObject<{
98
- hash: z.ZodString;
99
- chunk: z.ZodType<JsChunk, z.ZodTypeDef, JsChunk>;
100
- filename: z.ZodString;
101
- }, "strip", z.ZodTypeAny, {
102
- filename: string;
103
- hash: string;
104
- chunk: JsChunk;
105
- }, {
106
- filename: string;
107
- hash: string;
108
- chunk: JsChunk;
109
- }>], z.ZodUnknown>, z.ZodString>]>;
110
- entryOnly: z.ZodOptional<z.ZodBoolean>;
111
- exclude: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">]>>;
112
- include: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">]>>;
113
- raw: z.ZodOptional<z.ZodBoolean>;
114
- footer: z.ZodOptional<z.ZodBoolean>;
115
- stage: z.ZodOptional<z.ZodNumber>;
116
- test: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">]>>;
117
- }, "strict", z.ZodTypeAny, {
118
- banner: string | ((args_0: {
119
- filename: string;
120
- hash: string;
121
- chunk: JsChunk;
122
- }, ...args_1: unknown[]) => string);
123
- entryOnly?: boolean | undefined;
124
- exclude?: string | RegExp | (string | RegExp)[] | undefined;
125
- include?: string | RegExp | (string | RegExp)[] | undefined;
126
- raw?: boolean | undefined;
127
- footer?: boolean | undefined;
128
- stage?: number | undefined;
129
- test?: string | RegExp | (string | RegExp)[] | undefined;
130
- }, {
131
- banner: string | ((args_0: {
132
- filename: string;
133
- hash: string;
134
- chunk: JsChunk;
135
- }, ...args_1: unknown[]) => string);
136
- entryOnly?: boolean | undefined;
137
- exclude?: string | RegExp | (string | RegExp)[] | undefined;
138
- include?: string | RegExp | (string | RegExp)[] | undefined;
139
- raw?: boolean | undefined;
140
- footer?: boolean | undefined;
141
- stage?: number | undefined;
142
- test?: string | RegExp | (string | RegExp)[] | undefined;
143
- }>]>;
144
- export type BannerPluginArgument = z.infer<typeof bannerPluginArgument>;
8
+ }) => string;
9
+ export type BannerContent = string | BannerFunction;
10
+ export type BannerPluginOptions = {
11
+ /** Specifies the banner, it will be wrapped in a comment. */
12
+ banner: BannerContent;
13
+ /** If true, the banner will only be added to the entry chunks. */
14
+ entryOnly?: boolean;
15
+ /** Exclude all modules matching any of these conditions. */
16
+ exclude?: Rules;
17
+ /** Include all modules matching any of these conditions. */
18
+ include?: Rules;
19
+ /** If true, banner will not be wrapped in a comment. */
20
+ raw?: boolean;
21
+ /** If true, banner will be placed at the end of the output. */
22
+ footer?: boolean;
23
+ /**
24
+ * The stage of the compilation in which the banner should be injected.
25
+ * @default PROCESS_ASSETS_STAGE_ADDITIONS (-100)
26
+ */
27
+ stage?: number;
28
+ /** Include all modules that pass test assertion. */
29
+ test?: Rules;
30
+ };
31
+ export type BannerPluginArgument = BannerContent | BannerPluginOptions;
145
32
  export declare const BannerPlugin: {
146
- new (args: string | ((args_0: {
147
- filename: string;
148
- hash: string;
149
- chunk: JsChunk;
150
- }, ...args_1: unknown[]) => string) | {
151
- banner: string | ((args_0: {
152
- filename: string;
153
- hash: string;
154
- chunk: JsChunk;
155
- }, ...args_1: unknown[]) => string);
156
- entryOnly?: boolean | undefined;
157
- exclude?: string | RegExp | (string | RegExp)[] | undefined;
158
- include?: string | RegExp | (string | RegExp)[] | undefined;
159
- raw?: boolean | undefined;
160
- footer?: boolean | undefined;
161
- stage?: number | undefined;
162
- test?: string | RegExp | (string | RegExp)[] | undefined;
163
- }): {
33
+ new (args: BannerPluginArgument): {
164
34
  name: BuiltinPluginName;
165
- _args: [args: string | ((args_0: {
166
- filename: string;
167
- hash: string;
168
- chunk: JsChunk;
169
- }, ...args_1: unknown[]) => string) | {
170
- banner: string | ((args_0: {
171
- filename: string;
172
- hash: string;
173
- chunk: JsChunk;
174
- }, ...args_1: unknown[]) => string);
175
- entryOnly?: boolean | undefined;
176
- exclude?: string | RegExp | (string | RegExp)[] | undefined;
177
- include?: string | RegExp | (string | RegExp)[] | undefined;
178
- raw?: boolean | undefined;
179
- footer?: boolean | undefined;
180
- stage?: number | undefined;
181
- test?: string | RegExp | (string | RegExp)[] | undefined;
182
- }];
35
+ _args: [args: BannerPluginArgument];
183
36
  affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
184
37
  raw(compiler: import("../Compiler").Compiler): import("@rspack/binding").BuiltinPlugin;
185
38
  apply(compiler: import("../Compiler").Compiler): void;
186
39
  };
187
40
  };
188
- export {};
@@ -2,30 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BannerPlugin = void 0;
4
4
  const binding_1 = require("@rspack/binding");
5
- const zod_1 = require("../../compiled/zod");
6
5
  const base_1 = require("./base");
7
- const rule = zod_1.z.string().or(zod_1.z.instanceof(RegExp));
8
- const rules = rule.or(rule.array());
9
- const bannerFunction = zod_1.z
10
- .function()
11
- .args(zod_1.z.object({
12
- hash: zod_1.z.string(),
13
- chunk: zod_1.z.custom(),
14
- filename: zod_1.z.string()
15
- }))
16
- .returns(zod_1.z.string());
17
- const bannerContent = zod_1.z.string().or(bannerFunction);
18
- const bannerPluginOptions = zod_1.z.strictObject({
19
- banner: bannerContent,
20
- entryOnly: zod_1.z.boolean().optional(),
21
- exclude: rules.optional(),
22
- include: rules.optional(),
23
- raw: zod_1.z.boolean().optional(),
24
- footer: zod_1.z.boolean().optional(),
25
- stage: zod_1.z.number().optional(),
26
- test: rules.optional()
27
- });
28
- const bannerPluginArgument = bannerContent.or(bannerPluginOptions);
29
6
  exports.BannerPlugin = (0, base_1.create)(binding_1.BuiltinPluginName.BannerPlugin, (args) => {
30
7
  if (typeof args === "string" || typeof args === "function") {
31
8
  return {
@@ -1,76 +1,70 @@
1
1
  import { BuiltinPluginName, type JsAfterEmitData, type JsAfterTemplateExecutionData, type JsAlterAssetTagGroupsData, type JsAlterAssetTagsData, type JsBeforeAssetTagGenerationData, type JsBeforeEmitData, type JsHtmlPluginTag } from "@rspack/binding";
2
2
  import * as liteTapable from "@rspack/lite-tapable";
3
- import { z } from "../../compiled/zod";
4
3
  import { Compilation } from "../Compilation";
5
4
  import type { Compiler } from "../Compiler";
6
- declare const htmlRspackPluginOptions: z.ZodObject<{
7
- filename: z.ZodOptional<z.ZodString>;
8
- template: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
9
- templateContent: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodRecord<z.ZodString, z.ZodAny>], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodPromise<z.ZodString>]>>]>>;
10
- templateParameters: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodString>, z.ZodBoolean]>, z.ZodFunction<z.ZodTuple<[z.ZodRecord<z.ZodString, z.ZodAny>], z.ZodUnknown>, z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodPromise<z.ZodRecord<z.ZodString, z.ZodAny>>]>>]>>;
11
- inject: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["head", "body"]>, z.ZodBoolean]>>;
12
- publicPath: z.ZodOptional<z.ZodString>;
13
- base: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
14
- href: z.ZodOptional<z.ZodString>;
15
- target: z.ZodOptional<z.ZodEnum<["_self", "_blank", "_parent", "_top"]>>;
16
- }, "strict", z.ZodTypeAny, {
17
- target?: "_self" | "_blank" | "_parent" | "_top" | undefined;
18
- href?: string | undefined;
19
- }, {
20
- target?: "_self" | "_blank" | "_parent" | "_top" | undefined;
21
- href?: string | undefined;
22
- }>]>>;
23
- scriptLoading: z.ZodOptional<z.ZodEnum<["blocking", "defer", "module", "systemjs-module"]>>;
24
- chunks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
25
- excludeChunks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
26
- sri: z.ZodOptional<z.ZodEnum<["sha256", "sha384", "sha512"]>>;
27
- minify: z.ZodOptional<z.ZodBoolean>;
28
- title: z.ZodOptional<z.ZodString>;
29
- favicon: z.ZodOptional<z.ZodString>;
30
- meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>>;
31
- hash: z.ZodOptional<z.ZodBoolean>;
32
- }, "strict", z.ZodTypeAny, {
33
- filename?: string | undefined;
34
- publicPath?: string | undefined;
35
- hash?: boolean | undefined;
36
- chunks?: string[] | undefined;
5
+ export type TemplateRenderFunction = (params: Record<string, any>) => string | Promise<string>;
6
+ export type TemplateParamFunction = (params: Record<string, any>) => Record<string, any> | Promise<Record<string, any>>;
7
+ export type HtmlRspackPluginOptions = {
8
+ /** The title to use for the generated HTML document. */
9
+ title?: string;
10
+ /**
11
+ * The file to write the HTML to. You can specify a subdirectory here too (eg: pages/index.html).
12
+ * @default 'index.html'
13
+ */
14
+ filename?: string;
15
+ /** The template file path. */
16
+ template?: string;
17
+ /**
18
+ * The template file content, priority is greater than template.
19
+ * When using a function, pass in the template parameters and use the returned string as the template content.
20
+ */
21
+ templateContent?: string | TemplateRenderFunction;
22
+ /**
23
+ * Allows to overwrite the parameters used in the template.
24
+ * When using a function, pass in the original template parameters and use the returned object as the final template parameters.
25
+ */
26
+ templateParameters?: Record<string, string> | boolean | TemplateParamFunction;
27
+ /**
28
+ * The script and link tag inject position in template. Use false to not inject.
29
+ * If not specified, it will be automatically determined based on scriptLoading.
30
+ */
31
+ inject?: boolean | "head" | "body";
32
+ /** The publicPath used for script and link tags. */
33
+ publicPath?: string;
34
+ /** Inject a [base](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base) tag */
37
35
  base?: string | {
38
- target?: "_self" | "_blank" | "_parent" | "_top" | undefined;
39
- href?: string | undefined;
40
- } | undefined;
41
- template?: string | undefined;
42
- templateContent?: string | ((args_0: Record<string, any>, ...args_1: unknown[]) => string | Promise<string>) | undefined;
43
- templateParameters?: boolean | Record<string, string> | ((args_0: Record<string, any>, ...args_1: unknown[]) => Record<string, any> | Promise<Record<string, any>>) | undefined;
44
- inject?: boolean | "head" | "body" | undefined;
45
- scriptLoading?: "module" | "blocking" | "defer" | "systemjs-module" | undefined;
46
- excludeChunks?: string[] | undefined;
47
- sri?: "sha256" | "sha384" | "sha512" | undefined;
48
- minify?: boolean | undefined;
49
- title?: string | undefined;
50
- favicon?: string | undefined;
51
- meta?: Record<string, string | Record<string, string>> | undefined;
52
- }, {
53
- filename?: string | undefined;
54
- publicPath?: string | undefined;
55
- hash?: boolean | undefined;
56
- chunks?: string[] | undefined;
57
- base?: string | {
58
- target?: "_self" | "_blank" | "_parent" | "_top" | undefined;
59
- href?: string | undefined;
60
- } | undefined;
61
- template?: string | undefined;
62
- templateContent?: string | ((args_0: Record<string, any>, ...args_1: unknown[]) => string | Promise<string>) | undefined;
63
- templateParameters?: boolean | Record<string, string> | ((args_0: Record<string, any>, ...args_1: unknown[]) => Record<string, any> | Promise<Record<string, any>>) | undefined;
64
- inject?: boolean | "head" | "body" | undefined;
65
- scriptLoading?: "module" | "blocking" | "defer" | "systemjs-module" | undefined;
66
- excludeChunks?: string[] | undefined;
67
- sri?: "sha256" | "sha384" | "sha512" | undefined;
68
- minify?: boolean | undefined;
69
- title?: string | undefined;
70
- favicon?: string | undefined;
71
- meta?: Record<string, string | Record<string, string>> | undefined;
72
- }>;
73
- export type HtmlRspackPluginOptions = z.infer<typeof htmlRspackPluginOptions>;
36
+ href?: string;
37
+ target?: "_self" | "_blank" | "_parent" | "_top";
38
+ };
39
+ /**
40
+ * Modern browsers support non blocking javascript loading ('defer') to improve the page startup performance.
41
+ * Setting to 'module' adds attribute type='module'.
42
+ * This also implies 'defer', since modules are automatically deferred.
43
+ * @default 'defer'
44
+ * */
45
+ scriptLoading?: "blocking" | "defer" | "module" | "systemjs-module";
46
+ /** Allows you to add only some chunks. */
47
+ chunks?: string[];
48
+ /** Allows you to skip some chunks. */
49
+ excludeChunks?: string[];
50
+ /** The sri hash algorithm, disabled by default. */
51
+ sri?: "sha256" | "sha384" | "sha512";
52
+ /**
53
+ * Controls whether to minify the output.
54
+ * @default false
55
+ */
56
+ minify?: boolean;
57
+ /** Adds the given favicon path to the output HTML. */
58
+ favicon?: string;
59
+ /**
60
+ * If true then append a unique rspack compilation hash to all included scripts and CSS files.
61
+ * This is useful for cache busting
62
+ * @default false
63
+ * */
64
+ meta?: Record<string, string | Record<string, string>>;
65
+ /** Inject a base tag */
66
+ hash?: boolean;
67
+ };
74
68
  type ExtraPluginHookData = {
75
69
  plugin: {
76
70
  options: HtmlRspackPluginOptions;
@@ -95,49 +89,9 @@ export type HtmlRspackPluginHooks = {
95
89
  ]>;
96
90
  };
97
91
  declare const HtmlRspackPlugin: {
98
- new (c?: {
99
- filename?: string | undefined;
100
- publicPath?: string | undefined;
101
- hash?: boolean | undefined;
102
- chunks?: string[] | undefined;
103
- base?: string | {
104
- target?: "_self" | "_blank" | "_parent" | "_top" | undefined;
105
- href?: string | undefined;
106
- } | undefined;
107
- template?: string | undefined;
108
- templateContent?: string | ((args_0: Record<string, any>, ...args_1: unknown[]) => string | Promise<string>) | undefined;
109
- templateParameters?: boolean | Record<string, string> | ((args_0: Record<string, any>, ...args_1: unknown[]) => Record<string, any> | Promise<Record<string, any>>) | undefined;
110
- inject?: boolean | "head" | "body" | undefined;
111
- scriptLoading?: "module" | "blocking" | "defer" | "systemjs-module" | undefined;
112
- excludeChunks?: string[] | undefined;
113
- sri?: "sha256" | "sha384" | "sha512" | undefined;
114
- minify?: boolean | undefined;
115
- title?: string | undefined;
116
- favicon?: string | undefined;
117
- meta?: Record<string, string | Record<string, string>> | undefined;
118
- } | undefined): {
92
+ new (c?: HtmlRspackPluginOptions | undefined): {
119
93
  name: BuiltinPluginName;
120
- _args: [c?: {
121
- filename?: string | undefined;
122
- publicPath?: string | undefined;
123
- hash?: boolean | undefined;
124
- chunks?: string[] | undefined;
125
- base?: string | {
126
- target?: "_self" | "_blank" | "_parent" | "_top" | undefined;
127
- href?: string | undefined;
128
- } | undefined;
129
- template?: string | undefined;
130
- templateContent?: string | ((args_0: Record<string, any>, ...args_1: unknown[]) => string | Promise<string>) | undefined;
131
- templateParameters?: boolean | Record<string, string> | ((args_0: Record<string, any>, ...args_1: unknown[]) => Record<string, any> | Promise<Record<string, any>>) | undefined;
132
- inject?: boolean | "head" | "body" | undefined;
133
- scriptLoading?: "module" | "blocking" | "defer" | "systemjs-module" | undefined;
134
- excludeChunks?: string[] | undefined;
135
- sri?: "sha256" | "sha384" | "sha512" | undefined;
136
- minify?: boolean | undefined;
137
- title?: string | undefined;
138
- favicon?: string | undefined;
139
- meta?: Record<string, string | Record<string, string>> | undefined;
140
- } | undefined];
94
+ _args: [c?: HtmlRspackPluginOptions | undefined];
141
95
  affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
142
96
  raw(compiler: Compiler): import("@rspack/binding").BuiltinPlugin;
143
97
  apply(compiler: Compiler): void;
@@ -1,8 +1,11 @@
1
1
  import { BuiltinPluginName, type RawIgnorePluginOptions } from "@rspack/binding";
2
2
  export type IgnorePluginOptions = {
3
+ /** A RegExp to test the resource against. */
3
4
  resourceRegExp: NonNullable<RawIgnorePluginOptions["resourceRegExp"]>;
5
+ /** A RegExp to test the context (directory) against. */
4
6
  contextRegExp?: RawIgnorePluginOptions["contextRegExp"];
5
7
  } | {
8
+ /** A Filter function that receives `resource` and `context` as arguments, must return boolean. */
6
9
  checkResource: NonNullable<RawIgnorePluginOptions["checkResource"]>;
7
10
  };
8
11
  export declare const IgnorePlugin: {
@@ -2097,13 +2097,13 @@ declare const baseRuleSetRule: z.ZodObject<{
2097
2097
  }, "strict", z.ZodTypeAny, {
2098
2098
  options?: string | Record<string, any> | undefined;
2099
2099
  type?: string | undefined;
2100
- exclude?: RuleSetCondition | undefined;
2101
- include?: RuleSetCondition | undefined;
2102
- test?: RuleSetCondition | undefined;
2103
2100
  layer?: string | undefined;
2101
+ test?: RuleSetCondition | undefined;
2104
2102
  enforce?: "pre" | "post" | undefined;
2105
2103
  sideEffects?: boolean | undefined;
2106
2104
  loader?: string | undefined;
2105
+ exclude?: RuleSetCondition | undefined;
2106
+ include?: RuleSetCondition | undefined;
2107
2107
  issuer?: RuleSetCondition | undefined;
2108
2108
  issuerLayer?: RuleSetCondition | undefined;
2109
2109
  dependency?: RuleSetCondition | undefined;
@@ -2133,13 +2133,13 @@ declare const baseRuleSetRule: z.ZodObject<{
2133
2133
  }, {
2134
2134
  options?: string | Record<string, any> | undefined;
2135
2135
  type?: string | undefined;
2136
- exclude?: RuleSetCondition | undefined;
2137
- include?: RuleSetCondition | undefined;
2138
- test?: RuleSetCondition | undefined;
2139
2136
  layer?: string | undefined;
2137
+ test?: RuleSetCondition | undefined;
2140
2138
  enforce?: "pre" | "post" | undefined;
2141
2139
  sideEffects?: boolean | undefined;
2142
2140
  loader?: string | undefined;
2141
+ exclude?: RuleSetCondition | undefined;
2142
+ include?: RuleSetCondition | undefined;
2143
2143
  issuer?: RuleSetCondition | undefined;
2144
2144
  issuerLayer?: RuleSetCondition | undefined;
2145
2145
  dependency?: RuleSetCondition | undefined;
@@ -4935,7 +4935,6 @@ declare const statsOptions: z.ZodObject<{
4935
4935
  }, "strict", z.ZodTypeAny, {
4936
4936
  source?: boolean | undefined;
4937
4937
  publicPath?: boolean | undefined;
4938
- hash?: boolean | undefined;
4939
4938
  all?: boolean | undefined;
4940
4939
  chunks?: boolean | undefined;
4941
4940
  usedExports?: boolean | undefined;
@@ -4950,6 +4949,7 @@ declare const statsOptions: z.ZodObject<{
4950
4949
  errors?: boolean | undefined;
4951
4950
  errorsCount?: boolean | undefined;
4952
4951
  colors?: boolean | undefined;
4952
+ hash?: boolean | undefined;
4953
4953
  version?: boolean | undefined;
4954
4954
  reasons?: boolean | undefined;
4955
4955
  outputPath?: boolean | undefined;
@@ -5012,7 +5012,6 @@ declare const statsOptions: z.ZodObject<{
5012
5012
  }, {
5013
5013
  source?: boolean | undefined;
5014
5014
  publicPath?: boolean | undefined;
5015
- hash?: boolean | undefined;
5016
5015
  all?: boolean | undefined;
5017
5016
  chunks?: boolean | undefined;
5018
5017
  usedExports?: boolean | undefined;
@@ -5027,6 +5026,7 @@ declare const statsOptions: z.ZodObject<{
5027
5026
  errors?: boolean | undefined;
5028
5027
  errorsCount?: boolean | undefined;
5029
5028
  colors?: boolean | undefined;
5029
+ hash?: boolean | undefined;
5030
5030
  version?: boolean | undefined;
5031
5031
  reasons?: boolean | undefined;
5032
5032
  outputPath?: boolean | undefined;
@@ -5168,7 +5168,6 @@ declare const statsValue: z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodEnum<["norm
5168
5168
  }, "strict", z.ZodTypeAny, {
5169
5169
  source?: boolean | undefined;
5170
5170
  publicPath?: boolean | undefined;
5171
- hash?: boolean | undefined;
5172
5171
  all?: boolean | undefined;
5173
5172
  chunks?: boolean | undefined;
5174
5173
  usedExports?: boolean | undefined;
@@ -5183,6 +5182,7 @@ declare const statsValue: z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodEnum<["norm
5183
5182
  errors?: boolean | undefined;
5184
5183
  errorsCount?: boolean | undefined;
5185
5184
  colors?: boolean | undefined;
5185
+ hash?: boolean | undefined;
5186
5186
  version?: boolean | undefined;
5187
5187
  reasons?: boolean | undefined;
5188
5188
  outputPath?: boolean | undefined;
@@ -5245,7 +5245,6 @@ declare const statsValue: z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodEnum<["norm
5245
5245
  }, {
5246
5246
  source?: boolean | undefined;
5247
5247
  publicPath?: boolean | undefined;
5248
- hash?: boolean | undefined;
5249
5248
  all?: boolean | undefined;
5250
5249
  chunks?: boolean | undefined;
5251
5250
  usedExports?: boolean | undefined;
@@ -5260,6 +5259,7 @@ declare const statsValue: z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodEnum<["norm
5260
5259
  errors?: boolean | undefined;
5261
5260
  errorsCount?: boolean | undefined;
5262
5261
  colors?: boolean | undefined;
5262
+ hash?: boolean | undefined;
5263
5263
  version?: boolean | undefined;
5264
5264
  reasons?: boolean | undefined;
5265
5265
  outputPath?: boolean | undefined;
@@ -5377,9 +5377,9 @@ declare const optimizationSplitChunksCacheGroup: z.ZodObject<{
5377
5377
  }, "strict", z.ZodTypeAny, {
5378
5378
  filename?: string | undefined;
5379
5379
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
5380
+ priority?: number | undefined;
5380
5381
  type?: string | RegExp | undefined;
5381
5382
  test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined;
5382
- priority?: number | undefined;
5383
5383
  enforce?: boolean | undefined;
5384
5384
  reuseExistingChunk?: boolean | undefined;
5385
5385
  idHint?: string | undefined;
@@ -5397,9 +5397,9 @@ declare const optimizationSplitChunksCacheGroup: z.ZodObject<{
5397
5397
  }, {
5398
5398
  filename?: string | undefined;
5399
5399
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
5400
+ priority?: number | undefined;
5400
5401
  type?: string | RegExp | undefined;
5401
5402
  test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined;
5402
- priority?: number | undefined;
5403
5403
  enforce?: boolean | undefined;
5404
5404
  reuseExistingChunk?: boolean | undefined;
5405
5405
  idHint?: string | undefined;
@@ -5452,9 +5452,9 @@ declare const optimizationSplitChunksOptions: z.ZodObject<{
5452
5452
  }, "strict", z.ZodTypeAny, {
5453
5453
  filename?: string | undefined;
5454
5454
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
5455
+ priority?: number | undefined;
5455
5456
  type?: string | RegExp | undefined;
5456
5457
  test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined;
5457
- priority?: number | undefined;
5458
5458
  enforce?: boolean | undefined;
5459
5459
  reuseExistingChunk?: boolean | undefined;
5460
5460
  idHint?: string | undefined;
@@ -5472,9 +5472,9 @@ declare const optimizationSplitChunksOptions: z.ZodObject<{
5472
5472
  }, {
5473
5473
  filename?: string | undefined;
5474
5474
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
5475
+ priority?: number | undefined;
5475
5476
  type?: string | RegExp | undefined;
5476
5477
  test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined;
5477
- priority?: number | undefined;
5478
5478
  enforce?: boolean | undefined;
5479
5479
  reuseExistingChunk?: boolean | undefined;
5480
5480
  idHint?: string | undefined;
@@ -5529,9 +5529,9 @@ declare const optimizationSplitChunksOptions: z.ZodObject<{
5529
5529
  cacheGroups?: Record<string, false | {
5530
5530
  filename?: string | undefined;
5531
5531
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
5532
+ priority?: number | undefined;
5532
5533
  type?: string | RegExp | undefined;
5533
5534
  test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined;
5534
- priority?: number | undefined;
5535
5535
  enforce?: boolean | undefined;
5536
5536
  reuseExistingChunk?: boolean | undefined;
5537
5537
  idHint?: string | undefined;
@@ -5572,9 +5572,9 @@ declare const optimizationSplitChunksOptions: z.ZodObject<{
5572
5572
  cacheGroups?: Record<string, false | {
5573
5573
  filename?: string | undefined;
5574
5574
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
5575
+ priority?: number | undefined;
5575
5576
  type?: string | RegExp | undefined;
5576
5577
  test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined;
5577
- priority?: number | undefined;
5578
5578
  enforce?: boolean | undefined;
5579
5579
  reuseExistingChunk?: boolean | undefined;
5580
5580
  idHint?: string | undefined;
@@ -5643,9 +5643,9 @@ declare const optimization: z.ZodObject<{
5643
5643
  }, "strict", z.ZodTypeAny, {
5644
5644
  filename?: string | undefined;
5645
5645
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
5646
+ priority?: number | undefined;
5646
5647
  type?: string | RegExp | undefined;
5647
5648
  test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined;
5648
- priority?: number | undefined;
5649
5649
  enforce?: boolean | undefined;
5650
5650
  reuseExistingChunk?: boolean | undefined;
5651
5651
  idHint?: string | undefined;
@@ -5663,9 +5663,9 @@ declare const optimization: z.ZodObject<{
5663
5663
  }, {
5664
5664
  filename?: string | undefined;
5665
5665
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
5666
+ priority?: number | undefined;
5666
5667
  type?: string | RegExp | undefined;
5667
5668
  test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined;
5668
- priority?: number | undefined;
5669
5669
  enforce?: boolean | undefined;
5670
5670
  reuseExistingChunk?: boolean | undefined;
5671
5671
  idHint?: string | undefined;
@@ -5720,9 +5720,9 @@ declare const optimization: z.ZodObject<{
5720
5720
  cacheGroups?: Record<string, false | {
5721
5721
  filename?: string | undefined;
5722
5722
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
5723
+ priority?: number | undefined;
5723
5724
  type?: string | RegExp | undefined;
5724
5725
  test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined;
5725
- priority?: number | undefined;
5726
5726
  enforce?: boolean | undefined;
5727
5727
  reuseExistingChunk?: boolean | undefined;
5728
5728
  idHint?: string | undefined;
@@ -5763,9 +5763,9 @@ declare const optimization: z.ZodObject<{
5763
5763
  cacheGroups?: Record<string, false | {
5764
5764
  filename?: string | undefined;
5765
5765
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
5766
+ priority?: number | undefined;
5766
5767
  type?: string | RegExp | undefined;
5767
5768
  test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined;
5768
- priority?: number | undefined;
5769
5769
  enforce?: boolean | undefined;
5770
5770
  reuseExistingChunk?: boolean | undefined;
5771
5771
  idHint?: string | undefined;
@@ -5842,9 +5842,9 @@ declare const optimization: z.ZodObject<{
5842
5842
  cacheGroups?: Record<string, false | {
5843
5843
  filename?: string | undefined;
5844
5844
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
5845
+ priority?: number | undefined;
5845
5846
  type?: string | RegExp | undefined;
5846
5847
  test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined;
5847
- priority?: number | undefined;
5848
5848
  enforce?: boolean | undefined;
5849
5849
  reuseExistingChunk?: boolean | undefined;
5850
5850
  idHint?: string | undefined;
@@ -5908,9 +5908,9 @@ declare const optimization: z.ZodObject<{
5908
5908
  cacheGroups?: Record<string, false | {
5909
5909
  filename?: string | undefined;
5910
5910
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
5911
+ priority?: number | undefined;
5911
5912
  type?: string | RegExp | undefined;
5912
5913
  test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined;
5913
- priority?: number | undefined;
5914
5914
  enforce?: boolean | undefined;
5915
5915
  reuseExistingChunk?: boolean | undefined;
5916
5916
  idHint?: string | undefined;
@@ -7707,7 +7707,6 @@ export declare const rspackOptions: z.ZodObject<{
7707
7707
  }, "strict", z.ZodTypeAny, {
7708
7708
  source?: boolean | undefined;
7709
7709
  publicPath?: boolean | undefined;
7710
- hash?: boolean | undefined;
7711
7710
  all?: boolean | undefined;
7712
7711
  chunks?: boolean | undefined;
7713
7712
  usedExports?: boolean | undefined;
@@ -7722,6 +7721,7 @@ export declare const rspackOptions: z.ZodObject<{
7722
7721
  errors?: boolean | undefined;
7723
7722
  errorsCount?: boolean | undefined;
7724
7723
  colors?: boolean | undefined;
7724
+ hash?: boolean | undefined;
7725
7725
  version?: boolean | undefined;
7726
7726
  reasons?: boolean | undefined;
7727
7727
  outputPath?: boolean | undefined;
@@ -7784,7 +7784,6 @@ export declare const rspackOptions: z.ZodObject<{
7784
7784
  }, {
7785
7785
  source?: boolean | undefined;
7786
7786
  publicPath?: boolean | undefined;
7787
- hash?: boolean | undefined;
7788
7787
  all?: boolean | undefined;
7789
7788
  chunks?: boolean | undefined;
7790
7789
  usedExports?: boolean | undefined;
@@ -7799,6 +7798,7 @@ export declare const rspackOptions: z.ZodObject<{
7799
7798
  errors?: boolean | undefined;
7800
7799
  errorsCount?: boolean | undefined;
7801
7800
  colors?: boolean | undefined;
7801
+ hash?: boolean | undefined;
7802
7802
  version?: boolean | undefined;
7803
7803
  reasons?: boolean | undefined;
7804
7804
  outputPath?: boolean | undefined;
@@ -7902,9 +7902,9 @@ export declare const rspackOptions: z.ZodObject<{
7902
7902
  }, "strict", z.ZodTypeAny, {
7903
7903
  filename?: string | undefined;
7904
7904
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
7905
+ priority?: number | undefined;
7905
7906
  type?: string | RegExp | undefined;
7906
7907
  test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined;
7907
- priority?: number | undefined;
7908
7908
  enforce?: boolean | undefined;
7909
7909
  reuseExistingChunk?: boolean | undefined;
7910
7910
  idHint?: string | undefined;
@@ -7922,9 +7922,9 @@ export declare const rspackOptions: z.ZodObject<{
7922
7922
  }, {
7923
7923
  filename?: string | undefined;
7924
7924
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
7925
+ priority?: number | undefined;
7925
7926
  type?: string | RegExp | undefined;
7926
7927
  test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined;
7927
- priority?: number | undefined;
7928
7928
  enforce?: boolean | undefined;
7929
7929
  reuseExistingChunk?: boolean | undefined;
7930
7930
  idHint?: string | undefined;
@@ -7979,9 +7979,9 @@ export declare const rspackOptions: z.ZodObject<{
7979
7979
  cacheGroups?: Record<string, false | {
7980
7980
  filename?: string | undefined;
7981
7981
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
7982
+ priority?: number | undefined;
7982
7983
  type?: string | RegExp | undefined;
7983
7984
  test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined;
7984
- priority?: number | undefined;
7985
7985
  enforce?: boolean | undefined;
7986
7986
  reuseExistingChunk?: boolean | undefined;
7987
7987
  idHint?: string | undefined;
@@ -8022,9 +8022,9 @@ export declare const rspackOptions: z.ZodObject<{
8022
8022
  cacheGroups?: Record<string, false | {
8023
8023
  filename?: string | undefined;
8024
8024
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
8025
+ priority?: number | undefined;
8025
8026
  type?: string | RegExp | undefined;
8026
8027
  test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined;
8027
- priority?: number | undefined;
8028
8028
  enforce?: boolean | undefined;
8029
8029
  reuseExistingChunk?: boolean | undefined;
8030
8030
  idHint?: string | undefined;
@@ -8101,9 +8101,9 @@ export declare const rspackOptions: z.ZodObject<{
8101
8101
  cacheGroups?: Record<string, false | {
8102
8102
  filename?: string | undefined;
8103
8103
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
8104
+ priority?: number | undefined;
8104
8105
  type?: string | RegExp | undefined;
8105
8106
  test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined;
8106
- priority?: number | undefined;
8107
8107
  enforce?: boolean | undefined;
8108
8108
  reuseExistingChunk?: boolean | undefined;
8109
8109
  idHint?: string | undefined;
@@ -8167,9 +8167,9 @@ export declare const rspackOptions: z.ZodObject<{
8167
8167
  cacheGroups?: Record<string, false | {
8168
8168
  filename?: string | undefined;
8169
8169
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
8170
+ priority?: number | undefined;
8170
8171
  type?: string | RegExp | undefined;
8171
8172
  test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined;
8172
- priority?: number | undefined;
8173
8173
  enforce?: boolean | undefined;
8174
8174
  reuseExistingChunk?: boolean | undefined;
8175
8175
  idHint?: string | undefined;
@@ -9538,7 +9538,6 @@ export declare const rspackOptions: z.ZodObject<{
9538
9538
  stats?: boolean | "verbose" | "normal" | "none" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | {
9539
9539
  source?: boolean | undefined;
9540
9540
  publicPath?: boolean | undefined;
9541
- hash?: boolean | undefined;
9542
9541
  all?: boolean | undefined;
9543
9542
  chunks?: boolean | undefined;
9544
9543
  usedExports?: boolean | undefined;
@@ -9553,6 +9552,7 @@ export declare const rspackOptions: z.ZodObject<{
9553
9552
  errors?: boolean | undefined;
9554
9553
  errorsCount?: boolean | undefined;
9555
9554
  colors?: boolean | undefined;
9555
+ hash?: boolean | undefined;
9556
9556
  version?: boolean | undefined;
9557
9557
  reasons?: boolean | undefined;
9558
9558
  outputPath?: boolean | undefined;
@@ -9637,9 +9637,9 @@ export declare const rspackOptions: z.ZodObject<{
9637
9637
  cacheGroups?: Record<string, false | {
9638
9638
  filename?: string | undefined;
9639
9639
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
9640
+ priority?: number | undefined;
9640
9641
  type?: string | RegExp | undefined;
9641
9642
  test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined;
9642
- priority?: number | undefined;
9643
9643
  enforce?: boolean | undefined;
9644
9644
  reuseExistingChunk?: boolean | undefined;
9645
9645
  idHint?: string | undefined;
@@ -10120,7 +10120,6 @@ export declare const rspackOptions: z.ZodObject<{
10120
10120
  stats?: boolean | "verbose" | "normal" | "none" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | {
10121
10121
  source?: boolean | undefined;
10122
10122
  publicPath?: boolean | undefined;
10123
- hash?: boolean | undefined;
10124
10123
  all?: boolean | undefined;
10125
10124
  chunks?: boolean | undefined;
10126
10125
  usedExports?: boolean | undefined;
@@ -10135,6 +10134,7 @@ export declare const rspackOptions: z.ZodObject<{
10135
10134
  errors?: boolean | undefined;
10136
10135
  errorsCount?: boolean | undefined;
10137
10136
  colors?: boolean | undefined;
10137
+ hash?: boolean | undefined;
10138
10138
  version?: boolean | undefined;
10139
10139
  reasons?: boolean | undefined;
10140
10140
  outputPath?: boolean | undefined;
@@ -10219,9 +10219,9 @@ export declare const rspackOptions: z.ZodObject<{
10219
10219
  cacheGroups?: Record<string, false | {
10220
10220
  filename?: string | undefined;
10221
10221
  name?: string | false | ((args_0: Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
10222
+ priority?: number | undefined;
10222
10223
  type?: string | RegExp | undefined;
10223
10224
  test?: string | RegExp | ((args_0: Module, ...args_1: unknown[]) => unknown) | undefined;
10224
- priority?: number | undefined;
10225
10225
  enforce?: boolean | undefined;
10226
10226
  reuseExistingChunk?: boolean | undefined;
10227
10227
  idHint?: string | undefined;
@@ -329,7 +329,8 @@ async function runLoaders(compiler, context) {
329
329
  missingDependencies.length = 0;
330
330
  context.cacheable = true;
331
331
  };
332
- loaderContext.importModule = function importModule(request, options, callback) {
332
+ loaderContext.importModule = function importModule(request, userOptions, callback) {
333
+ const options = userOptions ? userOptions : {};
333
334
  if (!callback) {
334
335
  return new Promise((resolve, reject) => {
335
336
  compiler
@@ -7,23 +7,5 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
- /// <reference types="node" />
11
- declare const _default: () => {
12
- exports: WebAssembly.Exports & {
13
- init: () => void;
14
- update: (b: number) => void;
15
- memory: WebAssembly.Memory;
16
- final: (b: number) => void;
17
- };
18
- instancesPool: WebAssembly.Instance[];
19
- buffered: number;
20
- mem: Buffer;
21
- chunkSize: number;
22
- digestSize: number;
23
- reset(): void;
24
- update(data: string | Buffer, encoding?: BufferEncoding | undefined): any;
25
- _updateWithShortString(data: string, encoding?: BufferEncoding | undefined): void;
26
- _updateWithBuffer(data: Buffer): void;
27
- digest(type: BufferEncoding): string | Buffer;
28
- };
10
+ declare const _default: () => import("./wasm-hash").WasmHash;
29
11
  export default _default;
@@ -13,9 +13,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  const wasm_hash_1 = __importDefault(require("./wasm-hash"));
16
- //#region wasm code: md4 (../../../assembly/hash/md4.asm.ts) --initialMemory 1
17
- const md4 = new WebAssembly.Module(Buffer.from(
18
- // 2156 bytes
19
- "AGFzbQEAAAABCAJgAX8AYAAAAwUEAQAAAAUDAQABBhoFfwFBAAt/AUEAC38BQQALfwFBAAt/AUEACwciBARpbml0AAAGdXBkYXRlAAIFZmluYWwAAwZtZW1vcnkCAAqLEAQmAEGBxpS6BiQBQYnXtv5+JAJB/rnrxXkkA0H2qMmBASQEQ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8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAEEQIwOtIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAEEYIwStIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAAs=", "base64"));
20
- //#endregion
21
- exports.default = wasm_hash_1.default.bind(null, md4, [], 64, 32);
16
+ let createMd4;
17
+ exports.default = () => {
18
+ if (!createMd4) {
19
+ //#region wasm code: md4 (../../../assembly/hash/md4.asm.ts) --initialMemory 1
20
+ const md4 = new WebAssembly.Module(Buffer.from(
21
+ // 2156 bytes
22
+ "AGFzbQEAAAABCAJgAX8AYAAAAwUEAQAAAAUDAQABBhoFfwFBAAt/AUEAC38BQQALfwFBAAt/AUEACwciBARpbml0AAAGdXBkYXRlAAIFZmluYWwAAwZtZW1vcnkCAAqLEAQmAEGBxpS6BiQBQYnXtv5+JAJB/rnrxXkkA0H2qMmBASQEQQAkAAvSCgEZfyMBIQUjAiECIwMhAyMEIQQDQCAAIAFLBEAgASgCJCISIAEoAiAiEyABKAIcIgkgASgCGCIIIAEoAhQiByABKAIQIg4gASgCDCIGIAEoAggiDyABKAIEIhAgASgCACIRIAMgBHMgAnEgBHMgBWpqQQN3IgogAiADc3EgA3MgBGpqQQd3IgsgAiA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P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAEEYIwStIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAAs=", "base64"));
23
+ //#endregion
24
+ createMd4 = wasm_hash_1.default.bind(null, md4, [], 64, 32);
25
+ }
26
+ return createMd4();
27
+ };
@@ -15,7 +15,7 @@ type Exports = WebAssembly.Instance["exports"] & {
15
15
  memory: WebAssembly.Memory;
16
16
  final: (b: number) => void;
17
17
  };
18
- declare class WasmHash {
18
+ export declare class WasmHash {
19
19
  exports: Exports;
20
20
  instancesPool: WebAssembly.Instance[];
21
21
  buffered: number;
@@ -9,7 +9,7 @@
9
9
  * https://github.com/webpack/webpack/blob/main/LICENSE
10
10
  */
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.MAX_SHORT_STRING = void 0;
12
+ exports.WasmHash = exports.MAX_SHORT_STRING = void 0;
13
13
  // 65536 is the size of a wasm memory page
14
14
  // 64 is the maximum chunk size for every possible wasm hash implementation
15
15
  // 4 is the maximum number of bytes per char for string encoding (max is utf-8)
@@ -155,6 +155,7 @@ class WasmHash {
155
155
  return Buffer.from(hex, "hex").toString(type);
156
156
  }
157
157
  }
158
+ exports.WasmHash = WasmHash;
158
159
  const create = (wasmModule, instancesPool, chunkSize, digestSize) => {
159
160
  if (instancesPool.length > 0) {
160
161
  const old = instancesPool.pop();
@@ -7,23 +7,5 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
- /// <reference types="node" />
11
- declare const _default: () => {
12
- exports: WebAssembly.Exports & {
13
- init: () => void;
14
- update: (b: number) => void;
15
- memory: WebAssembly.Memory;
16
- final: (b: number) => void;
17
- };
18
- instancesPool: WebAssembly.Instance[];
19
- buffered: number;
20
- mem: Buffer;
21
- chunkSize: number;
22
- digestSize: number;
23
- reset(): void;
24
- update(data: string | Buffer, encoding?: BufferEncoding | undefined): any;
25
- _updateWithShortString(data: string, encoding?: BufferEncoding | undefined): void;
26
- _updateWithBuffer(data: Buffer): void;
27
- digest(type: BufferEncoding): string | Buffer;
28
- };
10
+ declare const _default: () => import("./wasm-hash").WasmHash;
29
11
  export default _default;
@@ -13,9 +13,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  const wasm_hash_1 = __importDefault(require("./wasm-hash"));
16
- //#region wasm code: xxhash64 (../../../assembly/hash/xxhash64.asm.ts) --initialMemory 1
17
- const xxhash64 = new WebAssembly.Module(Buffer.from(
18
- // 1170 bytes
19
- "AGFzbQEAAAABCAJgAX8AYAAAAwQDAQAABQMBAAEGGgV+AUIAC34BQgALfgFCAAt+AUIAC34BQgALByIEBGluaXQAAAZ1cGRhdGUAAQVmaW5hbAACBm1lbW9yeQIACrIIAzAAQtbrgu7q/Yn14AAkAELP1tO+0ser2UIkAUIAJAJC+erQ0OfJoeThACQDQgAkBAvUAQIBfwR+IABFBEAPCyMEIACtfCQEIwAhAiMBIQMjAiEEIwMhBQNAIAIgASkDAELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiECIAMgASkDCELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEDIAQgASkDEELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEEIAUgASkDGELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEFIAAgAUEgaiIBSw0ACyACJAAgAyQBIAQkAiAFJAMLqAYCAX8EfiMEQgBSBH4jACICQgGJIwEiA0IHiXwjAiIEQgyJfCMDIgVCEol8IAJCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0gA0LP1tO+0ser2UJ+Qh+JQoeVr6+Ytt6bnn9+hUKHla+vmLbem55/fkKdo7Xqg7GNivoAfSAEQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IAVCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0FQsXP2bLx5brqJwsjBCAArXx8IQIDQCABQQhqIABNBEAgAiABKQMAQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQhuJQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IQIgAUEIaiEBDAELCyABQQRqIABNBEAgAiABNQIAQoeVr6+Ytt6bnn9+hUIXiULP1tO+0ser2UJ+Qvnz3fGZ9pmrFnwhAiABQQRqIQELA0AgACABRwRAIAIgATEAAELFz9my8eW66id+hUILiUKHla+vmLbem55/fiECIAFBAWohAQwBCwtBACACIAJCIYiFQs/W077Sx6vZQn4iAkIdiCAChUL5893xmfaZqxZ+IgJCIIggAoUiAkIgiCIDQv//A4NCIIYgA0KAgPz/D4NCEIiEIgNC/4GAgPAfg0IQhiADQoD+g4CA4D+DQgiIhCIDQo+AvIDwgcAHg0IIhiADQvCBwIeAnoD4AINCBIiEIgNChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IANCsODAgYOGjJgwhHw3AwBBCCACQv////8PgyICQv//A4NCIIYgAkKAgPz/D4NCEIiEIgJC/4GAgPAfg0IQhiACQoD+g4CA4D+DQgiIhCICQo+AvIDwgcAHg0IIhiACQvCBwIeAnoD4AINCBIiEIgJChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IAJCsODAgYOGjJgwhHw3AwAL", "base64"));
20
- //#endregion
21
- exports.default = wasm_hash_1.default.bind(null, xxhash64, [], 32, 16);
16
+ let createXxhash64;
17
+ exports.default = () => {
18
+ if (!createXxhash64) {
19
+ //#region wasm code: xxhash64 (../../../assembly/hash/xxhash64.asm.ts) --initialMemory 1
20
+ const xxhash64 = new WebAssembly.Module(Buffer.from(
21
+ // 1170 bytes
22
+ "AGFzbQEAAAABCAJgAX8AYAAAAwQDAQAABQMBAAEGGgV+AUIAC34BQgALfgFCAAt+AUIAC34BQgALByIEBGluaXQAAAZ1cGRhdGUAAQVmaW5hbAACBm1lbW9yeQIACrIIAzAAQtbrgu7q/Yn14AAkAELP1tO+0ser2UIkAUIAJAJC+erQ0OfJoeThACQDQgAkBAvUAQIBfwR+IABFBEAPCyMEIACtfCQEIwAhAiMBIQMjAiEEIwMhBQNAIAIgASkDAELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiECIAMgASkDCELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEDIAQgASkDEELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEEIAUgASkDGELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEFIAAgAUEgaiIBSw0ACyACJAAgAyQBIAQkAiAFJAMLqAYCAX8EfiMEQgBSBH4jACICQgGJIwEiA0IHiXwjAiIEQgyJfCMDIgVCEol8IAJCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0gA0LP1tO+0ser2UJ+Qh+JQoeVr6+Ytt6bnn9+hUKHla+vmLbem55/fkKdo7Xqg7GNivoAfSAEQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IAVCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0FQsXP2bLx5brqJwsjBCAArXx8IQIDQCABQQhqIABNBEAgAiABKQMAQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQhuJQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IQIgAUEIaiEBDAELCyABQQRqIABNBEAgAiABNQIAQoeVr6+Ytt6bnn9+hUIXiULP1tO+0ser2UJ+Qvnz3fGZ9pmrFnwhAiABQQRqIQELA0AgACABRwRAIAIgATEAAELFz9my8eW66id+hUILiUKHla+vmLbem55/fiECIAFBAWohAQwBCwtBACACIAJCIYiFQs/W077Sx6vZQn4iAkIdiCAChUL5893xmfaZqxZ+IgJCIIggAoUiAkIgiCIDQv//A4NCIIYgA0KAgPz/D4NCEIiEIgNC/4GAgPAfg0IQhiADQoD+g4CA4D+DQgiIhCIDQo+AvIDwgcAHg0IIhiADQvCBwIeAnoD4AINCBIiEIgNChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IANCsODAgYOGjJgwhHw3AwBBCCACQv////8PgyICQv//A4NCIIYgAkKAgPz/D4NCEIiEIgJC/4GAgPAfg0IQhiACQoD+g4CA4D+DQgiIhCICQo+AvIDwgcAHg0IIhiACQvCBwIeAnoD4AINCBIiEIgJChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IAJCsODAgYOGjJgwhHw3AwAL", "base64"));
23
+ //#endregion
24
+ createXxhash64 = wasm_hash_1.default.bind(null, xxhash64, [], 32, 16);
25
+ }
26
+ return createXxhash64();
27
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/core",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "webpackVersion": "5.75.0",
5
5
  "license": "MIT",
6
6
  "description": "The fast Rust-based web bundler with webpack-compatible API",
@@ -58,9 +58,9 @@
58
58
  },
59
59
  "dependencies": {
60
60
  "@module-federation/runtime-tools": "0.5.1",
61
- "@rspack/lite-tapable": "1.0.0",
61
+ "@rspack/lite-tapable": "1.0.1",
62
62
  "caniuse-lite": "^1.0.30001616",
63
- "@rspack/binding": "1.0.7"
63
+ "@rspack/binding": "1.0.8"
64
64
  },
65
65
  "peerDependencies": {
66
66
  "@swc/helpers": ">=0.5.1"