@rspack/core 1.2.2 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiled/@swc/types/index.d.ts +349 -258
- package/compiled/enhanced-resolve/index.d.ts +1 -1
- package/compiled/enhanced-resolve/package.json +1 -1
- package/compiled/graceful-fs/index.js +9 -9
- package/compiled/zod/index.d.ts +302 -265
- package/compiled/zod/index.js +238 -84
- package/compiled/zod/package.json +1 -1
- package/dist/Chunk.d.ts +2 -0
- package/dist/ChunkGraph.d.ts +6 -1
- package/dist/ChunkGroup.d.ts +1 -0
- package/dist/Compilation.d.ts +1 -7
- package/dist/Dependency.d.ts +1 -0
- package/dist/ExportsInfo.d.ts +1 -1
- package/dist/Module.d.ts +6 -1
- package/dist/ModuleGraph.d.ts +5 -1
- package/dist/ModuleGraphConnection.d.ts +2 -0
- package/dist/NormalModuleFactory.d.ts +4 -1
- package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +19 -3
- package/dist/builtin-plugin/RsdoctorPlugin.d.ts +45 -0
- package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +40 -0
- package/dist/builtin-plugin/html-plugin/options.d.ts +26 -20
- package/dist/builtin-plugin/index.d.ts +2 -0
- package/dist/builtin-plugin/lazy-compilation/backend.d.ts +11 -2
- package/dist/config/defaults.d.ts +1 -0
- package/dist/config/types.d.ts +13 -3
- package/dist/config/zod.d.ts +92 -32
- package/dist/exports.d.ts +7 -2
- package/dist/index.js +6539 -6019
- package/dist/lib/DllReferencePlugin.d.ts +1 -1
- package/dist/util/AsyncTask.d.ts +7 -0
- package/dist/util/runtime.d.ts +2 -0
- package/package.json +7 -7
package/dist/ExportsInfo.d.ts
CHANGED
package/dist/Module.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { JsCodegenerationResult, JsContextModuleFactoryAfterResolveData, JsContextModuleFactoryBeforeResolveData, JsCreateData, JsFactoryMeta } from "@rspack/binding";
|
|
1
|
+
import type { JsCodegenerationResult, JsContextModuleFactoryAfterResolveData, JsContextModuleFactoryBeforeResolveData, JsCreateData, JsFactoryMeta, JsLibIdentOptions } from "@rspack/binding";
|
|
2
2
|
import type { JsModule } from "@rspack/binding";
|
|
3
3
|
import type { Source } from "../compiled/webpack-sources";
|
|
4
4
|
import { DependenciesBlock } from "./DependenciesBlock";
|
|
5
5
|
import { Dependency } from "./Dependency";
|
|
6
|
+
import { type AssetInfo } from "./util/AssetInfo";
|
|
6
7
|
export type ResourceData = {
|
|
7
8
|
resource: string;
|
|
8
9
|
path: string;
|
|
@@ -74,6 +75,8 @@ export declare class Module {
|
|
|
74
75
|
readonly blocks: DependenciesBlock[];
|
|
75
76
|
readonly dependencies: Dependency[];
|
|
76
77
|
readonly useSourceMap: boolean;
|
|
78
|
+
readonly resourceResolveData: Record<string, any> | undefined;
|
|
79
|
+
readonly matchResource: string | undefined;
|
|
77
80
|
static __from_binding(binding: JsModule): Module;
|
|
78
81
|
static __to_binding(module: Module): JsModule;
|
|
79
82
|
constructor(module: JsModule);
|
|
@@ -81,6 +84,8 @@ export declare class Module {
|
|
|
81
84
|
identifier(): string;
|
|
82
85
|
nameForCondition(): string | null;
|
|
83
86
|
size(type?: string): number;
|
|
87
|
+
libIdent(options: JsLibIdentOptions): string | null;
|
|
88
|
+
emitFile(filename: string, source: Source, assetInfo: AssetInfo): void;
|
|
84
89
|
}
|
|
85
90
|
export declare class CodeGenerationResult {
|
|
86
91
|
#private;
|
package/dist/ModuleGraph.d.ts
CHANGED
|
@@ -6,11 +6,15 @@ import { ModuleGraphConnection } from "./ModuleGraphConnection";
|
|
|
6
6
|
export default class ModuleGraph {
|
|
7
7
|
#private;
|
|
8
8
|
static __from_binding(binding: JsModuleGraph): ModuleGraph;
|
|
9
|
-
|
|
9
|
+
constructor(binding: JsModuleGraph);
|
|
10
10
|
getModule(dependency: Dependency): Module | null;
|
|
11
11
|
getResolvedModule(dependency: Dependency): Module | null;
|
|
12
|
+
getParentModule(dependency: Dependency): Module | null;
|
|
12
13
|
getIssuer(module: Module): Module | null;
|
|
13
14
|
getExportsInfo(module: Module): ExportsInfo;
|
|
14
15
|
getConnection(dependency: Dependency): ModuleGraphConnection | null;
|
|
15
16
|
getOutgoingConnections(module: Module): ModuleGraphConnection[];
|
|
17
|
+
getIncomingConnections(module: Module): ModuleGraphConnection[];
|
|
18
|
+
getParentBlockIndex(dependency: Dependency): number;
|
|
19
|
+
isAsync(module: Module): boolean;
|
|
16
20
|
}
|
|
@@ -5,6 +5,8 @@ export declare class ModuleGraphConnection {
|
|
|
5
5
|
#private;
|
|
6
6
|
readonly module: Module | null;
|
|
7
7
|
readonly dependency: Dependency;
|
|
8
|
+
readonly resolvedModule: Module | null;
|
|
9
|
+
readonly originModule: Module | null;
|
|
8
10
|
static __from_binding(binding: JsModuleGraphConnection): ModuleGraphConnection;
|
|
9
11
|
static __to_binding(data: ModuleGraphConnection): JsModuleGraphConnection;
|
|
10
12
|
private constructor();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type * as binding from "@rspack/binding";
|
|
2
2
|
import * as liteTapable from "@rspack/lite-tapable";
|
|
3
3
|
import type { ResolveData, ResourceDataWithData } from "./Module";
|
|
4
|
+
import type { ResolverFactory } from "./ResolverFactory";
|
|
4
5
|
export type NormalModuleCreateData = binding.JsNormalModuleFactoryCreateModuleArgs & {
|
|
5
6
|
settings: {};
|
|
6
7
|
};
|
|
@@ -16,5 +17,7 @@ export declare class NormalModuleFactory {
|
|
|
16
17
|
{}
|
|
17
18
|
], void>;
|
|
18
19
|
};
|
|
19
|
-
|
|
20
|
+
resolverFactory: ResolverFactory;
|
|
21
|
+
constructor(resolverFactory: ResolverFactory);
|
|
22
|
+
getResolver(type: string, resolveOptions: Parameters<ResolverFactory["get"]>[1]): import("./Resolver").Resolver;
|
|
20
23
|
}
|
|
@@ -1,10 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/blob/3919c84/lib/javascript/EnableChunkLoadingPlugin.js
|
|
4
|
+
*
|
|
5
|
+
* MIT Licensed
|
|
6
|
+
* Author Tobias Koppers @sokra
|
|
7
|
+
* Copyright (c) JS Foundation and other contributors
|
|
8
|
+
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
|
+
*/
|
|
1
10
|
import { BuiltinPluginName } from "@rspack/binding";
|
|
2
|
-
|
|
11
|
+
import type { ChunkLoadingType, Compiler } from "../exports";
|
|
12
|
+
declare const EnableChunkLoadingPluginInner: {
|
|
3
13
|
new (type: string): {
|
|
4
14
|
name: BuiltinPluginName;
|
|
5
15
|
_args: [type: string];
|
|
6
16
|
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;
|
|
7
|
-
raw(compiler:
|
|
8
|
-
apply(compiler:
|
|
17
|
+
raw(compiler: Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
18
|
+
apply(compiler: Compiler): void;
|
|
9
19
|
};
|
|
10
20
|
};
|
|
21
|
+
export declare class EnableChunkLoadingPlugin extends EnableChunkLoadingPluginInner {
|
|
22
|
+
static setEnabled(compiler: Compiler, type: ChunkLoadingType): void;
|
|
23
|
+
static checkEnabled(compiler: Compiler, type: ChunkLoadingType): void;
|
|
24
|
+
apply(compiler: Compiler): void;
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { BuiltinPluginName, type JsRsdoctorAsset, type JsRsdoctorAssetPatch, type JsRsdoctorChunk, type JsRsdoctorChunkAssets, type JsRsdoctorChunkGraph, type JsRsdoctorChunkModules, type JsRsdoctorDependency, type JsRsdoctorEntrypoint, type JsRsdoctorEntrypointAssets, type JsRsdoctorExportInfo, type JsRsdoctorModule, type JsRsdoctorModuleGraph, type JsRsdoctorModuleGraphModule, type JsRsdoctorModuleIdsPatch, type JsRsdoctorModuleOriginalSource, type JsRsdoctorModuleSourcesPatch, type JsRsdoctorSideEffect, type JsRsdoctorSourcePosition, type JsRsdoctorSourceRange, type JsRsdoctorStatement, type JsRsdoctorVariable } from "@rspack/binding";
|
|
2
|
+
import * as liteTapable from "@rspack/lite-tapable";
|
|
3
|
+
import { Compilation } from "../Compilation";
|
|
4
|
+
import type { Compiler } from "../Compiler";
|
|
5
|
+
import type { CreatePartialRegisters } from "../taps/types";
|
|
6
|
+
export declare namespace RsdoctorPluginData {
|
|
7
|
+
export type { JsRsdoctorAsset as RsdoctorAsset, JsRsdoctorChunkGraph as RsdoctorChunkGraph, JsRsdoctorModuleGraph as RsdoctorModuleGraph, JsRsdoctorChunk as RsdoctorChunk, JsRsdoctorModule as RsdoctorModule, JsRsdoctorSideEffect as RsdoctorSideEffect, JsRsdoctorExportInfo as RsdoctorExportInfo, JsRsdoctorVariable as RsdoctorVariable, JsRsdoctorDependency as RsdoctorDependency, JsRsdoctorEntrypoint as RsdoctorEntrypoint, JsRsdoctorStatement as RsdoctorStatement, JsRsdoctorSourceRange as RsdoctorSourceRange, JsRsdoctorSourcePosition as RsdoctorSourcePosition, JsRsdoctorModuleGraphModule as RsdoctorModuleGraphModule, JsRsdoctorModuleIdsPatch as RsdoctorModuleIdsPatch, JsRsdoctorModuleOriginalSource as RsdoctorModuleOriginalSource, JsRsdoctorAssetPatch as RsdoctorAssetPatch, JsRsdoctorChunkAssets as RsdoctorChunkAssets, JsRsdoctorEntrypointAssets as RsdoctorEntrypointAssets, JsRsdoctorChunkModules as RsdoctorChunkModules, JsRsdoctorModuleSourcesPatch as RsdoctorModuleSourcesPatch };
|
|
8
|
+
}
|
|
9
|
+
export type RsdoctorPluginOptions = {
|
|
10
|
+
moduleGraphFeatures?: boolean | Array<"graph" | "ids" | "sources">;
|
|
11
|
+
chunkGraphFeatures?: boolean | Array<"graph" | "assets">;
|
|
12
|
+
};
|
|
13
|
+
declare const RsdoctorPluginImpl: {
|
|
14
|
+
new (c?: RsdoctorPluginOptions | undefined): {
|
|
15
|
+
name: BuiltinPluginName;
|
|
16
|
+
_args: [c?: RsdoctorPluginOptions | undefined];
|
|
17
|
+
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;
|
|
18
|
+
raw(compiler: Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
19
|
+
apply(compiler: Compiler): void;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export type RsdoctorPluginHooks = {
|
|
23
|
+
moduleGraph: liteTapable.AsyncSeriesBailHook<[
|
|
24
|
+
JsRsdoctorModuleGraph
|
|
25
|
+
], false | void>;
|
|
26
|
+
chunkGraph: liteTapable.AsyncSeriesBailHook<[
|
|
27
|
+
JsRsdoctorChunkGraph
|
|
28
|
+
], false | void>;
|
|
29
|
+
moduleIds: liteTapable.AsyncSeriesBailHook<[
|
|
30
|
+
JsRsdoctorModuleIdsPatch
|
|
31
|
+
], false | void>;
|
|
32
|
+
moduleSources: liteTapable.AsyncSeriesBailHook<[
|
|
33
|
+
JsRsdoctorModuleSourcesPatch
|
|
34
|
+
], false | void>;
|
|
35
|
+
assets: liteTapable.AsyncSeriesBailHook<[JsRsdoctorAssetPatch], false | void>;
|
|
36
|
+
};
|
|
37
|
+
declare const RsdoctorPlugin: typeof RsdoctorPluginImpl & {
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated Use `getCompilationHooks` instead.
|
|
40
|
+
*/
|
|
41
|
+
getHooks: (compilation: Compilation) => RsdoctorPluginHooks;
|
|
42
|
+
getCompilationHooks: (compilation: Compilation) => RsdoctorPluginHooks;
|
|
43
|
+
};
|
|
44
|
+
export declare const createRsdoctorPluginHooksRegisters: CreatePartialRegisters<`RsdoctorPlugin`>;
|
|
45
|
+
export { RsdoctorPlugin };
|
|
@@ -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 {};
|
|
@@ -5,63 +5,69 @@ export type HtmlRspackPluginOptions = {
|
|
|
5
5
|
/** The title to use for the generated HTML document. */
|
|
6
6
|
title?: string;
|
|
7
7
|
/**
|
|
8
|
-
* The file to write the HTML to. You can specify a subdirectory here too (
|
|
9
|
-
* @default
|
|
8
|
+
* The file to write the HTML to. You can specify a subdirectory here too (e.g.: `"pages/index.html"`).
|
|
9
|
+
* @default "index.html"
|
|
10
10
|
*/
|
|
11
11
|
filename?: string | ((entry: string) => string);
|
|
12
12
|
/** The template file path. */
|
|
13
13
|
template?: string;
|
|
14
14
|
/**
|
|
15
|
-
* The template file content, priority is greater than template.
|
|
15
|
+
* The template file content, priority is greater than `template` option.
|
|
16
|
+
*
|
|
16
17
|
* When using a function, pass in the template parameters and use the returned string as the template content.
|
|
17
18
|
*/
|
|
18
19
|
templateContent?: string | TemplateRenderFunction;
|
|
19
20
|
/**
|
|
20
21
|
* Allows to overwrite the parameters used in the template.
|
|
22
|
+
*
|
|
21
23
|
* When using a function, pass in the original template parameters and use the returned object as the final template parameters.
|
|
22
24
|
*/
|
|
23
25
|
templateParameters?: Record<string, string> | boolean | TemplateParamFunction;
|
|
24
26
|
/**
|
|
25
|
-
* The script and link tag inject position in template. Use false to not inject.
|
|
26
|
-
* If not specified, it will be automatically determined based on scriptLoading.
|
|
27
|
+
* The script and link tag inject position in template. Use `false` to not inject.
|
|
28
|
+
* If not specified, it will be automatically determined based on `scriptLoading` value.
|
|
29
|
+
* @default true
|
|
27
30
|
*/
|
|
28
31
|
inject?: boolean | "head" | "body";
|
|
29
|
-
/** The
|
|
32
|
+
/** The public path used for script and link tags. */
|
|
30
33
|
publicPath?: string;
|
|
31
|
-
/** Inject a [base](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base) tag */
|
|
34
|
+
/** Inject a [`base`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base) tag. */
|
|
32
35
|
base?: string | {
|
|
33
36
|
href?: string;
|
|
34
37
|
target?: "_self" | "_blank" | "_parent" | "_top";
|
|
35
38
|
};
|
|
36
39
|
/**
|
|
37
|
-
* Modern browsers support non
|
|
38
|
-
*
|
|
39
|
-
* This also implies
|
|
40
|
-
* @default
|
|
40
|
+
* Modern browsers support non-blocking JavaScript loading ([`defer` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#defer)) to improve the page startup performance.
|
|
41
|
+
*
|
|
42
|
+
* Setting this option to `'module'` adds attribute `type="module"` to the `script`. This also implies `defer` attribute on the `script`, since modules are automatically deferred.
|
|
43
|
+
* @default "defer"
|
|
41
44
|
* */
|
|
42
45
|
scriptLoading?: "blocking" | "defer" | "module" | "systemjs-module";
|
|
43
46
|
/** Allows you to add only some chunks. */
|
|
44
47
|
chunks?: string[];
|
|
45
48
|
/** Allows you to skip some chunks. */
|
|
46
49
|
excludeChunks?: string[];
|
|
47
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* Allows to control how chunks should be sorted before they are included to the HTML.
|
|
52
|
+
* @default "auto"
|
|
53
|
+
*/
|
|
48
54
|
chunksSortMode?: "auto" | "manual";
|
|
49
|
-
/** The
|
|
55
|
+
/** The SRI hash algorithm, disabled by default. */
|
|
50
56
|
sri?: "sha256" | "sha384" | "sha512";
|
|
51
57
|
/**
|
|
52
|
-
* Controls whether to minify the output.
|
|
53
|
-
* @default false
|
|
58
|
+
* Controls whether to minify the output, disabled by default.
|
|
54
59
|
*/
|
|
55
60
|
minify?: boolean;
|
|
56
61
|
/** Adds the given favicon path to the output HTML. */
|
|
57
62
|
favicon?: string;
|
|
58
63
|
/**
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
|
|
62
|
-
* */
|
|
64
|
+
* Allows to inject meta-tags.
|
|
65
|
+
* @default {}
|
|
66
|
+
*/
|
|
63
67
|
meta?: Record<string, string | Record<string, string>>;
|
|
64
|
-
/**
|
|
68
|
+
/**
|
|
69
|
+
* If `true` then append a unique Rspack compilation hash to all included scripts and CSS files. This is useful for cache busting.
|
|
70
|
+
*/
|
|
65
71
|
hash?: boolean;
|
|
66
72
|
};
|
|
67
73
|
export declare function validateHtmlPluginOptions(options: HtmlRspackPluginOptions): void;
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import type { IncomingMessage, ServerOptions as ServerOptionsImport, ServerResponse } from "node:http";
|
|
2
|
-
import type { ListenOptions,
|
|
2
|
+
import type { AddressInfo, ListenOptions, Socket } from "node:net";
|
|
3
3
|
import type { SecureContextOptions, TlsOptions } from "node:tls";
|
|
4
4
|
import type { Compiler } from "../..";
|
|
5
|
+
interface Server {
|
|
6
|
+
on(event: "request", callback: (req: IncomingMessage, res: ServerResponse) => void): void;
|
|
7
|
+
on(event: "connection", callback: (socket: Socket) => void): void;
|
|
8
|
+
on(event: "listening", callback: (err?: Error) => void): void;
|
|
9
|
+
off(event: "request", callback: (req: IncomingMessage, res: ServerResponse) => void): void;
|
|
10
|
+
address(): AddressInfo;
|
|
11
|
+
close(callback: (err?: any) => void): void;
|
|
12
|
+
listen(listenOptions?: number | ListenOptions): void;
|
|
13
|
+
}
|
|
5
14
|
export interface LazyCompilationDefaultBackendOptions {
|
|
6
15
|
/**
|
|
7
16
|
* A custom client script path.
|
|
@@ -23,7 +32,7 @@ export interface LazyCompilationDefaultBackendOptions {
|
|
|
23
32
|
export type ServerOptionsHttps<Request extends typeof IncomingMessage = typeof IncomingMessage, Response extends typeof ServerResponse = typeof ServerResponse> = SecureContextOptions & TlsOptions & ServerOptionsImport<Request, Response>;
|
|
24
33
|
declare const getBackend: (options: Omit<LazyCompilationDefaultBackendOptions, "client"> & {
|
|
25
34
|
client: NonNullable<LazyCompilationDefaultBackendOptions["client"]>;
|
|
26
|
-
}) => (compiler: Compiler, callback: (err:
|
|
35
|
+
}) => (compiler: Compiler, callback: (err: Error | null, obj?: {
|
|
27
36
|
dispose: (callback: (err: any) => void) => void;
|
|
28
37
|
module: (args: {
|
|
29
38
|
module: string;
|
|
@@ -10,3 +10,4 @@
|
|
|
10
10
|
import type { RspackOptionsNormalized } from "./normalization";
|
|
11
11
|
export declare const applyRspackOptionsDefaults: (options: RspackOptionsNormalized) => void;
|
|
12
12
|
export declare const applyRspackOptionsBaseDefaults: (options: RspackOptionsNormalized) => void;
|
|
13
|
+
export declare const getPnpDefault: () => boolean;
|
package/dist/config/types.d.ts
CHANGED
|
@@ -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
|
*
|
|
@@ -1575,10 +1579,14 @@ type SharedOptimizationSplitChunksCacheGroup = {
|
|
|
1575
1579
|
*/
|
|
1576
1580
|
automaticNameDelimiter?: string;
|
|
1577
1581
|
};
|
|
1582
|
+
export type OptimizationSplitChunksCacheGroupTestFn = (module: Module, ctx: {
|
|
1583
|
+
chunkGraph: ChunkGraph;
|
|
1584
|
+
moduleGraph: ModuleGraph;
|
|
1585
|
+
}) => boolean;
|
|
1578
1586
|
/** How to splitting chunks. */
|
|
1579
1587
|
export type OptimizationSplitChunksCacheGroup = {
|
|
1580
1588
|
/** Controls which modules are selected by this cache group. */
|
|
1581
|
-
test?: string | RegExp |
|
|
1589
|
+
test?: string | RegExp | OptimizationSplitChunksCacheGroupTestFn;
|
|
1582
1590
|
/**
|
|
1583
1591
|
* A module can belong to multiple cache groups.
|
|
1584
1592
|
* @default -20
|
|
@@ -1588,8 +1596,6 @@ export type OptimizationSplitChunksCacheGroup = {
|
|
|
1588
1596
|
* Tells Rspack to ignore `splitChunks.minSize`, `splitChunks.minChunks`, `splitChunks.maxAsyncRequests` and `splitChunks.maxInitialRequests` options and always create chunks for this cache group.
|
|
1589
1597
|
*/
|
|
1590
1598
|
enforce?: boolean;
|
|
1591
|
-
/** Allows to override the filename when and only when it's an initial chunk. */
|
|
1592
|
-
filename?: Filename;
|
|
1593
1599
|
/**
|
|
1594
1600
|
* Whether to reuse existing chunks when possible.
|
|
1595
1601
|
* @default false
|
|
@@ -1599,6 +1605,10 @@ export type OptimizationSplitChunksCacheGroup = {
|
|
|
1599
1605
|
type?: string | RegExp;
|
|
1600
1606
|
/** Sets the hint for chunk id. It will be added to chunk's filename. */
|
|
1601
1607
|
idHint?: string;
|
|
1608
|
+
/**
|
|
1609
|
+
* Assign modules to a cache group by module layer.
|
|
1610
|
+
*/
|
|
1611
|
+
layer?: string | ((layer?: string) => boolean) | RegExp;
|
|
1602
1612
|
} & SharedOptimizationSplitChunksCacheGroup;
|
|
1603
1613
|
/** Tell Rspack how to splitting chunks. */
|
|
1604
1614
|
export type OptimizationSplitChunksOptions = {
|