@rspack/core 1.3.0 → 1.3.1
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/dist/Compilation.d.ts +1 -0
- package/dist/NormalModule.d.ts +1 -1
- package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RsdoctorPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RuntimePlugin.d.ts +1 -1
- package/dist/builtin-plugin/html-plugin/hooks.d.ts +1 -1
- package/dist/config/adapterRuleUse.d.ts +1 -2
- package/dist/config/normalization.d.ts +1 -0
- package/dist/config/types.d.ts +6 -0
- package/dist/config/zod.d.ts +5 -0
- package/dist/index.js +605 -281
- package/dist/loader-runner/index.d.ts +5 -3
- package/dist/loader-runner/service.d.ts +66 -0
- package/dist/loader-runner/utils.d.ts +5 -0
- package/dist/loader-runner/worker.d.ts +14 -0
- package/dist/util/index.d.ts +1 -1
- package/dist/worker.js +1853 -0
- package/package.json +4 -3
package/dist/Compilation.d.ts
CHANGED
@@ -138,6 +138,7 @@ export interface KnownNormalizedStatsOptions {
|
|
138
138
|
}
|
139
139
|
export type CreateStatsOptionsContext = KnownCreateStatsOptionsContext & Record<string, any>;
|
140
140
|
export type NormalizedStatsOptions = KnownNormalizedStatsOptions & Omit<StatsOptions, keyof KnownNormalizedStatsOptions> & Record<string, any>;
|
141
|
+
export declare const checkCompilation: (compilation: Compilation) => void;
|
141
142
|
export declare class Compilation {
|
142
143
|
#private;
|
143
144
|
hooks: Readonly<{
|
package/dist/NormalModule.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import * as liteTapable from "@rspack/lite-tapable";
|
2
|
-
import { Compilation } from "./Compilation";
|
2
|
+
import { type Compilation } from "./Compilation";
|
3
3
|
import type { Module } from "./Module";
|
4
4
|
import type { LoaderContext } from "./config";
|
5
5
|
interface NormalModuleCompilationHooks {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { type BuiltinPlugin, BuiltinPluginName } from "@rspack/binding";
|
2
2
|
import * as liteTapable from "@rspack/lite-tapable";
|
3
3
|
import type { Chunk } from "../Chunk";
|
4
|
-
import { Compilation } from "../Compilation";
|
4
|
+
import { type Compilation } from "../Compilation";
|
5
5
|
import type Hash from "../util/hash";
|
6
6
|
import { RspackBuiltinPlugin } from "./base";
|
7
7
|
export type CompilationHooks = {
|
@@ -1,6 +1,6 @@
|
|
1
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
2
|
import * as liteTapable from "@rspack/lite-tapable";
|
3
|
-
import { Compilation } from "../Compilation";
|
3
|
+
import { type Compilation } from "../Compilation";
|
4
4
|
import type { Compiler } from "../Compiler";
|
5
5
|
import type { CreatePartialRegisters } from "../taps/types";
|
6
6
|
export declare namespace RsdoctorPluginData {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import * as binding from "@rspack/binding";
|
2
2
|
import * as liteTapable from "@rspack/lite-tapable";
|
3
3
|
import { Chunk } from "../Chunk";
|
4
|
-
import { Compilation } from "../Compilation";
|
4
|
+
import { type Compilation } from "../Compilation";
|
5
5
|
import type { CreatePartialRegisters } from "../taps/types";
|
6
6
|
export declare const RuntimePluginImpl: {
|
7
7
|
new (): {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { JsAfterEmitData, JsAfterTemplateExecutionData, JsAlterAssetTagGroupsData, JsAlterAssetTagsData, JsBeforeAssetTagGenerationData, JsBeforeEmitData } from "@rspack/binding";
|
2
2
|
import * as liteTapable from "@rspack/lite-tapable";
|
3
|
-
import { Compilation } from "../../Compilation";
|
3
|
+
import { type Compilation } from "../../Compilation";
|
4
4
|
import type { HtmlRspackPluginOptions } from "./options";
|
5
5
|
type ExtraPluginHookData = {
|
6
6
|
plugin: {
|
@@ -55,7 +55,7 @@ export interface Diagnostic {
|
|
55
55
|
file?: string;
|
56
56
|
severity: "error" | "warning";
|
57
57
|
}
|
58
|
-
interface LoaderExperiments {
|
58
|
+
export interface LoaderExperiments {
|
59
59
|
emitDiagnostic(diagnostic: Diagnostic): void;
|
60
60
|
}
|
61
61
|
export interface ImportModuleOptions {
|
@@ -331,4 +331,3 @@ export type LoaderDefinition<OptionsType = {}, ContextAdditions = {}> = LoaderDe
|
|
331
331
|
export declare function createRawModuleRuleUses(uses: RuleSetUseItem | RuleSetUseItem[], path: string, options: ComposeJsUseOptions): RawModuleRuleUse[];
|
332
332
|
export declare function isUseSourceMap(devtool: RspackOptionsNormalized["devtool"]): boolean;
|
333
333
|
export declare function isUseSimpleSourceMap(devtool: RspackOptionsNormalized["devtool"]): boolean;
|
334
|
-
export {};
|
@@ -105,6 +105,7 @@ export interface ExperimentsNormalized {
|
|
105
105
|
futureDefaults?: boolean;
|
106
106
|
rspackFuture?: RspackFutureOptions;
|
107
107
|
buildHttp?: HttpUriPluginOptions;
|
108
|
+
parallelLoader?: boolean;
|
108
109
|
}
|
109
110
|
export type IgnoreWarningsNormalized = ((warning: Error, compilation: Compilation) => boolean)[];
|
110
111
|
export type OptimizationRuntimeChunkNormalized = false | {
|
package/dist/config/types.d.ts
CHANGED
@@ -595,6 +595,7 @@ export type RuleSetLoaderOptions = string | Record<string, any>;
|
|
595
595
|
export type RuleSetLoaderWithOptions = {
|
596
596
|
ident?: string;
|
597
597
|
loader: RuleSetLoader;
|
598
|
+
parallel?: boolean;
|
598
599
|
options?: RuleSetLoaderOptions;
|
599
600
|
};
|
600
601
|
export type RuleSetUseItem = RuleSetLoader | RuleSetLoaderWithOptions;
|
@@ -1969,6 +1970,11 @@ export type Experiments = {
|
|
1969
1970
|
* @default false
|
1970
1971
|
*/
|
1971
1972
|
buildHttp?: HttpUriOptions;
|
1973
|
+
/**
|
1974
|
+
* Enable parallel loader
|
1975
|
+
* @default false
|
1976
|
+
*/
|
1977
|
+
parallelLoader?: boolean;
|
1972
1978
|
};
|
1973
1979
|
export type Watch = boolean;
|
1974
1980
|
/** Options for watch mode. */
|
package/dist/config/zod.d.ts
CHANGED
@@ -1025,6 +1025,7 @@ export declare const rspackOptions: z.ZodObject<{
|
|
1025
1025
|
cacheLocation?: string | false | undefined;
|
1026
1026
|
upgrade?: boolean | undefined;
|
1027
1027
|
}>>;
|
1028
|
+
parallelLoader: z.ZodOptional<z.ZodBoolean>;
|
1028
1029
|
}, "strict", z.ZodTypeAny, {
|
1029
1030
|
css?: boolean | undefined;
|
1030
1031
|
cache?: boolean | {
|
@@ -1091,6 +1092,7 @@ export declare const rspackOptions: z.ZodObject<{
|
|
1091
1092
|
cacheLocation?: string | false | undefined;
|
1092
1093
|
upgrade?: boolean | undefined;
|
1093
1094
|
} | undefined;
|
1095
|
+
parallelLoader?: boolean | undefined;
|
1094
1096
|
}, {
|
1095
1097
|
css?: boolean | undefined;
|
1096
1098
|
cache?: boolean | {
|
@@ -1157,6 +1159,7 @@ export declare const rspackOptions: z.ZodObject<{
|
|
1157
1159
|
cacheLocation?: string | false | undefined;
|
1158
1160
|
upgrade?: boolean | undefined;
|
1159
1161
|
} | undefined;
|
1162
|
+
parallelLoader?: boolean | undefined;
|
1160
1163
|
}>>;
|
1161
1164
|
externals: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodBoolean]>, z.ZodArray<z.ZodString, "many">]>, ZodRspackCrossChecker<t.ExternalItemUmdValue | t.ExternalItemObjectValue>]>>]>, z.ZodFunction<z.ZodTuple<[z.ZodType<t.ExternalItemFunctionData, z.ZodTypeDef, t.ExternalItemFunctionData>, z.ZodFunction<z.ZodTuple<[z.ZodOptional<z.ZodType<Error, z.ZodTypeDef, Error>>, z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodBoolean]>, z.ZodArray<z.ZodString, "many">]>, ZodRspackCrossChecker<t.ExternalItemUmdValue | t.ExternalItemObjectValue>]>>, z.ZodOptional<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"]>>], z.ZodUnknown>, z.ZodVoid>], z.ZodUnknown>, z.ZodUnknown>]>, z.ZodFunction<z.ZodTuple<[z.ZodType<t.ExternalItemFunctionData, z.ZodTypeDef, t.ExternalItemFunctionData>], z.ZodUnknown>, z.ZodPromise<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodBoolean]>, z.ZodArray<z.ZodString, "many">]>, ZodRspackCrossChecker<t.ExternalItemUmdValue | t.ExternalItemObjectValue>]>>>]>, z.ZodFunction<z.ZodTuple<[z.ZodType<t.ExternalItemFunctionData, z.ZodTypeDef, t.ExternalItemFunctionData>], z.ZodUnknown>, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodBoolean]>, z.ZodArray<z.ZodString, "many">]>, ZodRspackCrossChecker<t.ExternalItemUmdValue | t.ExternalItemObjectValue>]>>]>, "many">, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodBoolean]>, z.ZodArray<z.ZodString, "many">]>, ZodRspackCrossChecker<t.ExternalItemUmdValue | t.ExternalItemObjectValue>]>>]>, z.ZodFunction<z.ZodTuple<[z.ZodType<t.ExternalItemFunctionData, z.ZodTypeDef, t.ExternalItemFunctionData>, z.ZodFunction<z.ZodTuple<[z.ZodOptional<z.ZodType<Error, z.ZodTypeDef, Error>>, z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodBoolean]>, z.ZodArray<z.ZodString, "many">]>, ZodRspackCrossChecker<t.ExternalItemUmdValue | t.ExternalItemObjectValue>]>>, z.ZodOptional<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"]>>], z.ZodUnknown>, z.ZodVoid>], z.ZodUnknown>, z.ZodUnknown>]>, z.ZodFunction<z.ZodTuple<[z.ZodType<t.ExternalItemFunctionData, z.ZodTypeDef, t.ExternalItemFunctionData>], z.ZodUnknown>, z.ZodPromise<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodBoolean]>, z.ZodArray<z.ZodString, "many">]>, ZodRspackCrossChecker<t.ExternalItemUmdValue | t.ExternalItemObjectValue>]>>>]>, z.ZodFunction<z.ZodTuple<[z.ZodType<t.ExternalItemFunctionData, z.ZodTypeDef, t.ExternalItemFunctionData>], z.ZodUnknown>, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodBoolean]>, z.ZodArray<z.ZodString, "many">]>, ZodRspackCrossChecker<t.ExternalItemUmdValue | t.ExternalItemObjectValue>]>>]>]>>;
|
1162
1165
|
externalsType: z.ZodOptional<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"]>>;
|
@@ -3165,6 +3168,7 @@ export declare const rspackOptions: z.ZodObject<{
|
|
3165
3168
|
cacheLocation?: string | false | undefined;
|
3166
3169
|
upgrade?: boolean | undefined;
|
3167
3170
|
} | undefined;
|
3171
|
+
parallelLoader?: boolean | undefined;
|
3168
3172
|
} | undefined;
|
3169
3173
|
devtool?: false | "eval" | "cheap-source-map" | "cheap-module-source-map" | "source-map" | "inline-cheap-source-map" | "inline-cheap-module-source-map" | "inline-source-map" | "inline-nosources-cheap-source-map" | "inline-nosources-cheap-module-source-map" | "inline-nosources-source-map" | "nosources-cheap-source-map" | "nosources-cheap-module-source-map" | "nosources-source-map" | "hidden-nosources-cheap-source-map" | "hidden-nosources-cheap-module-source-map" | "hidden-nosources-source-map" | "hidden-cheap-source-map" | "hidden-cheap-module-source-map" | "hidden-source-map" | "eval-cheap-source-map" | "eval-cheap-module-source-map" | "eval-source-map" | "eval-nosources-cheap-source-map" | "eval-nosources-cheap-module-source-map" | "eval-nosources-source-map" | undefined;
|
3170
3174
|
stats?: boolean | "verbose" | "none" | "normal" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | {
|
@@ -3778,6 +3782,7 @@ export declare const rspackOptions: z.ZodObject<{
|
|
3778
3782
|
cacheLocation?: string | false | undefined;
|
3779
3783
|
upgrade?: boolean | undefined;
|
3780
3784
|
} | undefined;
|
3785
|
+
parallelLoader?: boolean | undefined;
|
3781
3786
|
} | undefined;
|
3782
3787
|
devtool?: false | "eval" | "cheap-source-map" | "cheap-module-source-map" | "source-map" | "inline-cheap-source-map" | "inline-cheap-module-source-map" | "inline-source-map" | "inline-nosources-cheap-source-map" | "inline-nosources-cheap-module-source-map" | "inline-nosources-source-map" | "nosources-cheap-source-map" | "nosources-cheap-module-source-map" | "nosources-source-map" | "hidden-nosources-cheap-source-map" | "hidden-nosources-cheap-module-source-map" | "hidden-nosources-source-map" | "hidden-cheap-source-map" | "hidden-cheap-module-source-map" | "hidden-source-map" | "eval-cheap-source-map" | "eval-cheap-module-source-map" | "eval-source-map" | "eval-nosources-cheap-source-map" | "eval-nosources-cheap-module-source-map" | "eval-nosources-source-map" | undefined;
|
3783
3788
|
stats?: boolean | "verbose" | "none" | "normal" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | {
|