@rspack/core 1.0.0-alpha.1 → 1.0.0-alpha.3
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/zod-validation-error/index.d.ts +4 -170
- package/compiled/zod-validation-error/index.js +4 -4154
- package/dist/ChunkGraph.d.ts +1 -1
- package/dist/Compilation.d.ts +9 -9
- package/dist/Compilation.js +25 -21
- package/dist/Compiler.d.ts +6 -6
- package/dist/Compiler.js +5 -6
- package/dist/ContextModuleFactory.d.ts +1 -1
- package/dist/FileSystem.d.ts +2 -2
- package/dist/Module.d.ts +4 -3
- package/dist/Module.js +1 -0
- package/dist/MultiCompiler.d.ts +3 -3
- package/dist/MultiStats.d.ts +2 -2
- package/dist/MultiWatching.d.ts +2 -2
- package/dist/NormalModule.d.ts +1 -1
- package/dist/NormalModuleFactory.d.ts +1 -1
- package/dist/Resolver.d.ts +19 -0
- package/dist/Resolver.js +39 -0
- package/dist/ResolverFactory.d.ts +9 -47
- package/dist/ResolverFactory.js +49 -120
- package/dist/RspackError.d.ts +1 -1
- package/dist/RuntimeGlobals.d.ts +1 -1
- package/dist/Stats.d.ts +2 -2
- package/dist/Watching.d.ts +3 -3
- package/dist/builtin-loader/swc/index.d.ts +0 -4
- package/dist/builtin-loader/swc/index.js +1 -5
- package/dist/builtin-loader/swc/pluginImport.d.ts +17 -1
- package/dist/builtin-loader/swc/react.d.ts +11 -1
- package/dist/builtin-loader/swc/types.d.ts +0 -2
- package/dist/builtin-plugin/APIPlugin.d.ts +3 -3
- package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.d.ts +3 -3
- package/dist/builtin-plugin/AssetModulesPlugin.d.ts +3 -3
- package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.d.ts +3 -3
- package/dist/builtin-plugin/BannerPlugin.d.ts +25 -4
- package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +4 -4
- package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.d.ts +3 -3
- package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +3 -3
- package/dist/builtin-plugin/CopyRspackPlugin.d.ts +4 -4
- package/dist/builtin-plugin/CssModulesPlugin.d.ts +3 -3
- package/dist/builtin-plugin/DataUriPlugin.d.ts +3 -3
- package/dist/builtin-plugin/DefinePlugin.d.ts +10 -4
- package/dist/builtin-plugin/DefinePlugin.js +42 -8
- package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/DynamicEntryPlugin.d.ts +5 -5
- package/dist/builtin-plugin/ElectronTargetPlugin.d.ts +3 -3
- package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +3 -3
- package/dist/builtin-plugin/EnableLibraryPlugin.d.ts +2 -2
- package/dist/builtin-plugin/EnableWasmLoadingPlugin.d.ts +3 -3
- package/dist/builtin-plugin/EnsureChunkConditionsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/EntryPlugin.d.ts +5 -5
- package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +4 -4
- package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +5 -5
- package/dist/builtin-plugin/ExternalsPlugin.d.ts +22 -6
- package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.d.ts +3 -3
- package/dist/builtin-plugin/FileUriPlugin.d.ts +3 -3
- package/dist/builtin-plugin/FlagDependencyExportsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/FlagDependencyUsagePlugin.d.ts +3 -3
- package/dist/builtin-plugin/HotModuleReplacementPlugin.d.ts +2 -2
- package/dist/builtin-plugin/HtmlRspackPlugin.d.ts +19 -4
- package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +4 -4
- package/dist/builtin-plugin/IgnorePlugin.d.ts +4 -4
- package/dist/builtin-plugin/InferAsyncModulesPlugin.d.ts +3 -3
- package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +2 -2
- package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +4 -4
- package/dist/builtin-plugin/JsonModulesPlugin.d.ts +3 -3
- package/dist/builtin-plugin/LightningCssMiminizerRspackPlugin.d.ts +4 -4
- package/dist/builtin-plugin/LimitChunkCountPlugin.d.ts +4 -4
- package/dist/builtin-plugin/MangleExportsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/MergeDuplicateChunksPlugin.d.ts +3 -3
- package/dist/builtin-plugin/ModuleChunkFormatPlugin.d.ts +3 -3
- package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +3 -3
- package/dist/builtin-plugin/NamedChunkIdsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/NamedModuleIdsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/NaturalChunkIdsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/NaturalModuleIdsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/NodeTargetPlugin.d.ts +3 -3
- package/dist/builtin-plugin/ProgressPlugin.d.ts +4 -4
- package/dist/builtin-plugin/ProvidePlugin.d.ts +3 -3
- package/dist/builtin-plugin/RealContentHashPlugin.d.ts +3 -3
- package/dist/builtin-plugin/RemoveEmptyChunksPlugin.d.ts +3 -3
- package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +4 -4
- package/dist/builtin-plugin/RuntimePlugin.d.ts +3 -3
- package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +3 -3
- package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +9 -4
- package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +4 -4
- package/dist/builtin-plugin/SplitChunksPlugin.d.ts +3 -3
- package/dist/builtin-plugin/SwcCssMinimizerPlugin.d.ts +3 -3
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +4 -4
- package/dist/builtin-plugin/WarnCaseSensitiveModulesPlugin.d.ts +3 -3
- package/dist/builtin-plugin/WebWorkerTemplatePlugin.d.ts +3 -3
- package/dist/builtin-plugin/WorkerPlugin.d.ts +3 -3
- package/dist/builtin-plugin/base.d.ts +6 -6
- package/dist/builtin-plugin/base.js +3 -3
- package/dist/builtin-plugin/css-extract/index.d.ts +1 -1
- package/dist/builtin-plugin/css-extract/loader.js +13 -3
- package/dist/builtin-plugin/css-extract/utils.d.ts +1 -1
- package/dist/builtin-plugin/index.d.ts +1 -7
- package/dist/builtin-plugin/index.js +3 -17
- package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +11 -17
- package/dist/builtin-plugin/lazy-compilation/plugin.d.ts +2 -2
- package/dist/config/adapter.d.ts +5 -4
- package/dist/config/adapter.js +3 -2
- package/dist/config/adapterRuleUse.d.ts +7 -7
- package/dist/config/adapterRuleUse.js +0 -3
- package/dist/config/defaults.d.ts +1 -1
- package/dist/config/zod.d.ts +382 -382
- package/dist/config/zod.js +2 -3
- package/dist/container/ContainerPlugin.d.ts +3 -3
- package/dist/container/ContainerReferencePlugin.d.ts +4 -4
- package/dist/container/ModuleFederationPlugin.d.ts +2 -2
- package/dist/container/ModuleFederationPluginV1.d.ts +5 -5
- package/dist/container/ModuleFederationRuntimePlugin.d.ts +3 -3
- package/dist/container/default.runtime.js +1 -1
- package/dist/lib/EntryOptionPlugin.d.ts +2 -2
- package/dist/lib/NormalModuleReplacementPlugin.d.ts +2 -2
- package/dist/loader-runner/index.d.ts +2 -2
- package/dist/loader-runner/index.js +33 -46
- package/dist/loader-runner/loadLoader.js +1 -1
- package/dist/node/NodeTemplatePlugin.d.ts +1 -1
- package/dist/node/NodeWatchFileSystem.d.ts +1 -1
- package/dist/node/nodeConsole.js +26 -3
- package/dist/rspack.d.ts +3 -3
- package/dist/rspackOptionsApply.d.ts +1 -1
- package/dist/rspackOptionsApply.js +1 -19
- package/dist/sharing/ConsumeSharedPlugin.d.ts +2 -2
- package/dist/sharing/ProvideSharedPlugin.d.ts +2 -2
- package/dist/sharing/SharePlugin.d.ts +1 -1
- package/dist/sharing/ShareRuntimePlugin.d.ts +2 -2
- package/dist/stats/StatsFactory.d.ts +2 -2
- package/dist/stats/statsFactoryUtils.d.ts +1 -1
- package/dist/util/SplitChunkSize.d.ts +1 -1
- package/dist/util/bindingVersionCheck.js +1 -1
- package/dist/util/comparators.d.ts +1 -1
- package/dist/util/fs.d.ts +1 -1
- package/dist/util/index.d.ts +1 -1
- package/dist/util/index.js +4 -2
- package/dist/util/validate.d.ts +1 -1
- package/package.json +5 -35
- package/dist/builtin-loader/swc/preact.d.ts +0 -6
- package/dist/builtin-loader/swc/preact.js +0 -15
|
@@ -2,9 +2,9 @@ import { BuiltinPluginName } from "@rspack/binding";
|
|
|
2
2
|
export declare const SideEffectsFlagPlugin: {
|
|
3
3
|
new (): {
|
|
4
4
|
name: BuiltinPluginName;
|
|
5
|
-
|
|
6
|
-
affectedHooks: "
|
|
7
|
-
raw(): import("@rspack/binding").BuiltinPlugin;
|
|
5
|
+
_args: [];
|
|
6
|
+
affectedHooks: "done" | "compilation" | "failed" | "environment" | "emit" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "shutdown" | "watchRun" | "watchClose" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
|
|
7
|
+
raw(compiler: import("../Compiler").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
8
8
|
apply(compiler: import("../Compiler").Compiler): void;
|
|
9
9
|
};
|
|
10
10
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BuiltinPluginName
|
|
1
|
+
import { BuiltinPluginName } from "@rspack/binding";
|
|
2
2
|
export declare const SizeLimitsPlugin: {
|
|
3
3
|
new (options: {
|
|
4
4
|
assetFilter?: ((args_0: string, ...args_1: unknown[]) => boolean) | undefined;
|
|
@@ -7,9 +7,14 @@ export declare const SizeLimitsPlugin: {
|
|
|
7
7
|
maxEntrypointSize?: number | undefined;
|
|
8
8
|
}): {
|
|
9
9
|
name: BuiltinPluginName;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
_args: [options: {
|
|
11
|
+
assetFilter?: ((args_0: string, ...args_1: unknown[]) => boolean) | undefined;
|
|
12
|
+
hints?: false | "error" | "warning" | undefined;
|
|
13
|
+
maxAssetSize?: number | undefined;
|
|
14
|
+
maxEntrypointSize?: number | undefined;
|
|
15
|
+
}];
|
|
16
|
+
affectedHooks: "done" | "compilation" | "failed" | "environment" | "emit" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "shutdown" | "watchRun" | "watchClose" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
|
|
17
|
+
raw(compiler: import("../Compiler").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
13
18
|
apply(compiler: import("../Compiler").Compiler): void;
|
|
14
19
|
};
|
|
15
20
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BuiltinPluginName, RawSourceMapDevToolPluginOptions } from "@rspack/binding";
|
|
1
|
+
import { BuiltinPluginName, type RawSourceMapDevToolPluginOptions } from "@rspack/binding";
|
|
2
2
|
/**
|
|
3
3
|
* Include source maps for modules based on their extension (defaults to .js and .css).
|
|
4
4
|
*/
|
|
@@ -15,9 +15,9 @@ export interface SourceMapDevToolPluginOptions extends Omit<RawSourceMapDevToolP
|
|
|
15
15
|
export declare const SourceMapDevToolPlugin: {
|
|
16
16
|
new (options: SourceMapDevToolPluginOptions): {
|
|
17
17
|
name: BuiltinPluginName;
|
|
18
|
-
|
|
19
|
-
affectedHooks: "
|
|
20
|
-
raw(): import("@rspack/binding").BuiltinPlugin;
|
|
18
|
+
_args: [options: SourceMapDevToolPluginOptions];
|
|
19
|
+
affectedHooks: "done" | "compilation" | "failed" | "environment" | "emit" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "shutdown" | "watchRun" | "watchClose" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
|
|
20
|
+
raw(compiler: import("../Compiler").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
21
21
|
apply(compiler: import("../Compiler").Compiler): void;
|
|
22
22
|
};
|
|
23
23
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BuiltinPlugin, BuiltinPluginName } from "@rspack/binding";
|
|
2
|
-
import { Compiler } from "../Compiler";
|
|
3
|
-
import {
|
|
1
|
+
import { type BuiltinPlugin, BuiltinPluginName } from "@rspack/binding";
|
|
2
|
+
import type { Compiler } from "../Compiler";
|
|
3
|
+
import type { OptimizationSplitChunksOptions } from "../config/zod";
|
|
4
4
|
import { RspackBuiltinPlugin } from "./base";
|
|
5
5
|
export declare class SplitChunksPlugin extends RspackBuiltinPlugin {
|
|
6
6
|
private options;
|
|
@@ -2,9 +2,9 @@ import { BuiltinPluginName } from "@rspack/binding";
|
|
|
2
2
|
export declare const SwcCssMinimizerRspackPlugin: {
|
|
3
3
|
new (options?: any): {
|
|
4
4
|
name: BuiltinPluginName;
|
|
5
|
-
|
|
6
|
-
affectedHooks: "
|
|
7
|
-
raw(): import("@rspack/binding").BuiltinPlugin;
|
|
5
|
+
_args: [options?: any];
|
|
6
|
+
affectedHooks: "done" | "compilation" | "failed" | "environment" | "emit" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "shutdown" | "watchRun" | "watchClose" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
|
|
7
|
+
raw(compiler: import("../Compiler").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
8
8
|
apply(compiler: import("../Compiler").Compiler): void;
|
|
9
9
|
};
|
|
10
10
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BuiltinPluginName
|
|
1
|
+
import { BuiltinPluginName } from "@rspack/binding";
|
|
2
2
|
type MinifyCondition = string | RegExp;
|
|
3
3
|
type MinifyConditions = MinifyCondition | MinifyCondition[];
|
|
4
4
|
type ExtractCommentsCondition = boolean | RegExp;
|
|
@@ -203,9 +203,9 @@ export interface TerserManglePropertiesOptions {
|
|
|
203
203
|
export declare const SwcJsMinimizerRspackPlugin: {
|
|
204
204
|
new (options?: SwcJsMinimizerRspackPluginOptions | undefined): {
|
|
205
205
|
name: BuiltinPluginName;
|
|
206
|
-
|
|
207
|
-
affectedHooks: "
|
|
208
|
-
raw(): import("@rspack/binding").BuiltinPlugin;
|
|
206
|
+
_args: [options?: SwcJsMinimizerRspackPluginOptions | undefined];
|
|
207
|
+
affectedHooks: "done" | "compilation" | "failed" | "environment" | "emit" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "shutdown" | "watchRun" | "watchClose" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
|
|
208
|
+
raw(compiler: import("../Compiler").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
209
209
|
apply(compiler: import("../Compiler").Compiler): void;
|
|
210
210
|
};
|
|
211
211
|
};
|
|
@@ -2,9 +2,9 @@ import { BuiltinPluginName } from "@rspack/binding";
|
|
|
2
2
|
export declare const WarnCaseSensitiveModulesPlugin: {
|
|
3
3
|
new (): {
|
|
4
4
|
name: BuiltinPluginName;
|
|
5
|
-
|
|
6
|
-
affectedHooks: "
|
|
7
|
-
raw(): import("@rspack/binding").BuiltinPlugin;
|
|
5
|
+
_args: [];
|
|
6
|
+
affectedHooks: "done" | "compilation" | "failed" | "environment" | "emit" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "shutdown" | "watchRun" | "watchClose" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
|
|
7
|
+
raw(compiler: import("../Compiler").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
8
8
|
apply(compiler: import("../Compiler").Compiler): void;
|
|
9
9
|
};
|
|
10
10
|
};
|
|
@@ -2,9 +2,9 @@ import { BuiltinPluginName } from "@rspack/binding";
|
|
|
2
2
|
export declare const WebWorkerTemplatePlugin: {
|
|
3
3
|
new (): {
|
|
4
4
|
name: BuiltinPluginName;
|
|
5
|
-
|
|
6
|
-
affectedHooks: "
|
|
7
|
-
raw(): import("@rspack/binding").BuiltinPlugin;
|
|
5
|
+
_args: [];
|
|
6
|
+
affectedHooks: "done" | "compilation" | "failed" | "environment" | "emit" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "shutdown" | "watchRun" | "watchClose" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
|
|
7
|
+
raw(compiler: import("../Compiler").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
8
8
|
apply(compiler: import("../Compiler").Compiler): void;
|
|
9
9
|
};
|
|
10
10
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BuiltinPlugin, BuiltinPluginName } from "@rspack/binding";
|
|
2
|
-
import { Compiler } from "../Compiler";
|
|
3
|
-
import { ChunkLoading, OutputModule, WasmLoading, WorkerPublicPath } from "../config";
|
|
1
|
+
import { type BuiltinPlugin, BuiltinPluginName } from "@rspack/binding";
|
|
2
|
+
import type { Compiler } from "../Compiler";
|
|
3
|
+
import type { ChunkLoading, OutputModule, WasmLoading, WorkerPublicPath } from "../config";
|
|
4
4
|
import { RspackBuiltinPlugin } from "./base";
|
|
5
5
|
export declare class WorkerPlugin extends RspackBuiltinPlugin {
|
|
6
6
|
private chunkLoading;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as binding from "@rspack/binding";
|
|
2
|
-
import { Compiler, RspackPluginInstance } from "..";
|
|
1
|
+
import type * as binding from "@rspack/binding";
|
|
2
|
+
import type { Compiler, RspackPluginInstance } from "..";
|
|
3
3
|
type AffectedHooks = keyof Compiler["hooks"];
|
|
4
4
|
export declare const HOOKS_CAN_NOT_INHERENT_FROM_PARENT: string[];
|
|
5
5
|
export declare function canInherentFromParent(affectedHooks?: AffectedHooks): boolean;
|
|
@@ -10,12 +10,12 @@ export declare abstract class RspackBuiltinPlugin implements RspackPluginInstanc
|
|
|
10
10
|
apply(compiler: Compiler): void;
|
|
11
11
|
}
|
|
12
12
|
export declare function createBuiltinPlugin<R>(name: binding.BuiltinPluginName, options: R): binding.BuiltinPlugin;
|
|
13
|
-
export declare function create<T extends any[], R>(name: binding.BuiltinPluginName, resolve: (...args: T) => R, affectedHooks?: AffectedHooks): {
|
|
13
|
+
export declare function create<T extends any[], R>(name: binding.BuiltinPluginName, resolve: (this: Compiler, ...args: T) => R, affectedHooks?: AffectedHooks): {
|
|
14
14
|
new (...args: T): {
|
|
15
15
|
name: binding.BuiltinPluginName;
|
|
16
|
-
|
|
17
|
-
affectedHooks: "
|
|
18
|
-
raw(): binding.BuiltinPlugin;
|
|
16
|
+
_args: T;
|
|
17
|
+
affectedHooks: "done" | "compilation" | "failed" | "environment" | "emit" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "shutdown" | "watchRun" | "watchClose" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
|
|
18
|
+
raw(compiler: Compiler): binding.BuiltinPlugin;
|
|
19
19
|
apply(compiler: Compiler): void;
|
|
20
20
|
};
|
|
21
21
|
};
|
|
@@ -46,10 +46,10 @@ affectedHooks) {
|
|
|
46
46
|
super();
|
|
47
47
|
this.name = name;
|
|
48
48
|
this.affectedHooks = affectedHooks;
|
|
49
|
-
this.
|
|
49
|
+
this._args = args;
|
|
50
50
|
}
|
|
51
|
-
raw() {
|
|
52
|
-
return createBuiltinPlugin(name, this.
|
|
51
|
+
raw(compiler) {
|
|
52
|
+
return createBuiltinPlugin(name, resolve.apply(compiler, this._args));
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
// Make the plugin class name consistent with webpack
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RawCssExtractPluginOption } from "@rspack/binding";
|
|
2
|
-
import { Compiler } from "../..";
|
|
2
|
+
import type { Compiler } from "../..";
|
|
3
3
|
export * from "./loader";
|
|
4
4
|
export type { CssExtractRspackLoaderOptions } from "./loader";
|
|
5
5
|
export interface CssExtractRspackPluginOptions {
|
|
@@ -34,7 +34,12 @@ const loader = function loader(content) {
|
|
|
34
34
|
if (this._compiler &&
|
|
35
35
|
this._compiler.options &&
|
|
36
36
|
this._compiler.options.experiments &&
|
|
37
|
-
this._compiler.options.experiments.css
|
|
37
|
+
this._compiler.options.experiments.css &&
|
|
38
|
+
this._module &&
|
|
39
|
+
(this._module.type === "css" ||
|
|
40
|
+
this._module.type === "css/auto" ||
|
|
41
|
+
this._module.type === "css/global" ||
|
|
42
|
+
this._module.type === "css/module")) {
|
|
38
43
|
return content;
|
|
39
44
|
}
|
|
40
45
|
};
|
|
@@ -42,8 +47,13 @@ const pitch = function (request, _, data) {
|
|
|
42
47
|
if (this._compiler &&
|
|
43
48
|
this._compiler.options &&
|
|
44
49
|
this._compiler.options.experiments &&
|
|
45
|
-
this._compiler.options.experiments.css
|
|
46
|
-
|
|
50
|
+
this._compiler.options.experiments.css &&
|
|
51
|
+
this._module &&
|
|
52
|
+
(this._module.type === "css" ||
|
|
53
|
+
this._module.type === "css/auto" ||
|
|
54
|
+
this._module.type === "css/global" ||
|
|
55
|
+
this._module.type === "css/module")) {
|
|
56
|
+
let e = new Error(`use type 'css' and \`CssExtractRspackPlugin\` together, please set \`experiments.css\` to \`false\` or set \`{ type: "javascript/auto" }\` for rules with \`CssExtractRspackPlugin\` in your rspack config (now \`CssExtractRspackPlugin\` does nothing).`);
|
|
47
57
|
e.stack = undefined;
|
|
48
58
|
this.emitWarning(e);
|
|
49
59
|
return;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LoaderContext } from "../..";
|
|
1
|
+
import type { LoaderContext } from "../..";
|
|
2
2
|
export declare function isAbsolutePath(str: string): boolean;
|
|
3
3
|
export declare function isRelativePath(str: string): boolean;
|
|
4
4
|
export declare function stringifyRequest(loaderContext: LoaderContext, request: string): string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
export { RspackBuiltinPlugin } from "./base";
|
|
1
2
|
export * from "./APIPlugin";
|
|
2
3
|
export * from "./ArrayPushCallbackChunkFormatPlugin";
|
|
3
4
|
export * from "./AssetModulesPlugin";
|
|
4
5
|
export * from "./AsyncWebAssemblyModulesPlugin";
|
|
5
6
|
export * from "./BannerPlugin";
|
|
6
|
-
export { RspackBuiltinPlugin } from "./base";
|
|
7
7
|
export * from "./BundlerInfoRspackPlugin";
|
|
8
8
|
export * from "./ChunkPrefetchPreloadPlugin";
|
|
9
9
|
export * from "./CommonJsChunkFormatPlugin";
|
|
@@ -63,9 +63,3 @@ export * from "./WarnCaseSensitiveModulesPlugin";
|
|
|
63
63
|
export * from "./WebWorkerTemplatePlugin";
|
|
64
64
|
export * from "./WorkerPlugin";
|
|
65
65
|
export * from "./FetchCompileAsyncWasmPlugin";
|
|
66
|
-
import { RawBuiltins } from "@rspack/binding";
|
|
67
|
-
import { RspackOptionsNormalized } from "..";
|
|
68
|
-
export interface Builtins {
|
|
69
|
-
treeShaking?: boolean | "module";
|
|
70
|
-
}
|
|
71
|
-
export declare function deprecated_resolveBuiltins(builtins: Builtins, options: RspackOptionsNormalized): RawBuiltins;
|
|
@@ -14,14 +14,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
17
|
+
exports.RspackBuiltinPlugin = void 0;
|
|
18
|
+
var base_1 = require("./base");
|
|
19
|
+
Object.defineProperty(exports, "RspackBuiltinPlugin", { enumerable: true, get: function () { return base_1.RspackBuiltinPlugin; } });
|
|
18
20
|
__exportStar(require("./APIPlugin"), exports);
|
|
19
21
|
__exportStar(require("./ArrayPushCallbackChunkFormatPlugin"), exports);
|
|
20
22
|
__exportStar(require("./AssetModulesPlugin"), exports);
|
|
21
23
|
__exportStar(require("./AsyncWebAssemblyModulesPlugin"), exports);
|
|
22
24
|
__exportStar(require("./BannerPlugin"), exports);
|
|
23
|
-
var base_1 = require("./base");
|
|
24
|
-
Object.defineProperty(exports, "RspackBuiltinPlugin", { enumerable: true, get: function () { return base_1.RspackBuiltinPlugin; } });
|
|
25
25
|
__exportStar(require("./BundlerInfoRspackPlugin"), exports);
|
|
26
26
|
__exportStar(require("./ChunkPrefetchPreloadPlugin"), exports);
|
|
27
27
|
__exportStar(require("./CommonJsChunkFormatPlugin"), exports);
|
|
@@ -81,17 +81,3 @@ __exportStar(require("./WarnCaseSensitiveModulesPlugin"), exports);
|
|
|
81
81
|
__exportStar(require("./WebWorkerTemplatePlugin"), exports);
|
|
82
82
|
__exportStar(require("./WorkerPlugin"), exports);
|
|
83
83
|
__exportStar(require("./FetchCompileAsyncWasmPlugin"), exports);
|
|
84
|
-
function resolveTreeShaking(treeShaking, production) {
|
|
85
|
-
return treeShaking !== undefined
|
|
86
|
-
? treeShaking.toString()
|
|
87
|
-
: production
|
|
88
|
-
? "true"
|
|
89
|
-
: "false";
|
|
90
|
-
}
|
|
91
|
-
function deprecated_resolveBuiltins(builtins, options) {
|
|
92
|
-
const production = options.mode === "production" || !options.mode;
|
|
93
|
-
return {
|
|
94
|
-
treeShaking: resolveTreeShaking(builtins.treeShaking, production)
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
exports.deprecated_resolveBuiltins = deprecated_resolveBuiltins;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BuiltinPluginName, JsModule, RawRegex } from "@rspack/binding";
|
|
1
|
+
import { BuiltinPluginName, type JsModule, type RawRegex } from "@rspack/binding";
|
|
2
2
|
export declare const BuiltinLazyCompilationPlugin: {
|
|
3
3
|
new (module: (args: {
|
|
4
4
|
module: string;
|
|
@@ -9,22 +9,16 @@ export declare const BuiltinLazyCompilationPlugin: {
|
|
|
9
9
|
client: string;
|
|
10
10
|
}, cacheable: boolean, entries: boolean, imports: boolean, test?: RawRegex | ((m: JsModule) => boolean) | undefined): {
|
|
11
11
|
name: BuiltinPluginName;
|
|
12
|
-
|
|
13
|
-
module:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
imports: boolean;
|
|
23
|
-
entries: boolean;
|
|
24
|
-
test: RawRegex | ((m: JsModule) => boolean) | undefined;
|
|
25
|
-
};
|
|
26
|
-
affectedHooks: "make" | "compile" | "emit" | "afterEmit" | "invalid" | "done" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
|
|
27
|
-
raw(): import("@rspack/binding").BuiltinPlugin;
|
|
12
|
+
_args: [module: (args: {
|
|
13
|
+
module: string;
|
|
14
|
+
path: string;
|
|
15
|
+
}) => {
|
|
16
|
+
active: boolean;
|
|
17
|
+
data: string;
|
|
18
|
+
client: string;
|
|
19
|
+
}, cacheable: boolean, entries: boolean, imports: boolean, test?: RawRegex | ((m: JsModule) => boolean) | undefined];
|
|
20
|
+
affectedHooks: "done" | "compilation" | "failed" | "environment" | "emit" | "make" | "compile" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "shutdown" | "watchRun" | "watchClose" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
|
|
21
|
+
raw(compiler: import("../../Compiler").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
28
22
|
apply(compiler: import("../../Compiler").Compiler): void;
|
|
29
23
|
};
|
|
30
24
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { JsModule, RawRegex } from "@rspack/binding";
|
|
1
|
+
import type { JsModule, RawRegex } from "@rspack/binding";
|
|
2
2
|
import type { Compiler } from "../..";
|
|
3
|
-
import { LazyCompilationDefaultBackendOptions } from "./backend";
|
|
3
|
+
import { type LazyCompilationDefaultBackendOptions } from "./backend";
|
|
4
4
|
export default class LazyCompilationPlugin {
|
|
5
5
|
cacheable: boolean;
|
|
6
6
|
entries: boolean;
|
package/dist/config/adapter.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { RawLibraryOptions, RawOptions } from "@rspack/binding";
|
|
2
|
-
import { Compiler } from "../Compiler";
|
|
3
|
-
import { LoaderContext, LoaderDefinition, LoaderDefinitionFunction } from "./adapterRuleUse";
|
|
4
|
-
import { RspackOptionsNormalized } from "./normalization";
|
|
5
|
-
import { ChunkLoading, LibraryOptions } from "./zod";
|
|
2
|
+
import type { Compiler } from "../Compiler";
|
|
3
|
+
import { type LoaderContext, type LoaderDefinition, type LoaderDefinitionFunction } from "./adapterRuleUse";
|
|
4
|
+
import type { RspackOptionsNormalized } from "./normalization";
|
|
5
|
+
import { type ChunkLoading, type LibraryOptions, type Resolve } from "./zod";
|
|
6
6
|
export type { LoaderContext, LoaderDefinition, LoaderDefinitionFunction };
|
|
7
7
|
export declare const getRawOptions: (options: RspackOptionsNormalized, compiler: Compiler) => RawOptions;
|
|
8
|
+
export declare function getRawResolve(resolve: Resolve): RawOptions["resolve"];
|
|
8
9
|
export declare function getRawLibrary(library: LibraryOptions): RawLibraryOptions;
|
|
9
10
|
export declare function getRawChunkLoading(chunkLoading: ChunkLoading): string;
|
package/dist/config/adapter.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getRawChunkLoading = exports.getRawLibrary = exports.getRawOptions = void 0;
|
|
6
|
+
exports.getRawChunkLoading = exports.getRawLibrary = exports.getRawResolve = exports.getRawOptions = void 0;
|
|
7
7
|
const assert_1 = __importDefault(require("assert"));
|
|
8
8
|
const Stats_1 = require("../Stats");
|
|
9
9
|
const util_1 = require("../util");
|
|
@@ -106,6 +106,7 @@ function getRawResolve(resolve) {
|
|
|
106
106
|
byDependency: getRawResolveByDependency(resolve.byDependency)
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
|
+
exports.getRawResolve = getRawResolve;
|
|
109
110
|
function getRawCrossOriginLoading(crossOriginLoading) {
|
|
110
111
|
if (typeof crossOriginLoading === "boolean") {
|
|
111
112
|
return { type: "bool", boolPayload: crossOriginLoading };
|
|
@@ -325,7 +326,7 @@ const getRawModuleRule = (rule, path, options, upperType) => {
|
|
|
325
326
|
delete rawModuleRule.resource;
|
|
326
327
|
delete rawModuleRule.resourceQuery;
|
|
327
328
|
delete rawModuleRule.resourceFragment;
|
|
328
|
-
rawModuleRule.rspackResource = getRawRuleSetCondition(
|
|
329
|
+
rawModuleRule.rspackResource = getRawRuleSetCondition(resourceQueryFragment => {
|
|
329
330
|
const { path, query, fragment } = (0, identifier_1.parseResource)(resourceQueryFragment);
|
|
330
331
|
if (rule.test && !tryMatch(path, rule.test)) {
|
|
331
332
|
return false;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import type { JsAssetInfo, RawModuleRuleUse, RawOptions } from "@rspack/binding";
|
|
3
|
-
import { ResolveRequest } from "../../compiled/enhanced-resolve";
|
|
4
|
-
import { Compiler } from "../Compiler";
|
|
5
|
-
import { Logger } from "../logging/Logger";
|
|
3
|
+
import type { ResolveRequest } from "../../compiled/enhanced-resolve";
|
|
4
|
+
import type { Compiler } from "../Compiler";
|
|
5
|
+
import type { Logger } from "../logging/Logger";
|
|
6
6
|
import Hash = require("../util/hash");
|
|
7
|
-
import { Compilation } from "../Compilation";
|
|
8
|
-
import { Module } from "../Module";
|
|
9
|
-
import { LoaderObject } from "../loader-runner";
|
|
10
|
-
import { Mode, Resolve, RuleSetUseItem, Target } from "./zod";
|
|
7
|
+
import type { Compilation } from "../Compilation";
|
|
8
|
+
import type { Module } from "../Module";
|
|
9
|
+
import { type LoaderObject } from "../loader-runner";
|
|
10
|
+
import type { Mode, Resolve, RuleSetUseItem, Target } from "./zod";
|
|
11
11
|
export declare const BUILTIN_LOADER_PREFIX = "builtin:";
|
|
12
12
|
export interface ComposeJsUseOptions {
|
|
13
13
|
devtool: RawOptions["devtool"];
|
|
@@ -19,9 +19,6 @@ const getSwcLoaderOptions = (o, options) => {
|
|
|
19
19
|
if (expr.import || expr.pluginImport) {
|
|
20
20
|
expr.import = (0, builtin_loader_1.resolvePluginImport)(expr.import || expr.pluginImport);
|
|
21
21
|
}
|
|
22
|
-
if (expr.preact) {
|
|
23
|
-
expr.preact = (0, builtin_loader_1.resolvePreact)(expr.preact);
|
|
24
|
-
}
|
|
25
22
|
}
|
|
26
23
|
return o;
|
|
27
24
|
};
|
|
@@ -7,6 +7,6 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import { RspackOptionsNormalized } from "./normalization";
|
|
10
|
+
import type { RspackOptionsNormalized } from "./normalization";
|
|
11
11
|
export declare const applyRspackOptionsDefaults: (options: RspackOptionsNormalized) => void;
|
|
12
12
|
export declare const applyRspackOptionsBaseDefaults: (options: RspackOptionsNormalized) => void;
|