@rspack/core 1.4.0-beta.0 → 1.4.0-rc.0
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/README.md +1 -1
- package/dist/Module.d.ts +0 -1
- package/dist/MultiCompiler.d.ts +4 -1
- package/dist/MultiWatching.d.ts +1 -0
- package/dist/builtin-loader/swc/pluginImport.d.ts +4 -26
- package/dist/builtin-loader/swc/types.d.ts +149 -1992
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +2 -1
- package/dist/builtin-plugin/lazy-compilation/middleware.d.ts +3 -3
- package/dist/config/devServer.d.ts +1 -1
- package/dist/config/normalization.d.ts +3 -1
- package/dist/config/types.d.ts +21 -3
- package/dist/config/utils.d.ts +3 -17
- package/dist/config/zod.d.ts +687 -4492
- package/dist/exports.d.ts +5 -2
- package/dist/index.js +3926 -1289
- package/dist/swc.d.ts +2 -0
- package/dist/util/validate.d.ts +1 -1
- package/package.json +5 -5
- package/compiled/enhanced-resolve/CachedInputFileSystem.d.ts +0 -0
- package/compiled/enhanced-resolve/CachedInputFileSystem.js +0 -664
- package/compiled/enhanced-resolve/index.d.ts +0 -1124
- package/compiled/enhanced-resolve/license +0 -20
- package/compiled/enhanced-resolve/package.json +0 -1
- package/compiled/zod/dist/types/index.d.ts +0 -3
- package/compiled/zod/dist/types/v3/ZodError.d.ts +0 -164
- package/compiled/zod/dist/types/v3/benchmarks/datetime.d.ts +0 -5
- package/compiled/zod/dist/types/v3/benchmarks/discriminatedUnion.d.ts +0 -5
- package/compiled/zod/dist/types/v3/benchmarks/index.d.ts +0 -1
- package/compiled/zod/dist/types/v3/benchmarks/ipv4.d.ts +0 -5
- package/compiled/zod/dist/types/v3/benchmarks/object.d.ts +0 -5
- package/compiled/zod/dist/types/v3/benchmarks/primitives.d.ts +0 -5
- package/compiled/zod/dist/types/v3/benchmarks/realworld.d.ts +0 -5
- package/compiled/zod/dist/types/v3/benchmarks/string.d.ts +0 -5
- package/compiled/zod/dist/types/v3/benchmarks/union.d.ts +0 -5
- package/compiled/zod/dist/types/v3/errors.d.ts +0 -5
- package/compiled/zod/dist/types/v3/external.d.ts +0 -6
- package/compiled/zod/dist/types/v3/helpers/enumUtil.d.ts +0 -8
- package/compiled/zod/dist/types/v3/helpers/errorUtil.d.ts +0 -9
- package/compiled/zod/dist/types/v3/helpers/parseUtil.d.ts +0 -78
- package/compiled/zod/dist/types/v3/helpers/partialUtil.d.ts +0 -8
- package/compiled/zod/dist/types/v3/helpers/typeAliases.d.ts +0 -2
- package/compiled/zod/dist/types/v3/helpers/util.d.ts +0 -85
- package/compiled/zod/dist/types/v3/index.d.ts +0 -4
- package/compiled/zod/dist/types/v3/locales/en.d.ts +0 -3
- package/compiled/zod/dist/types/v3/standard-schema.d.ts +0 -102
- package/compiled/zod/dist/types/v3/tests/Mocker.d.ts +0 -17
- package/compiled/zod/dist/types/v3/types.d.ts +0 -1031
- package/compiled/zod/dist/types/v4/classic/checks.d.ts +0 -1
- package/compiled/zod/dist/types/v4/classic/coerce.d.ts +0 -17
- package/compiled/zod/dist/types/v4/classic/compat.d.ts +0 -48
- package/compiled/zod/dist/types/v4/classic/errors.d.ts +0 -30
- package/compiled/zod/dist/types/v4/classic/external.d.ts +0 -13
- package/compiled/zod/dist/types/v4/classic/index.d.ts +0 -4
- package/compiled/zod/dist/types/v4/classic/iso.d.ts +0 -22
- package/compiled/zod/dist/types/v4/classic/parse.d.ts +0 -23
- package/compiled/zod/dist/types/v4/classic/schemas.d.ts +0 -624
- package/compiled/zod/dist/types/v4/core/api.d.ts +0 -274
- package/compiled/zod/dist/types/v4/core/checks.d.ts +0 -277
- package/compiled/zod/dist/types/v4/core/config.d.ts +0 -9
- package/compiled/zod/dist/types/v4/core/core.d.ts +0 -47
- package/compiled/zod/dist/types/v4/core/doc.d.ts +0 -14
- package/compiled/zod/dist/types/v4/core/errors.d.ts +0 -204
- package/compiled/zod/dist/types/v4/core/function.d.ts +0 -52
- package/compiled/zod/dist/types/v4/core/index.d.ts +0 -15
- package/compiled/zod/dist/types/v4/core/json-schema.d.ts +0 -100
- package/compiled/zod/dist/types/v4/core/parse.d.ts +0 -25
- package/compiled/zod/dist/types/v4/core/regexes.d.ts +0 -62
- package/compiled/zod/dist/types/v4/core/registries.d.ts +0 -39
- package/compiled/zod/dist/types/v4/core/schemas.d.ts +0 -1005
- package/compiled/zod/dist/types/v4/core/standard-schema.d.ts +0 -55
- package/compiled/zod/dist/types/v4/core/to-json-schema.d.ts +0 -84
- package/compiled/zod/dist/types/v4/core/util.d.ts +0 -182
- package/compiled/zod/dist/types/v4/core/versions.d.ts +0 -5
- package/compiled/zod/dist/types/v4/core/zsf.d.ts +0 -91
- package/compiled/zod/dist/types/v4/index.d.ts +0 -3
- package/compiled/zod/dist/types/v4/locales/ar.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/az.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/be.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/ca.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/cs.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/de.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/en.d.ts +0 -5
- package/compiled/zod/dist/types/v4/locales/es.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/fa.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/fi.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/fr-CA.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/fr.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/he.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/hu.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/id.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/index.d.ts +0 -38
- package/compiled/zod/dist/types/v4/locales/it.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/ja.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/kh.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/ko.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/mk.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/ms.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/nl.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/no.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/ota.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/pl.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/ps.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/pt.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/ru.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/sl.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/sv.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/ta.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/th.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/tr.d.ts +0 -5
- package/compiled/zod/dist/types/v4/locales/ua.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/ur.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/vi.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/zh-CN.d.ts +0 -4
- package/compiled/zod/dist/types/v4/locales/zh-TW.d.ts +0 -4
- package/compiled/zod/dist/types/v4/mini/checks.d.ts +0 -1
- package/compiled/zod/dist/types/v4/mini/coerce.d.ts +0 -7
- package/compiled/zod/dist/types/v4/mini/external.d.ts +0 -11
- package/compiled/zod/dist/types/v4/mini/index.d.ts +0 -3
- package/compiled/zod/dist/types/v4/mini/iso.d.ts +0 -22
- package/compiled/zod/dist/types/v4/mini/parse.d.ts +0 -1
- package/compiled/zod/dist/types/v4/mini/schemas.d.ts +0 -350
- package/compiled/zod/index.js +0 -4513
- package/compiled/zod/license +0 -21
- package/compiled/zod/package.json +0 -1
- package/compiled/zod/v3/index.d.ts +0 -3
- package/compiled/zod/v4/core/index.d.ts +0 -1
- package/compiled/zod/v4/index.d.ts +0 -3
- package/compiled/zod/v4/locales/en.d.ts +0 -2
- package/compiled/zod/v4/locales/index.d.ts +0 -1
- package/compiled/zod/v4-mini/index.d.ts +0 -1
@@ -86,7 +86,8 @@ export interface JsFormatOptions {
|
|
86
86
|
*/
|
87
87
|
maxLineLen?: number | false;
|
88
88
|
/**
|
89
|
-
*
|
89
|
+
* When passed it must be a string and it will be prepended to the output literally.
|
90
|
+
* The source map will adjust for this text. Can be used to insert a comment containing licensing information.
|
90
91
|
*/
|
91
92
|
preamble?: string;
|
92
93
|
/**
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type
|
2
|
-
import type {
|
1
|
+
import { type Compiler, MultiCompiler } from "../..";
|
2
|
+
import type { MiddlewareHandler } from "../../config/devServer";
|
3
3
|
export declare const LAZY_COMPILATION_PREFIX = "/lazy-compilation-using-";
|
4
|
-
export declare const lazyCompilationMiddleware: (compiler: Compiler
|
4
|
+
export declare const lazyCompilationMiddleware: (compiler: Compiler | MultiCompiler) => MiddlewareHandler;
|
@@ -144,7 +144,7 @@ type DevMiddlewareContext<RequestInternal extends IncomingMessage = IncomingMess
|
|
144
144
|
outputFileSystem: OutputFileSystem;
|
145
145
|
};
|
146
146
|
type Server = any;
|
147
|
-
type MiddlewareHandler<RequestInternal extends Request = Request, ResponseInternal extends Response = Response> = (req: RequestInternal, res: ResponseInternal, next: NextFunction) => void | Promise<void>;
|
147
|
+
export type MiddlewareHandler<RequestInternal extends Request = Request, ResponseInternal extends Response = Response> = (req: RequestInternal, res: ResponseInternal, next: NextFunction) => void | Promise<void>;
|
148
148
|
type MiddlewareObject<RequestInternal extends Request = Request, ResponseInternal extends Response = Response> = {
|
149
149
|
name?: string;
|
150
150
|
path?: string;
|
@@ -9,7 +9,7 @@
|
|
9
9
|
*/
|
10
10
|
import type { Compilation } from "../Compilation";
|
11
11
|
import type { HttpUriPluginOptions } from "../builtin-plugin";
|
12
|
-
import type { Amd, AssetModuleFilename, Bail, CacheOptions, ChunkFilename, ChunkLoading, ChunkLoadingGlobal, Clean, Context, CrossOriginLoading, CssChunkFilename, CssFilename, Dependencies, DevServer, DevTool, DevtoolFallbackModuleFilenameTemplate, DevtoolModuleFilenameTemplate, DevtoolNamespace, EnabledLibraryTypes, EnabledWasmLoadingTypes, EntryDescription, Environment, Externals, ExternalsPresets, ExternalsType, Filename, GeneratorOptionsByModuleType, GlobalObject, HashDigest, HashDigestLength, HashFunction, HashSalt, HotUpdateChunkFilename, HotUpdateGlobal, HotUpdateMainFilename, Iife, ImportFunctionName, ImportMetaName, Incremental, InfrastructureLogging, LazyCompilationOptions, LibraryOptions, Loader, Mode, Name, NoParseOption, Node, Optimization, OutputModule, ParserOptionsByModuleType, Path, Performance, Plugins, Profile, PublicPath, Resolve, RspackFutureOptions, RspackOptions, RuleSetRules, ScriptType, SnapshotOptions, SourceMapFilename, StatsValue, StrictModuleErrorHandling, Target, TrustedTypes, UniqueName, WasmLoading, Watch, WatchOptions, WebassemblyModuleFilename, WorkerPublicPath } from "./types";
|
12
|
+
import type { Amd, AssetModuleFilename, Bail, CacheOptions, ChunkFilename, ChunkLoading, ChunkLoadingGlobal, Clean, Context, CrossOriginLoading, CssChunkFilename, CssFilename, Dependencies, DevServer, DevTool, DevtoolFallbackModuleFilenameTemplate, DevtoolModuleFilenameTemplate, DevtoolNamespace, EnabledLibraryTypes, EnabledWasmLoadingTypes, EntryDescription, Environment, Externals, ExternalsPresets, ExternalsType, Filename, GeneratorOptionsByModuleType, GlobalObject, HashDigest, HashDigestLength, HashFunction, HashSalt, HotUpdateChunkFilename, HotUpdateGlobal, HotUpdateMainFilename, Iife, ImportFunctionName, ImportMetaName, Incremental, InfrastructureLogging, JavascriptParserOptions, LazyCompilationOptions, LibraryOptions, Loader, Mode, Name, NoParseOption, Node, Optimization, OutputModule, ParserOptionsByModuleType, Path, Performance, Plugins, Profile, PublicPath, Resolve, RspackFutureOptions, RspackOptions, RuleSetRules, ScriptType, SnapshotOptions, SourceMapFilename, StatsValue, StrictModuleErrorHandling, Target, TrustedTypes, UniqueName, WasmLoading, Watch, WatchOptions, WebassemblyModuleFilename, WorkerPublicPath } from "./types";
|
13
13
|
export declare const getNormalizedRspackOptions: (config: RspackOptions) => RspackOptionsNormalized;
|
14
14
|
export type EntryDynamicNormalized = () => Promise<EntryStaticNormalized>;
|
15
15
|
export type EntryNormalized = EntryDynamicNormalized | EntryStaticNormalized;
|
@@ -107,6 +107,8 @@ export interface ExperimentsNormalized {
|
|
107
107
|
buildHttp?: HttpUriPluginOptions;
|
108
108
|
parallelLoader?: boolean;
|
109
109
|
useInputFileSystem?: false | RegExp[];
|
110
|
+
inlineConst?: boolean;
|
111
|
+
typeReexportsPresence?: JavascriptParserOptions["typeReexportsPresence"];
|
110
112
|
}
|
111
113
|
export type IgnoreWarningsNormalized = ((warning: Error, compilation: Compilation) => boolean)[];
|
112
114
|
export type OptimizationRuntimeChunkNormalized = false | {
|
package/dist/config/types.d.ts
CHANGED
@@ -216,7 +216,7 @@ export type HashDigest = string;
|
|
216
216
|
/** The prefix length of the hash digest to use. */
|
217
217
|
export type HashDigestLength = number;
|
218
218
|
/** The hashing algorithm to use. */
|
219
|
-
export type HashFunction = "md4" | "xxhash64";
|
219
|
+
export type HashFunction = "md4" | "xxhash64" | "sha256";
|
220
220
|
/** An optional salt to update the hash. */
|
221
221
|
export type HashSalt = string;
|
222
222
|
/** Configure how source maps are named. */
|
@@ -787,6 +787,10 @@ export type JavascriptParserOptions = {
|
|
787
787
|
requireDynamic?: boolean;
|
788
788
|
requireResolve?: boolean;
|
789
789
|
importDynamic?: boolean;
|
790
|
+
/** Inline const values in this module */
|
791
|
+
inlineConst?: boolean;
|
792
|
+
/** Whether to tolerant exportsPresence for type reexport */
|
793
|
+
typeReexportsPresence?: "no-tolerant" | "tolerant" | "tolerant-no-check";
|
790
794
|
};
|
791
795
|
export type JsonParserOptions = {
|
792
796
|
/**
|
@@ -960,7 +964,7 @@ export type ModuleOptions = {
|
|
960
964
|
/** Keep module mechanism of the matched modules as-is, such as module.exports, require, import. */
|
961
965
|
noParse?: NoParseOption;
|
962
966
|
};
|
963
|
-
type AllowTarget = "web" | "webworker" | "es3" | "es5" | "es2015" | "es2016" | "es2017" | "es2018" | "es2019" | "es2020" | "es2021" | "es2022" | "node" | "async-node" | `node${number}` | `async-node${number}` | `node${number}.${number}` | `async-node${number}.${number}` | "electron-main" | `electron${number}-main` | `electron${number}.${number}-main` | "electron-renderer" | `electron${number}-renderer` | `electron${number}.${number}-renderer` | "electron-preload" | `electron${number}-preload` | `electron${number}.${number}-preload` | "nwjs" | `nwjs${number}` | `nwjs${number}.${number}` | "node-webkit" | `node-webkit${number}` | `node-webkit${number}.${number}` | "browserslist" | `browserslist:${string}`;
|
967
|
+
type AllowTarget = "web" | "webworker" | "es3" | "es5" | "es2015" | "es2016" | "es2017" | "es2018" | "es2019" | "es2020" | "es2021" | "es2022" | "es2023" | "es2024" | "es2025" | "node" | "async-node" | `node${number}` | `async-node${number}` | `node${number}.${number}` | `async-node${number}.${number}` | "electron-main" | `electron${number}-main` | `electron${number}.${number}-main` | "electron-renderer" | `electron${number}-renderer` | `electron${number}.${number}-renderer` | "electron-preload" | `electron${number}-preload` | `electron${number}.${number}-preload` | "nwjs" | `nwjs${number}` | `nwjs${number}.${number}` | "node-webkit" | `node-webkit${number}` | `node-webkit${number}.${number}` | "browserslist" | `browserslist:${string}`;
|
964
968
|
/** Used to configure the target environment of Rspack output and the ECMAScript version of Rspack runtime code. */
|
965
969
|
export type Target = false | AllowTarget | AllowTarget[];
|
966
970
|
/**
|
@@ -1101,7 +1105,11 @@ export type InfrastructureLogging = {
|
|
1101
1105
|
/**
|
1102
1106
|
* Configuration used to control the behavior of the Source Map generation.
|
1103
1107
|
*/
|
1104
|
-
|
1108
|
+
type DevToolPosition = "inline-" | "hidden-" | "eval-" | "";
|
1109
|
+
type DevToolNoSources = "nosources-" | "";
|
1110
|
+
type DevToolCheap = "cheap-" | "cheap-module-" | "";
|
1111
|
+
type DevToolDebugIds = "-debugids" | "";
|
1112
|
+
export type DevTool = false | "eval" | `${DevToolPosition}${DevToolNoSources}${DevToolCheap}source-map${DevToolDebugIds}`;
|
1105
1113
|
/**
|
1106
1114
|
* Options for mocking Node.js globals and modules.
|
1107
1115
|
*/
|
@@ -2028,6 +2036,16 @@ export type Experiments = {
|
|
2028
2036
|
* @default false
|
2029
2037
|
*/
|
2030
2038
|
useInputFileSystem?: UseInputFileSystem;
|
2039
|
+
/**
|
2040
|
+
* Enable inline constants
|
2041
|
+
* @default false
|
2042
|
+
*/
|
2043
|
+
inlineConst?: boolean;
|
2044
|
+
/**
|
2045
|
+
* Enable inline constants
|
2046
|
+
* @default false
|
2047
|
+
*/
|
2048
|
+
typeReexportsPresence?: JavascriptParserOptions["typeReexportsPresence"];
|
2031
2049
|
};
|
2032
2050
|
export type Watch = boolean;
|
2033
2051
|
/** Options for watch mode. */
|
package/dist/config/utils.d.ts
CHANGED
@@ -1,17 +1,3 @@
|
|
1
|
-
import
|
2
|
-
|
3
|
-
export
|
4
|
-
patterns: Array<{
|
5
|
-
test: (root: RspackOptions, input: z.ParseInput) => boolean;
|
6
|
-
type: ZodType;
|
7
|
-
issue?: (res: ParseReturnType<any>, root: RspackOptions, input: z.ParseInput) => Array<IssueData>;
|
8
|
-
}>;
|
9
|
-
default: ZodType;
|
10
|
-
};
|
11
|
-
export declare class ZodRspackCrossChecker<T> extends ZodType<T> {
|
12
|
-
private params;
|
13
|
-
constructor(params: ZodCrossFieldsOptions);
|
14
|
-
_parse(input: z.ParseInput): z.ParseReturnType<T>;
|
15
|
-
_getRootData(ctx: z.ParseContext): any;
|
16
|
-
}
|
17
|
-
export declare const anyFunction: ZodType<(...args: unknown[]) => any, ZodTypeDef, (...args: unknown[]) => any>;
|
1
|
+
import * as z from "zod/v4";
|
2
|
+
export declare const numberOrInfinity: z.ZodUnion<[z.ZodNumber, z.ZodLiteral<number>]>;
|
3
|
+
export declare const anyFunction: z.ZodCustom<(...args: unknown[]) => any, (...args: unknown[]) => any>;
|