From 3dacd8129161b6ecdcfb736eda5875631109d889 Mon Sep 17 00:00:00 2001 From: jserfeng <1114550440@qq.com> Date: Tue, 24 Dec 2024 12:21:10 +0800 Subject: [PATCH] fix: importModule should receive error correctly --- crates/node_binding/binding.d.ts | 1 + .../src/compilation/mod.rs | 2 + .../execute-failed/import-loader-2.js | 7 + .../execute-failed/import-loader.js | 10 + .../execute-failed/index.js | 1 + .../execute-failed/rspack.config.js | 12 + packages/rspack/etc/core.api.md | 1340 ++++++++--------- packages/rspack/src/Compiler.ts | 112 +- packages/rspack/src/loader-runner/index.ts | 120 +- 9 files changed, 793 insertions(+), 812 deletions(-) create mode 100644 packages/rspack-test-tools/tests/configCases/loader-import-module/execute-failed/import-loader-2.js create mode 100644 packages/rspack-test-tools/tests/configCases/loader-import-module/execute-failed/import-loader.js create mode 100644 packages/rspack-test-tools/tests/configCases/loader-import-module/execute-failed/index.js create mode 100644 packages/rspack-test-tools/tests/configCases/loader-import-module/execute-failed/rspack.config.js diff --git a/crates/node_binding/binding.d.ts b/crates/node_binding/binding.d.ts index d6cc6d819448..180aebe44cd1 100644 --- a/crates/node_binding/binding.d.ts +++ b/crates/node_binding/binding.d.ts @@ -652,6 +652,7 @@ export interface JsExecuteModuleResult { cacheable: boolean assets: Array id: number + error?: string } export interface JsFactorizeArgs { diff --git a/crates/rspack_binding_values/src/compilation/mod.rs b/crates/rspack_binding_values/src/compilation/mod.rs index 1b879d92a6f6..466125b94c11 100644 --- a/crates/rspack_binding_values/src/compilation/mod.rs +++ b/crates/rspack_binding_values/src/compilation/mod.rs @@ -683,6 +683,7 @@ impl JsCompilation { .collect(), assets: res.assets.into_iter().collect(), id: res.id, + error: res.error, }; Ok(js_result) }) @@ -890,6 +891,7 @@ pub struct JsExecuteModuleResult { pub cacheable: bool, pub assets: Vec, pub id: u32, + pub error: Option, } #[napi(object)] diff --git a/packages/rspack-test-tools/tests/configCases/loader-import-module/execute-failed/import-loader-2.js b/packages/rspack-test-tools/tests/configCases/loader-import-module/execute-failed/import-loader-2.js new file mode 100644 index 000000000000..d1e55d9b39b4 --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/loader-import-module/execute-failed/import-loader-2.js @@ -0,0 +1,7 @@ +module.exports.pitch = function () { + const callback = this.async(); + this.importModule(`${this.resourcePath}.webpack[javascript/auto]!=!!!./index.js`, {}, err=> { + expect(err.message).toBe('Error: execute failed') + callback(null, `export default "${err}"`); + }) +} diff --git a/packages/rspack-test-tools/tests/configCases/loader-import-module/execute-failed/import-loader.js b/packages/rspack-test-tools/tests/configCases/loader-import-module/execute-failed/import-loader.js new file mode 100644 index 000000000000..a06864ca9ef7 --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/loader-import-module/execute-failed/import-loader.js @@ -0,0 +1,10 @@ +module.exports.pitch = function () { + const callback = this.async(); + this.importModule(`${this.resourcePath}.webpack[javascript/auto]!=!!!./index.js`, {}).then((_exports) => { + throw new Error("This should not be executed"); + }).catch((err) => { + expect(err.message).toBe('Error: execute failed') + // expect(err).toBe('execute failed') + callback(null, `export default "${err}"`); + }) +} diff --git a/packages/rspack-test-tools/tests/configCases/loader-import-module/execute-failed/index.js b/packages/rspack-test-tools/tests/configCases/loader-import-module/execute-failed/index.js new file mode 100644 index 000000000000..817e21531c45 --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/loader-import-module/execute-failed/index.js @@ -0,0 +1 @@ +throw new Error('execute failed') diff --git a/packages/rspack-test-tools/tests/configCases/loader-import-module/execute-failed/rspack.config.js b/packages/rspack-test-tools/tests/configCases/loader-import-module/execute-failed/rspack.config.js new file mode 100644 index 000000000000..cee29d7aa179 --- /dev/null +++ b/packages/rspack-test-tools/tests/configCases/loader-import-module/execute-failed/rspack.config.js @@ -0,0 +1,12 @@ +/** @type {import("@rspack/core").Configuration} */ +module.exports = { + entry: "./index.js", + module: { + rules: [ + { + test: /index\.js/, + use: ['./import-loader.js', './import-loader-2.js'], + }, + ] + }, +}; diff --git a/packages/rspack/etc/core.api.md b/packages/rspack/etc/core.api.md index 2da3b562f1a2..166be5fb40ce 100644 --- a/packages/rspack/etc/core.api.md +++ b/packages/rspack/etc/core.api.md @@ -47,10 +47,10 @@ import type { JsDependency } from '@rspack/binding'; import type { JsExportsInfo } from '@rspack/binding'; import type { JsFactoryMeta } from '@rspack/binding'; import { JsHtmlPluginTag } from '@rspack/binding'; +import { JsLibraryOptions } from '@rspack/binding'; import { JsLoaderItem } from '@rspack/binding'; import { JsModule } from '@rspack/binding'; import type { JsModuleGraph } from '@rspack/binding'; -import type { JsModuleGraphConnection } from '@rspack/binding'; import { JsRuntimeModule } from '@rspack/binding'; import type { JsStats } from '@rspack/binding'; import type { JsStatsCompilation } from '@rspack/binding'; @@ -153,9 +153,9 @@ interface AssetEmittedInfo { export type AssetGeneratorDataUrl = AssetGeneratorDataUrlOptions | AssetGeneratorDataUrlFunction; // @public (undocumented) -export type AssetGeneratorDataUrlFunction = (content: Buffer, context: { +export type AssetGeneratorDataUrlFunction = (options: { filename: string; - module: Module; + content: string; }) => string; // @public (undocumented) @@ -181,9 +181,6 @@ export type AssetInlineGeneratorOptions = { // @public export type AssetModuleFilename = Filename; -// @public -export type AssetModuleOutputPath = Filename; - // @public export type AssetParserDataUrl = AssetParserDataUrlOptions; @@ -201,7 +198,6 @@ export type AssetParserOptions = { export type AssetResourceGeneratorOptions = { emit?: boolean; filename?: Filename; - outputPath?: AssetModuleOutputPath; publicPath?: PublicPath; }; @@ -235,7 +231,7 @@ export const BannerPlugin: { new (args: BannerPluginArgument): { name: BuiltinPluginName; _args: [args: BannerPluginArgument]; - affectedHooks: "done" | "make" | "environment" | "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; + 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" | "additionalPass" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -597,8 +593,6 @@ export class Compilation { // @internal __internal_getInner(): binding.JsCompilation; // (undocumented) - addInclude(context: string, dependency: ReturnType, options: EntryOptions, callback: (err?: null | WebpackError_2, module?: Module) => void): void; - // (undocumented) addRuntimeModule(chunk: Chunk, runtimeModule: RuntimeModule): void; get assets(): Record; // (undocumented) @@ -1176,7 +1170,7 @@ export const ContextReplacementPlugin: { new (resourceRegExp: RegExp, newContentResource?: any, newContentRecursive?: any, newContentRegExp?: any): { name: BuiltinPluginName; _args: [resourceRegExp: RegExp, newContentResource?: any, newContentRecursive?: any, newContentRegExp?: any]; - affectedHooks: "done" | "make" | "environment" | "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; + 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" | "additionalPass" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -1187,7 +1181,7 @@ export const CopyRspackPlugin: { new (copy: CopyRspackPluginOptions): { name: BuiltinPluginName; _args: [copy: CopyRspackPluginOptions]; - affectedHooks: "done" | "make" | "environment" | "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; + 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" | "additionalPass" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -1319,7 +1313,7 @@ export const DefinePlugin: { new (define: DefinePluginOptions): { name: BuiltinPluginName; _args: [define: DefinePluginOptions]; - affectedHooks: "done" | "make" | "environment" | "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; + 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" | "additionalPass" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -1566,7 +1560,7 @@ const ElectronTargetPlugin: { new (context?: string | undefined): { name: BuiltinPluginName; _args: [context?: string | undefined]; - affectedHooks: "done" | "make" | "environment" | "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; + 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" | "additionalPass" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -1577,7 +1571,7 @@ const EnableChunkLoadingPlugin: { new (type: string): { name: BuiltinPluginName; _args: [type: string]; - affectedHooks: "done" | "make" | "environment" | "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; + 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" | "additionalPass" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -1610,7 +1604,7 @@ const EnableWasmLoadingPlugin: { new (type: string): { name: BuiltinPluginName; _args: [type: string]; - affectedHooks: "done" | "make" | "environment" | "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; + 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" | "additionalPass" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -1640,12 +1634,6 @@ class EntryData { options: binding.JsEntryOptions; } -// @public (undocumented) -interface EntryDependency { - // (undocumented) - request: string; -} - // @public export type EntryDependOn = string | string[]; @@ -1703,12 +1691,15 @@ export type EntryOptions = Omit & { name?: string; }; -// @public (undocumented) -export const EntryPlugin: EntryPluginType; - -// @public (undocumented) -type EntryPluginType = typeof OriginEntryPlugin & { - createDependency(entry: string): EntryDependency; +// @public +export const EntryPlugin: { + new (context: string, entry: string, options?: string | EntryOptions | undefined): { + name: BuiltinPluginName; + _args: [context: string, entry: string, options?: string | EntryOptions | undefined]; + 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" | "additionalPass" | undefined; + raw(compiler: Compiler_2): BuiltinPlugin; + apply(compiler: Compiler_2): void; + }; }; // @public (undocumented) @@ -1870,7 +1861,7 @@ export const EvalDevToolModulePlugin: { new (options: EvalDevToolModulePluginOptions): { name: BuiltinPluginName; _args: [options: EvalDevToolModulePluginOptions]; - affectedHooks: "done" | "make" | "environment" | "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; + 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" | "additionalPass" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -1883,7 +1874,7 @@ export const EvalSourceMapDevToolPlugin: { new (options: SourceMapDevToolPluginOptions): { name: BuiltinPluginName; _args: [options: SourceMapDevToolPluginOptions]; - affectedHooks: "done" | "make" | "environment" | "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; + 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" | "additionalPass" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -1938,7 +1929,7 @@ export type ExperimentCacheOptions = boolean | { unmanagedPaths?: Array; managedPaths?: Array; }; - storage?: { + storage: { type: "filesystem"; directory?: string; }; @@ -2131,7 +2122,7 @@ const FetchCompileAsyncWasmPlugin: { new (): { name: BuiltinPluginName; _args: []; - affectedHooks: "done" | "make" | "environment" | "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; + 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" | "additionalPass" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -2187,6 +2178,12 @@ type GetChildLogger = (name: string | (() => string)) => Logger; // @public (undocumented) export const getNormalizedRspackOptions: (config: RspackOptions) => RspackOptionsNormalized; +// @public (undocumented) +export function getRawChunkLoading(chunkLoading: ChunkLoading): string; + +// @public (undocumented) +export function getRawLibrary(library: LibraryOptions): JsLibraryOptions; + // @public (undocumented) export const getRawOptions: (options: RspackOptionsNormalized, compiler: Compiler) => RawOptions; @@ -2328,7 +2325,7 @@ const HtmlRspackPluginImpl: { new (c?: HtmlRspackPluginOptions | undefined): { name: BuiltinPluginName; _args: [c?: HtmlRspackPluginOptions | undefined]; - affectedHooks: "done" | "make" | "environment" | "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; + 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" | "additionalPass" | undefined; raw(compiler: Compiler): BuiltinPlugin; apply(compiler: Compiler): void; }; @@ -2391,7 +2388,7 @@ export const IgnorePlugin: { new (options: IgnorePluginOptions): { name: BuiltinPluginName; _args: [options: IgnorePluginOptions]; - affectedHooks: "done" | "make" | "environment" | "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; + 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" | "additionalPass" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -2420,13 +2417,6 @@ export type ImportFunctionName = string; // @public export type ImportMetaName = string; -// @public (undocumented) -interface ImportModuleOptions { - baseUri?: string; - layer?: string; - publicPath?: PublicPath; -} - // @public export type Incremental = { make?: boolean; @@ -3244,7 +3234,7 @@ export const LightningCssMinimizerRspackPlugin: { new (options?: LightningCssMinimizerRspackPluginOptions | undefined): { name: BuiltinPluginName; _args: [options?: LightningCssMinimizerRspackPluginOptions | undefined]; - affectedHooks: "done" | "make" | "environment" | "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; + 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" | "additionalPass" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -3281,7 +3271,7 @@ const LimitChunkCountPlugin: { new (options: LimitChunkCountOptions): { name: BuiltinPluginName; _args: [options: LimitChunkCountOptions]; - affectedHooks: "done" | "make" | "environment" | "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; + 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" | "additionalPass" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -3357,9 +3347,12 @@ export interface LoaderContext { getResolve(options: Resolve): ((context: string, request: string, callback: ResolveCallback) => void) | ((context: string, request: string) => Promise); // (undocumented) hot?: boolean; - importModule(request: string, options: ImportModuleOptions | undefined, callback: (err?: null | Error, exports?: T) => any): void; // (undocumented) - importModule(request: string, options?: ImportModuleOptions): Promise; + importModule(request: string, options: { + layer?: string; + publicPath?: PublicPath; + baseUri?: string; + }, callback: (err?: Error, res?: any) => void): void; // (undocumented) loaderIndex: number; loaders: LoaderObject[]; @@ -3759,29 +3752,11 @@ class ModuleGraph { // (undocumented) static __from_binding(binding: JsModuleGraph): ModuleGraph; // (undocumented) - getConnection(dependency: Dependency): ModuleGraphConnection | null; - // (undocumented) getExportsInfo(module: Module): ExportsInfo; // (undocumented) getIssuer(module: Module): Module | null; // (undocumented) getModule(dependency: Dependency): Module | null; - // (undocumented) - getOutgoingConnections(module: Module): ModuleGraphConnection[]; - // (undocumented) - getResolvedModule(dependency: Dependency): Module | null; -} - -// @public (undocumented) -class ModuleGraphConnection { - // (undocumented) - static __from_binding(binding: JsModuleGraphConnection): ModuleGraphConnection; - // (undocumented) - static __to_binding(data: ModuleGraphConnection): JsModuleGraphConnection; - // (undocumented) - readonly dependency: Dependency; - // (undocumented) - readonly module: Module | null; } // @public (undocumented) @@ -3957,7 +3932,7 @@ const NodeTargetPlugin: { new (): { name: BuiltinPluginName; _args: []; - affectedHooks: "done" | "make" | "environment" | "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; + 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" | "additionalPass" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -3980,7 +3955,7 @@ export const NoEmitOnErrorsPlugin: { new (): { name: BuiltinPluginName; _args: []; - affectedHooks: "done" | "make" | "environment" | "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; + 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" | "additionalPass" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -4147,7 +4122,7 @@ export type OptimizationSplitChunksCacheGroup = { test?: string | RegExp | ((module: Module) => unknown); priority?: number; enforce?: boolean; - filename?: Filename; + filename?: string; reuseExistingChunk?: boolean; type?: string | RegExp; idHint?: string; @@ -4204,17 +4179,6 @@ interface OptimizerConfig { simplify?: boolean; } -// @public -const OriginEntryPlugin: { - new (context: string, entry: string, options?: string | EntryOptions | undefined): { - name: BuiltinPluginName; - _args: [context: string, entry: string, options?: string | EntryOptions | undefined]; - affectedHooks: "done" | "make" | "environment" | "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; - raw(compiler: Compiler_2): BuiltinPlugin; - apply(compiler: Compiler_2): void; - }; -}; - // @public (undocumented) export type Output = { path?: Path; @@ -4600,7 +4564,7 @@ export const ProgressPlugin: { new (progress?: ProgressPluginArgument): { name: BuiltinPluginName; _args: [progress?: ProgressPluginArgument]; - affectedHooks: "done" | "make" | "environment" | "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; + 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" | "additionalPass" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -4614,7 +4578,7 @@ export const ProvidePlugin: { new (provide: ProvidePluginOptions): { name: BuiltinPluginName; _args: [provide: ProvidePluginOptions]; - affectedHooks: "done" | "make" | "environment" | "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; + 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" | "additionalPass" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -4919,7 +4883,7 @@ const RemoveDuplicateModulesPlugin: { new (): { name: BuiltinPluginName; _args: []; - affectedHooks: "done" | "make" | "environment" | "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; + 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" | "additionalPass" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -5212,6 +5176,8 @@ declare namespace rspackExports { LightningcssFeatureOptions, experiments, getRawResolve, + getRawLibrary, + getRawChunkLoading, LoaderContext, LoaderDefinition, LoaderDefinitionFunction, @@ -5334,7 +5300,6 @@ declare namespace rspackExports { AssetGeneratorDataUrlFunction, AssetGeneratorDataUrl, AssetInlineGeneratorOptions, - AssetModuleOutputPath, AssetResourceGeneratorOptions, AssetGeneratorOptions, CssGeneratorExportsConvention, @@ -6060,6 +6025,7 @@ export const rspackOptions: z.ZodObject<{ compareBeforeEmit: z.ZodOptional; }, "strict", z.ZodTypeAny, { module?: boolean | undefined; + path?: string | undefined; chunkLoading?: string | false | undefined; asyncChunks?: boolean | undefined; publicPath?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; @@ -6094,20 +6060,35 @@ export const rspackOptions: z.ZodObject<{ root?: string | undefined; } | undefined; umdNamedDefine?: boolean | undefined; - path?: string | undefined; + crossOriginLoading?: false | "anonymous" | "use-credentials" | undefined; + environment?: { + module?: boolean | undefined; + document?: boolean | undefined; + nodePrefixForCoreModules?: boolean | undefined; + globalThis?: boolean | undefined; + bigIntLiteral?: boolean | undefined; + const?: boolean | undefined; + arrowFunction?: boolean | undefined; + forOf?: boolean | undefined; + destructuring?: boolean | undefined; + dynamicImport?: boolean | undefined; + dynamicImportInWorker?: boolean | undefined; + optionalChaining?: boolean | undefined; + templateLiteral?: boolean | undefined; + asyncFunction?: boolean | undefined; + } | undefined; + chunkFilename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; + uniqueName?: string | undefined; pathinfo?: boolean | "verbose" | undefined; clean?: boolean | { keep?: string | undefined; } | undefined; - chunkFilename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; - crossOriginLoading?: false | "anonymous" | "use-credentials" | undefined; cssFilename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; cssChunkFilename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; hotUpdateMainFilename?: string | undefined; hotUpdateChunkFilename?: string | undefined; hotUpdateGlobal?: string | undefined; assetModuleFilename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; - uniqueName?: string | undefined; chunkLoadingGlobal?: string | undefined; enabledLibraryTypes?: string[] | undefined; strictModuleErrorHandling?: boolean | undefined; @@ -6135,22 +6116,6 @@ export const rspackOptions: z.ZodObject<{ devtoolNamespace?: string | undefined; devtoolModuleFilenameTemplate?: string | ((args_0: any) => any) | undefined; devtoolFallbackModuleFilenameTemplate?: string | ((args_0: any) => any) | undefined; - environment?: { - module?: boolean | undefined; - document?: boolean | undefined; - nodePrefixForCoreModules?: boolean | undefined; - globalThis?: boolean | undefined; - bigIntLiteral?: boolean | undefined; - const?: boolean | undefined; - arrowFunction?: boolean | undefined; - forOf?: boolean | undefined; - destructuring?: boolean | undefined; - dynamicImport?: boolean | undefined; - dynamicImportInWorker?: boolean | undefined; - optionalChaining?: boolean | undefined; - templateLiteral?: boolean | undefined; - asyncFunction?: boolean | undefined; - } | undefined; charset?: boolean | undefined; chunkLoadTimeout?: number | undefined; compareBeforeEmit?: boolean | undefined; @@ -6159,6 +6124,7 @@ export const rspackOptions: z.ZodObject<{ strictModuleExceptionHandling?: boolean | undefined; }, { module?: boolean | undefined; + path?: string | undefined; chunkLoading?: string | false | undefined; asyncChunks?: boolean | undefined; publicPath?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; @@ -6193,20 +6159,35 @@ export const rspackOptions: z.ZodObject<{ root?: string | undefined; } | undefined; umdNamedDefine?: boolean | undefined; - path?: string | undefined; + crossOriginLoading?: false | "anonymous" | "use-credentials" | undefined; + environment?: { + module?: boolean | undefined; + document?: boolean | undefined; + nodePrefixForCoreModules?: boolean | undefined; + globalThis?: boolean | undefined; + bigIntLiteral?: boolean | undefined; + const?: boolean | undefined; + arrowFunction?: boolean | undefined; + forOf?: boolean | undefined; + destructuring?: boolean | undefined; + dynamicImport?: boolean | undefined; + dynamicImportInWorker?: boolean | undefined; + optionalChaining?: boolean | undefined; + templateLiteral?: boolean | undefined; + asyncFunction?: boolean | undefined; + } | undefined; + chunkFilename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; + uniqueName?: string | undefined; pathinfo?: boolean | "verbose" | undefined; clean?: boolean | { keep?: string | undefined; } | undefined; - chunkFilename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; - crossOriginLoading?: false | "anonymous" | "use-credentials" | undefined; cssFilename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; cssChunkFilename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; hotUpdateMainFilename?: string | undefined; hotUpdateChunkFilename?: string | undefined; hotUpdateGlobal?: string | undefined; assetModuleFilename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; - uniqueName?: string | undefined; chunkLoadingGlobal?: string | undefined; enabledLibraryTypes?: string[] | undefined; strictModuleErrorHandling?: boolean | undefined; @@ -6234,22 +6215,6 @@ export const rspackOptions: z.ZodObject<{ devtoolNamespace?: string | undefined; devtoolModuleFilenameTemplate?: string | ((args_0: any) => any) | undefined; devtoolFallbackModuleFilenameTemplate?: string | ((args_0: any) => any) | undefined; - environment?: { - module?: boolean | undefined; - document?: boolean | undefined; - nodePrefixForCoreModules?: boolean | undefined; - globalThis?: boolean | undefined; - bigIntLiteral?: boolean | undefined; - const?: boolean | undefined; - arrowFunction?: boolean | undefined; - forOf?: boolean | undefined; - destructuring?: boolean | undefined; - dynamicImport?: boolean | undefined; - dynamicImportInWorker?: boolean | undefined; - optionalChaining?: boolean | undefined; - templateLiteral?: boolean | undefined; - asyncFunction?: boolean | undefined; - } | undefined; charset?: boolean | undefined; chunkLoadTimeout?: number | undefined; compareBeforeEmit?: boolean | undefined; @@ -6283,18 +6248,22 @@ export const rspackOptions: z.ZodObject<{ unmanagedPaths?: (string | RegExp)[] | undefined; managedPaths?: (string | RegExp)[] | undefined; }>>; - storage: z.ZodOptional; directory: z.ZodOptional; - }, "strip", z.ZodTypeAny, { + }, "strict", z.ZodTypeAny, { type: "filesystem"; directory?: string | undefined; }, { type: "filesystem"; directory?: string | undefined; - }>>; + }>; }, "strip", z.ZodTypeAny, { type: "persistent"; + storage: { + type: "filesystem"; + directory?: string | undefined; + }; version?: string | undefined; snapshot?: { immutablePaths?: (string | RegExp)[] | undefined; @@ -6302,12 +6271,12 @@ export const rspackOptions: z.ZodObject<{ managedPaths?: (string | RegExp)[] | undefined; } | undefined; buildDependencies?: string[] | undefined; - storage?: { - type: "filesystem"; - directory?: string | undefined; - } | undefined; }, { type: "persistent"; + storage: { + type: "filesystem"; + directory?: string | undefined; + }; version?: string | undefined; snapshot?: { immutablePaths?: (string | RegExp)[] | undefined; @@ -6315,10 +6284,6 @@ export const rspackOptions: z.ZodObject<{ managedPaths?: (string | RegExp)[] | undefined; } | undefined; buildDependencies?: string[] | undefined; - storage?: { - type: "filesystem"; - directory?: string | undefined; - } | undefined; }>]>]>; lazyCompilation: z.ZodUnion<[z.ZodOptional, z.ZodObject<{ backend: z.ZodOptional boolean) | undefined; - imports?: boolean | undefined; - backend?: { - client?: string | undefined; - listen?: number | { - path?: string | undefined; - port?: number | undefined; - host?: string | undefined; - backlog?: number | undefined; - exclusive?: boolean | undefined; - readableAll?: boolean | undefined; - writableAll?: boolean | undefined; - ipv6Only?: boolean | undefined; - } | undefined; - protocol?: "http" | "https" | undefined; - } | undefined; } | undefined; - asyncWebAssembly?: boolean | undefined; - outputModule?: boolean | undefined; topLevelAwait?: boolean | undefined; layers?: boolean | undefined; incremental?: boolean | { @@ -6555,7 +6499,6 @@ export const rspackOptions: z.ZodObject<{ chunksRender?: boolean | undefined; emitAssets?: boolean | undefined; } | undefined; - futureDefaults?: boolean | undefined; rspackFuture?: { bundlerInfo?: { version?: string | undefined; @@ -6563,24 +6506,9 @@ export const rspackOptions: z.ZodObject<{ bundler?: string | undefined; } | undefined; } | undefined; - }, { - css?: boolean | undefined; - cache?: boolean | { - type: "memory"; - } | { - type: "persistent"; - version?: string | undefined; - snapshot?: { - immutablePaths?: (string | RegExp)[] | undefined; - unmanagedPaths?: (string | RegExp)[] | undefined; - managedPaths?: (string | RegExp)[] | undefined; - } | undefined; - buildDependencies?: string[] | undefined; - storage?: { - type: "filesystem"; - directory?: string | undefined; - } | undefined; - } | undefined; + asyncWebAssembly?: boolean | undefined; + outputModule?: boolean | undefined; + futureDefaults?: boolean | undefined; lazyCompilation?: boolean | { entries?: boolean | undefined; test?: RegExp | ((args_0: Module, ...args: unknown[]) => boolean) | undefined; @@ -6600,8 +6528,24 @@ export const rspackOptions: z.ZodObject<{ protocol?: "http" | "https" | undefined; } | undefined; } | undefined; - asyncWebAssembly?: boolean | undefined; - outputModule?: boolean | undefined; + }, { + css?: boolean | undefined; + cache?: boolean | { + type: "memory"; + } | { + type: "persistent"; + storage: { + type: "filesystem"; + directory?: string | undefined; + }; + version?: string | undefined; + snapshot?: { + immutablePaths?: (string | RegExp)[] | undefined; + unmanagedPaths?: (string | RegExp)[] | undefined; + managedPaths?: (string | RegExp)[] | undefined; + } | undefined; + buildDependencies?: string[] | undefined; + } | undefined; topLevelAwait?: boolean | undefined; layers?: boolean | undefined; incremental?: boolean | { @@ -6620,7 +6564,6 @@ export const rspackOptions: z.ZodObject<{ chunksRender?: boolean | undefined; emitAssets?: boolean | undefined; } | undefined; - futureDefaults?: boolean | undefined; rspackFuture?: { bundlerInfo?: { version?: string | undefined; @@ -6628,6 +6571,28 @@ export const rspackOptions: z.ZodObject<{ bundler?: string | undefined; } | undefined; } | undefined; + asyncWebAssembly?: boolean | undefined; + outputModule?: boolean | undefined; + futureDefaults?: boolean | undefined; + lazyCompilation?: boolean | { + entries?: boolean | undefined; + test?: RegExp | ((args_0: Module, ...args: unknown[]) => boolean) | undefined; + imports?: boolean | undefined; + backend?: { + client?: string | undefined; + listen?: number | { + path?: string | undefined; + port?: number | undefined; + host?: string | undefined; + backlog?: number | undefined; + exclusive?: boolean | undefined; + readableAll?: boolean | undefined; + writableAll?: boolean | undefined; + ipv6Only?: boolean | undefined; + } | undefined; + protocol?: "http" | "https" | undefined; + } | undefined; + } | undefined; }>>; externals: z.ZodOptional]>, z.ZodRecord, z.ZodArray]>, ZodRspackCrossChecker]>>]>, z.ZodFunction, z.ZodFunction>, z.ZodOptional, z.ZodArray]>, ZodRspackCrossChecker]>>, z.ZodOptional>], z.ZodUnknown>, z.ZodVoid>], z.ZodUnknown>, z.ZodUnknown>]>, z.ZodFunction], z.ZodUnknown>, z.ZodPromise, z.ZodArray]>, ZodRspackCrossChecker]>>>]>, "many">, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType]>, z.ZodRecord, z.ZodArray]>, ZodRspackCrossChecker]>>]>, z.ZodFunction, z.ZodFunction>, z.ZodOptional, z.ZodArray]>, ZodRspackCrossChecker]>>, z.ZodOptional>], z.ZodUnknown>, z.ZodVoid>], z.ZodUnknown>, z.ZodUnknown>]>, z.ZodFunction], z.ZodUnknown>, z.ZodPromise, z.ZodArray]>, ZodRspackCrossChecker]>>>]>]>>; externalsType: z.ZodOptional>; @@ -6987,14 +6952,14 @@ export const rspackOptions: z.ZodObject<{ test: z.ZodOptional]>, z.ZodFunction], z.ZodUnknown>, z.ZodUnknown>]>>; priority: z.ZodOptional; enforce: z.ZodOptional; - filename: z.ZodOptional, z.ZodOptional>], z.ZodUnknown>, z.ZodString>]>>; + filename: z.ZodOptional; reuseExistingChunk: z.ZodOptional; type: z.ZodOptional]>>; idHint: z.ZodOptional; }, "strict", z.ZodTypeAny, { name?: string | false | ((args_0: Module | undefined, ...args: unknown[]) => unknown) | undefined; - filename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; type?: string | RegExp | undefined; + filename?: string | undefined; chunks?: RegExp | "initial" | "async" | "all" | ((args_0: Chunk, ...args: unknown[]) => boolean) | undefined; usedExports?: boolean | undefined; defaultSizeTypes?: string[] | undefined; @@ -7013,8 +6978,8 @@ export const rspackOptions: z.ZodObject<{ idHint?: string | undefined; }, { name?: string | false | ((args_0: Module | undefined, ...args: unknown[]) => unknown) | undefined; - filename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; type?: string | RegExp | undefined; + filename?: string | undefined; chunks?: RegExp | "initial" | "async" | "all" | ((args_0: Chunk, ...args: unknown[]) => boolean) | undefined; usedExports?: boolean | undefined; defaultSizeTypes?: string[] | undefined; @@ -7062,8 +7027,8 @@ export const rspackOptions: z.ZodObject<{ defaultSizeTypes?: string[] | undefined; cacheGroups?: Record unknown) | undefined; - filename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; type?: string | RegExp | undefined; + filename?: string | undefined; chunks?: RegExp | "initial" | "async" | "all" | ((args_0: Chunk, ...args: unknown[]) => boolean) | undefined; usedExports?: boolean | undefined; defaultSizeTypes?: string[] | undefined; @@ -7105,8 +7070,8 @@ export const rspackOptions: z.ZodObject<{ defaultSizeTypes?: string[] | undefined; cacheGroups?: Record unknown) | undefined; - filename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; type?: string | RegExp | undefined; + filename?: string | undefined; chunks?: RegExp | "initial" | "async" | "all" | ((args_0: Chunk, ...args: unknown[]) => boolean) | undefined; usedExports?: boolean | undefined; defaultSizeTypes?: string[] | undefined; @@ -7173,11 +7138,6 @@ export const rspackOptions: z.ZodObject<{ }, "strict", z.ZodTypeAny, { usedExports?: boolean | "global" | undefined; providedExports?: boolean | undefined; - moduleIds?: "named" | "natural" | "deterministic" | undefined; - chunkIds?: "named" | "natural" | "deterministic" | "size" | "total-size" | undefined; - minimize?: boolean | undefined; - minimizer?: (false | "" | 0 | "..." | t.RspackPluginInstance | t.WebpackPluginInstance | t.RspackPluginFunction | t.WebpackPluginFunction | null | undefined)[] | undefined; - mergeDuplicateChunks?: boolean | undefined; splitChunks?: false | { name?: string | false | ((args_0: Module | undefined, ...args: unknown[]) => unknown) | undefined; chunks?: RegExp | "initial" | "async" | "all" | ((args_0: Chunk, ...args: unknown[]) => boolean) | undefined; @@ -7185,8 +7145,8 @@ export const rspackOptions: z.ZodObject<{ defaultSizeTypes?: string[] | undefined; cacheGroups?: Record unknown) | undefined; - filename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; type?: string | RegExp | undefined; + filename?: string | undefined; chunks?: RegExp | "initial" | "async" | "all" | ((args_0: Chunk, ...args: unknown[]) => boolean) | undefined; usedExports?: boolean | undefined; defaultSizeTypes?: string[] | undefined; @@ -7222,12 +7182,17 @@ export const rspackOptions: z.ZodObject<{ maxInitialRequests?: number | undefined; automaticNameDelimiter?: string | undefined; } | undefined; + moduleIds?: "named" | "natural" | "deterministic" | undefined; + chunkIds?: "named" | "natural" | "deterministic" | "size" | "total-size" | undefined; + removeAvailableModules?: boolean | undefined; + minimize?: boolean | undefined; + minimizer?: (false | "" | 0 | "..." | t.RspackPluginInstance | t.WebpackPluginInstance | t.RspackPluginFunction | t.WebpackPluginFunction | null | undefined)[] | undefined; + mergeDuplicateChunks?: boolean | undefined; runtimeChunk?: boolean | "single" | "multiple" | { name?: string | ((args_0: { name: string; }, ...args: unknown[]) => string) | undefined; } | undefined; - removeAvailableModules?: boolean | undefined; removeEmptyChunks?: boolean | undefined; realContentHash?: boolean | undefined; sideEffects?: boolean | "flag" | undefined; @@ -7239,11 +7204,6 @@ export const rspackOptions: z.ZodObject<{ }, { usedExports?: boolean | "global" | undefined; providedExports?: boolean | undefined; - moduleIds?: "named" | "natural" | "deterministic" | undefined; - chunkIds?: "named" | "natural" | "deterministic" | "size" | "total-size" | undefined; - minimize?: boolean | undefined; - minimizer?: (false | "" | 0 | "..." | t.RspackPluginInstance | t.WebpackPluginInstance | t.RspackPluginFunction | t.WebpackPluginFunction | null | undefined)[] | undefined; - mergeDuplicateChunks?: boolean | undefined; splitChunks?: false | { name?: string | false | ((args_0: Module | undefined, ...args: unknown[]) => unknown) | undefined; chunks?: RegExp | "initial" | "async" | "all" | ((args_0: Chunk, ...args: unknown[]) => boolean) | undefined; @@ -7251,8 +7211,8 @@ export const rspackOptions: z.ZodObject<{ defaultSizeTypes?: string[] | undefined; cacheGroups?: Record unknown) | undefined; - filename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; type?: string | RegExp | undefined; + filename?: string | undefined; chunks?: RegExp | "initial" | "async" | "all" | ((args_0: Chunk, ...args: unknown[]) => boolean) | undefined; usedExports?: boolean | undefined; defaultSizeTypes?: string[] | undefined; @@ -7288,12 +7248,17 @@ export const rspackOptions: z.ZodObject<{ maxInitialRequests?: number | undefined; automaticNameDelimiter?: string | undefined; } | undefined; - runtimeChunk?: boolean | "single" | "multiple" | { + moduleIds?: "named" | "natural" | "deterministic" | undefined; + chunkIds?: "named" | "natural" | "deterministic" | "size" | "total-size" | undefined; + removeAvailableModules?: boolean | undefined; + minimize?: boolean | undefined; + minimizer?: (false | "" | 0 | "..." | t.RspackPluginInstance | t.WebpackPluginInstance | t.RspackPluginFunction | t.WebpackPluginFunction | null | undefined)[] | undefined; + mergeDuplicateChunks?: boolean | undefined; + runtimeChunk?: boolean | "single" | "multiple" | { name?: string | ((args_0: { name: string; }, ...args: unknown[]) => string) | undefined; } | undefined; - removeAvailableModules?: boolean | undefined; removeEmptyChunks?: boolean | undefined; realContentHash?: boolean | undefined; sideEffects?: boolean | "flag" | undefined; @@ -7803,14 +7768,14 @@ export const rspackOptions: z.ZodObject<{ }, { encoding?: false | "base64" | undefined; mimetype?: string | undefined; - }>, z.ZodFunction, z.ZodObject<{ + }>, z.ZodFunction; }, "strict", z.ZodTypeAny, { - module: Module; + content: string; filename: string; }, { - module: Module; + content: string; filename: string; }>], z.ZodUnknown>, z.ZodString>]>>; }, { @@ -7823,8 +7788,8 @@ export const rspackOptions: z.ZodObject<{ dataUrl?: { encoding?: false | "base64" | undefined; mimetype?: string | undefined; - } | ((args_0: Buffer, args_1: { - module: Module; + } | ((args_0: { + content: string; filename: string; }, ...args: unknown[]) => string) | undefined; emit?: boolean | undefined; @@ -7834,8 +7799,8 @@ export const rspackOptions: z.ZodObject<{ dataUrl?: { encoding?: false | "base64" | undefined; mimetype?: string | undefined; - } | ((args_0: Buffer, args_1: { - module: Module; + } | ((args_0: { + content: string; filename: string; }, ...args: unknown[]) => string) | undefined; emit?: boolean | undefined; @@ -7850,30 +7815,30 @@ export const rspackOptions: z.ZodObject<{ }, { encoding?: false | "base64" | undefined; mimetype?: string | undefined; - }>, z.ZodFunction, z.ZodObject<{ + }>, z.ZodFunction; }, "strict", z.ZodTypeAny, { - module: Module; + content: string; filename: string; }, { - module: Module; + content: string; filename: string; }>], z.ZodUnknown>, z.ZodString>]>>; }, "strict", z.ZodTypeAny, { dataUrl?: { encoding?: false | "base64" | undefined; mimetype?: string | undefined; - } | ((args_0: Buffer, args_1: { - module: Module; + } | ((args_0: { + content: string; filename: string; }, ...args: unknown[]) => string) | undefined; }, { dataUrl?: { encoding?: false | "base64" | undefined; mimetype?: string | undefined; - } | ((args_0: Buffer, args_1: { - module: Module; + } | ((args_0: { + content: string; filename: string; }, ...args: unknown[]) => string) | undefined; }>>; @@ -7943,8 +7908,8 @@ export const rspackOptions: z.ZodObject<{ dataUrl?: { encoding?: false | "base64" | undefined; mimetype?: string | undefined; - } | ((args_0: Buffer, args_1: { - module: Module; + } | ((args_0: { + content: string; filename: string; }, ...args: unknown[]) => string) | undefined; emit?: boolean | undefined; @@ -7965,8 +7930,8 @@ export const rspackOptions: z.ZodObject<{ dataUrl?: { encoding?: false | "base64" | undefined; mimetype?: string | undefined; - } | ((args_0: Buffer, args_1: { - module: Module; + } | ((args_0: { + content: string; filename: string; }, ...args: unknown[]) => string) | undefined; } | undefined; @@ -7986,8 +7951,8 @@ export const rspackOptions: z.ZodObject<{ dataUrl?: { encoding?: false | "base64" | undefined; mimetype?: string | undefined; - } | ((args_0: Buffer, args_1: { - module: Module; + } | ((args_0: { + content: string; filename: string; }, ...args: unknown[]) => string) | undefined; emit?: boolean | undefined; @@ -8008,8 +7973,8 @@ export const rspackOptions: z.ZodObject<{ dataUrl?: { encoding?: false | "base64" | undefined; mimetype?: string | undefined; - } | ((args_0: Buffer, args_1: { - module: Module; + } | ((args_0: { + content: string; filename: string; }, ...args: unknown[]) => string) | undefined; } | undefined; @@ -8134,8 +8099,8 @@ export const rspackOptions: z.ZodObject<{ dataUrl?: { encoding?: false | "base64" | undefined; mimetype?: string | undefined; - } | ((args_0: Buffer, args_1: { - module: Module; + } | ((args_0: { + content: string; filename: string; }, ...args: unknown[]) => string) | undefined; emit?: boolean | undefined; @@ -8156,8 +8121,8 @@ export const rspackOptions: z.ZodObject<{ dataUrl?: { encoding?: false | "base64" | undefined; mimetype?: string | undefined; - } | ((args_0: Buffer, args_1: { - module: Module; + } | ((args_0: { + content: string; filename: string; }, ...args: unknown[]) => string) | undefined; } | undefined; @@ -8282,8 +8247,8 @@ export const rspackOptions: z.ZodObject<{ dataUrl?: { encoding?: false | "base64" | undefined; mimetype?: string | undefined; - } | ((args_0: Buffer, args_1: { - module: Module; + } | ((args_0: { + content: string; filename: string; }, ...args: unknown[]) => string) | undefined; emit?: boolean | undefined; @@ -8304,8 +8269,8 @@ export const rspackOptions: z.ZodObject<{ dataUrl?: { encoding?: false | "base64" | undefined; mimetype?: string | undefined; - } | ((args_0: Buffer, args_1: { - module: Module; + } | ((args_0: { + content: string; filename: string; }, ...args: unknown[]) => string) | undefined; } | undefined; @@ -8451,8 +8416,8 @@ export const rspackOptions: z.ZodObject<{ dataUrl?: { encoding?: false | "base64" | undefined; mimetype?: string | undefined; - } | ((args_0: Buffer, args_1: { - module: Module; + } | ((args_0: { + content: string; filename: string; }, ...args: unknown[]) => string) | undefined; emit?: boolean | undefined; @@ -8473,8 +8438,8 @@ export const rspackOptions: z.ZodObject<{ dataUrl?: { encoding?: false | "base64" | undefined; mimetype?: string | undefined; - } | ((args_0: Buffer, args_1: { - module: Module; + } | ((args_0: { + content: string; filename: string; }, ...args: unknown[]) => string) | undefined; } | undefined; @@ -8495,12 +8460,7 @@ export const rspackOptions: z.ZodObject<{ __dirname?: boolean | "warn-mock" | "mock" | "eval-only" | "node-module" | undefined; __filename?: boolean | "warn-mock" | "mock" | "eval-only" | "node-module" | undefined; } | undefined; - performance?: false | { - maxAssetSize?: number | undefined; - assetFilter?: ((args_0: string, ...args: unknown[]) => boolean) | undefined; - hints?: false | "error" | "warning" | undefined; - maxEntrypointSize?: number | undefined; - } | undefined; + 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; context?: string | undefined; mode?: "development" | "production" | "none" | undefined; experiments?: { @@ -8509,6 +8469,10 @@ export const rspackOptions: z.ZodObject<{ type: "memory"; } | { type: "persistent"; + storage: { + type: "filesystem"; + directory?: string | undefined; + }; version?: string | undefined; snapshot?: { immutablePaths?: (string | RegExp)[] | undefined; @@ -8516,32 +8480,7 @@ export const rspackOptions: z.ZodObject<{ managedPaths?: (string | RegExp)[] | undefined; } | undefined; buildDependencies?: string[] | undefined; - storage?: { - type: "filesystem"; - directory?: string | undefined; - } | undefined; - } | undefined; - lazyCompilation?: boolean | { - entries?: boolean | undefined; - test?: RegExp | ((args_0: Module, ...args: unknown[]) => boolean) | undefined; - imports?: boolean | undefined; - backend?: { - client?: string | undefined; - listen?: number | { - path?: string | undefined; - port?: number | undefined; - host?: string | undefined; - backlog?: number | undefined; - exclusive?: boolean | undefined; - readableAll?: boolean | undefined; - writableAll?: boolean | undefined; - ipv6Only?: boolean | undefined; - } | undefined; - protocol?: "http" | "https" | undefined; - } | undefined; } | undefined; - asyncWebAssembly?: boolean | undefined; - outputModule?: boolean | undefined; topLevelAwait?: boolean | undefined; layers?: boolean | undefined; incremental?: boolean | { @@ -8560,7 +8499,6 @@ export const rspackOptions: z.ZodObject<{ chunksRender?: boolean | undefined; emitAssets?: boolean | undefined; } | undefined; - futureDefaults?: boolean | undefined; rspackFuture?: { bundlerInfo?: { version?: string | undefined; @@ -8568,9 +8506,205 @@ export const rspackOptions: z.ZodObject<{ bundler?: string | undefined; } | undefined; } | undefined; + asyncWebAssembly?: boolean | undefined; + outputModule?: boolean | undefined; + futureDefaults?: boolean | undefined; + lazyCompilation?: boolean | { + entries?: boolean | undefined; + test?: RegExp | ((args_0: Module, ...args: unknown[]) => boolean) | undefined; + imports?: boolean | undefined; + backend?: { + client?: string | undefined; + listen?: number | { + path?: string | undefined; + port?: number | undefined; + host?: string | undefined; + backlog?: number | undefined; + exclusive?: boolean | undefined; + readableAll?: boolean | undefined; + writableAll?: boolean | undefined; + ipv6Only?: boolean | undefined; + } | undefined; + protocol?: "http" | "https" | undefined; + } | undefined; + } | undefined; } | undefined; - 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; + performance?: false | { + maxAssetSize?: number | undefined; + assetFilter?: ((args_0: string, ...args: unknown[]) => boolean) | undefined; + hints?: false | "error" | "warning" | undefined; + maxEntrypointSize?: number | undefined; + } | undefined; + target?: false | "async-node" | `node${number}` | `async-node${number}` | `node${number}.${number}` | `async-node${number}.${number}` | `electron${number}-main` | `electron${number}.${number}-main` | `electron${number}-renderer` | `electron${number}.${number}-renderer` | `electron${number}-preload` | `electron${number}.${number}-preload` | `nwjs${number}` | `nwjs${number}.${number}` | `node-webkit${number}` | `node-webkit${number}.${number}` | `browserslist:${string}` | "web" | "webworker" | "es3" | "es5" | "es2015" | "es2016" | "es2017" | "es2018" | "es2019" | "es2020" | "es2021" | "es2022" | "node" | "electron-main" | "electron-renderer" | "electron-preload" | "nwjs" | "node-webkit" | "browserslist" | ("async-node" | `node${number}` | `async-node${number}` | `node${number}.${number}` | `async-node${number}.${number}` | `electron${number}-main` | `electron${number}.${number}-main` | `electron${number}-renderer` | `electron${number}.${number}-renderer` | `electron${number}-preload` | `electron${number}.${number}-preload` | `nwjs${number}` | `nwjs${number}.${number}` | `node-webkit${number}` | `node-webkit${number}.${number}` | `browserslist:${string}` | "web" | "webworker" | "es3" | "es5" | "es2015" | "es2016" | "es2017" | "es2018" | "es2019" | "es2020" | "es2021" | "es2022" | "node" | "electron-main" | "electron-renderer" | "electron-preload" | "nwjs" | "node-webkit" | "browserslist")[] | undefined; resolve?: t.ResolveOptions | undefined; + output?: { + module?: boolean | undefined; + path?: string | undefined; + chunkLoading?: string | false | undefined; + asyncChunks?: boolean | undefined; + publicPath?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; + filename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; + library?: string | string[] | { + commonjs?: string | undefined; + amd?: string | undefined; + root?: string | string[] | undefined; + } | { + type: string; + name?: string | string[] | { + commonjs?: string | undefined; + amd?: string | undefined; + root?: string | string[] | undefined; + } | undefined; + amdContainer?: string | undefined; + auxiliaryComment?: string | { + commonjs?: string | undefined; + commonjs2?: string | undefined; + amd?: string | undefined; + root?: string | undefined; + } | undefined; + export?: string | string[] | undefined; + umdNamedDefine?: boolean | undefined; + } | undefined; + wasmLoading?: string | false | undefined; + cssHeadDataCompression?: boolean | undefined; + auxiliaryComment?: string | { + commonjs?: string | undefined; + commonjs2?: string | undefined; + amd?: string | undefined; + root?: string | undefined; + } | undefined; + umdNamedDefine?: boolean | undefined; + crossOriginLoading?: false | "anonymous" | "use-credentials" | undefined; + environment?: { + module?: boolean | undefined; + document?: boolean | undefined; + nodePrefixForCoreModules?: boolean | undefined; + globalThis?: boolean | undefined; + bigIntLiteral?: boolean | undefined; + const?: boolean | undefined; + arrowFunction?: boolean | undefined; + forOf?: boolean | undefined; + destructuring?: boolean | undefined; + dynamicImport?: boolean | undefined; + dynamicImportInWorker?: boolean | undefined; + optionalChaining?: boolean | undefined; + templateLiteral?: boolean | undefined; + asyncFunction?: boolean | undefined; + } | undefined; + chunkFilename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; + uniqueName?: string | undefined; + pathinfo?: boolean | "verbose" | undefined; + clean?: boolean | { + keep?: string | undefined; + } | undefined; + cssFilename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; + cssChunkFilename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; + hotUpdateMainFilename?: string | undefined; + hotUpdateChunkFilename?: string | undefined; + hotUpdateGlobal?: string | undefined; + assetModuleFilename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; + chunkLoadingGlobal?: string | undefined; + enabledLibraryTypes?: string[] | undefined; + strictModuleErrorHandling?: boolean | undefined; + globalObject?: string | undefined; + importFunctionName?: string | undefined; + importMetaName?: string | undefined; + iife?: boolean | undefined; + enabledWasmLoadingTypes?: string[] | undefined; + webassemblyModuleFilename?: string | undefined; + chunkFormat?: string | false | undefined; + enabledChunkLoadingTypes?: string[] | undefined; + trustedTypes?: string | true | { + policyName?: string | undefined; + onPolicyCreationFailure?: "continue" | "stop" | undefined; + } | undefined; + sourceMapFilename?: string | undefined; + hashDigest?: string | undefined; + hashDigestLength?: number | undefined; + hashFunction?: "md4" | "xxhash64" | undefined; + hashSalt?: string | undefined; + workerChunkLoading?: string | false | undefined; + workerWasmLoading?: string | false | undefined; + workerPublicPath?: string | undefined; + scriptType?: false | "module" | "text/javascript" | undefined; + devtoolNamespace?: string | undefined; + devtoolModuleFilenameTemplate?: string | ((args_0: any) => any) | undefined; + devtoolFallbackModuleFilenameTemplate?: string | ((args_0: any) => any) | undefined; + charset?: boolean | undefined; + chunkLoadTimeout?: number | undefined; + compareBeforeEmit?: boolean | undefined; + libraryExport?: string | string[] | undefined; + libraryTarget?: string | undefined; + strictModuleExceptionHandling?: boolean | undefined; + } | undefined; + optimization?: { + usedExports?: boolean | "global" | undefined; + providedExports?: boolean | undefined; + splitChunks?: false | { + name?: string | false | ((args_0: Module | undefined, ...args: unknown[]) => unknown) | undefined; + chunks?: RegExp | "initial" | "async" | "all" | ((args_0: Chunk, ...args: unknown[]) => boolean) | undefined; + usedExports?: boolean | undefined; + defaultSizeTypes?: string[] | undefined; + cacheGroups?: Record unknown) | undefined; + type?: string | RegExp | undefined; + filename?: string | undefined; + chunks?: RegExp | "initial" | "async" | "all" | ((args_0: Chunk, ...args: unknown[]) => boolean) | undefined; + usedExports?: boolean | undefined; + defaultSizeTypes?: string[] | undefined; + maxSize?: number | Record | undefined; + priority?: number | undefined; + minSize?: number | Record | undefined; + maxAsyncSize?: number | Record | undefined; + maxInitialSize?: number | Record | undefined; + minChunks?: number | undefined; + maxAsyncRequests?: number | undefined; + maxInitialRequests?: number | undefined; + automaticNameDelimiter?: string | undefined; + test?: string | RegExp | ((args_0: Module, ...args: unknown[]) => unknown) | undefined; + enforce?: boolean | undefined; + reuseExistingChunk?: boolean | undefined; + idHint?: string | undefined; + }> | undefined; + maxSize?: number | Record | undefined; + fallbackCacheGroup?: { + chunks?: RegExp | "initial" | "async" | "all" | ((args_0: Chunk, ...args: unknown[]) => boolean) | undefined; + maxSize?: number | undefined; + minSize?: number | undefined; + maxAsyncSize?: number | undefined; + maxInitialSize?: number | undefined; + automaticNameDelimiter?: string | undefined; + } | undefined; + minSize?: number | Record | undefined; + maxAsyncSize?: number | Record | undefined; + maxInitialSize?: number | Record | undefined; + hidePathInfo?: boolean | undefined; + minChunks?: number | undefined; + maxAsyncRequests?: number | undefined; + maxInitialRequests?: number | undefined; + automaticNameDelimiter?: string | undefined; + } | undefined; + moduleIds?: "named" | "natural" | "deterministic" | undefined; + chunkIds?: "named" | "natural" | "deterministic" | "size" | "total-size" | undefined; + removeAvailableModules?: boolean | undefined; + minimize?: boolean | undefined; + minimizer?: (false | "" | 0 | "..." | t.RspackPluginInstance | t.WebpackPluginInstance | t.RspackPluginFunction | t.WebpackPluginFunction | null | undefined)[] | undefined; + mergeDuplicateChunks?: boolean | undefined; + runtimeChunk?: boolean | "single" | "multiple" | { + name?: string | ((args_0: { + name: string; + }, ...args: unknown[]) => string) | undefined; + } | undefined; + removeEmptyChunks?: boolean | undefined; + realContentHash?: boolean | undefined; + sideEffects?: boolean | "flag" | undefined; + concatenateModules?: boolean | undefined; + innerGraph?: boolean | undefined; + mangleExports?: boolean | "deterministic" | "size" | undefined; + nodeEnv?: string | false | undefined; + emitOnErrors?: boolean | undefined; + } | undefined; + snapshot?: {} | undefined; stats?: boolean | "none" | "verbose" | "normal" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | { all?: boolean | undefined; version?: boolean | undefined; @@ -8651,7 +8785,6 @@ export const rspackOptions: z.ZodObject<{ } | undefined; loader?: Record | undefined; externals?: string | RegExp | Record | ((args_0: t.ExternalItemFunctionData, args_1: (args_0: Error | undefined, args_1: string | boolean | string[] | t.ExternalItemUmdValue | t.ExternalItemObjectValue | undefined, args_2: "module" | "jsonp" | "import" | "var" | "assign" | "this" | "window" | "self" | "global" | "commonjs" | "commonjs2" | "commonjs-module" | "commonjs-static" | "amd" | "amd-require" | "umd" | "umd2" | "system" | "promise" | "module-import" | "script" | "node-commonjs" | "commonjs-import" | undefined, ...args: unknown[]) => void, ...args: unknown[]) => unknown) | ((args_0: t.ExternalItemFunctionData, ...args: unknown[]) => Promise) | (string | RegExp | Record | ((args_0: t.ExternalItemFunctionData, args_1: (args_0: Error | undefined, args_1: string | boolean | string[] | t.ExternalItemUmdValue | t.ExternalItemObjectValue | undefined, args_2: "module" | "jsonp" | "import" | "var" | "assign" | "this" | "window" | "self" | "global" | "commonjs" | "commonjs2" | "commonjs-module" | "commonjs-static" | "amd" | "amd-require" | "umd" | "umd2" | "system" | "promise" | "module-import" | "script" | "node-commonjs" | "commonjs-import" | undefined, ...args: unknown[]) => void, ...args: unknown[]) => unknown) | ((args_0: t.ExternalItemFunctionData, ...args: unknown[]) => Promise))[] | undefined; - target?: false | "async-node" | `node${number}` | `async-node${number}` | `node${number}.${number}` | `async-node${number}.${number}` | `electron${number}-main` | `electron${number}.${number}-main` | `electron${number}-renderer` | `electron${number}.${number}-renderer` | `electron${number}-preload` | `electron${number}.${number}-preload` | `nwjs${number}` | `nwjs${number}.${number}` | `node-webkit${number}` | `node-webkit${number}.${number}` | `browserslist:${string}` | "web" | "webworker" | "es3" | "es5" | "es2015" | "es2016" | "es2017" | "es2018" | "es2019" | "es2020" | "es2021" | "es2022" | "node" | "electron-main" | "electron-renderer" | "electron-preload" | "nwjs" | "node-webkit" | "browserslist" | ("async-node" | `node${number}` | `async-node${number}` | `node${number}.${number}` | `async-node${number}.${number}` | `electron${number}-main` | `electron${number}.${number}-main` | `electron${number}-renderer` | `electron${number}.${number}-renderer` | `electron${number}-preload` | `electron${number}.${number}-preload` | `nwjs${number}` | `nwjs${number}.${number}` | `node-webkit${number}` | `node-webkit${number}.${number}` | `browserslist:${string}` | "web" | "webworker" | "es3" | "es5" | "es2015" | "es2016" | "es2017" | "es2018" | "es2019" | "es2020" | "es2021" | "es2022" | "node" | "electron-main" | "electron-renderer" | "electron-preload" | "nwjs" | "node-webkit" | "browserslist")[] | undefined; entry?: string | string[] | Record>) | undefined; dependencies?: string[] | undefined; - output?: { - module?: boolean | undefined; - chunkLoading?: string | false | undefined; - asyncChunks?: boolean | undefined; - publicPath?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; - filename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; - library?: string | string[] | { - commonjs?: string | undefined; - amd?: string | undefined; - root?: string | string[] | undefined; - } | { - type: string; - name?: string | string[] | { - commonjs?: string | undefined; - amd?: string | undefined; - root?: string | string[] | undefined; - } | undefined; - amdContainer?: string | undefined; - auxiliaryComment?: string | { - commonjs?: string | undefined; - commonjs2?: string | undefined; - amd?: string | undefined; - root?: string | undefined; - } | undefined; - export?: string | string[] | undefined; - umdNamedDefine?: boolean | undefined; - } | undefined; - wasmLoading?: string | false | undefined; - cssHeadDataCompression?: boolean | undefined; - auxiliaryComment?: string | { - commonjs?: string | undefined; - commonjs2?: string | undefined; - amd?: string | undefined; - root?: string | undefined; - } | undefined; - umdNamedDefine?: boolean | undefined; - path?: string | undefined; - pathinfo?: boolean | "verbose" | undefined; - clean?: boolean | { - keep?: string | undefined; - } | undefined; - chunkFilename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; - crossOriginLoading?: false | "anonymous" | "use-credentials" | undefined; - cssFilename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; - cssChunkFilename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; - hotUpdateMainFilename?: string | undefined; - hotUpdateChunkFilename?: string | undefined; - hotUpdateGlobal?: string | undefined; - assetModuleFilename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; - uniqueName?: string | undefined; - chunkLoadingGlobal?: string | undefined; - enabledLibraryTypes?: string[] | undefined; - strictModuleErrorHandling?: boolean | undefined; - globalObject?: string | undefined; - importFunctionName?: string | undefined; - importMetaName?: string | undefined; - iife?: boolean | undefined; - enabledWasmLoadingTypes?: string[] | undefined; - webassemblyModuleFilename?: string | undefined; - chunkFormat?: string | false | undefined; - enabledChunkLoadingTypes?: string[] | undefined; - trustedTypes?: string | true | { - policyName?: string | undefined; - onPolicyCreationFailure?: "continue" | "stop" | undefined; - } | undefined; - sourceMapFilename?: string | undefined; - hashDigest?: string | undefined; - hashDigestLength?: number | undefined; - hashFunction?: "md4" | "xxhash64" | undefined; - hashSalt?: string | undefined; - workerChunkLoading?: string | false | undefined; - workerWasmLoading?: string | false | undefined; - workerPublicPath?: string | undefined; - scriptType?: false | "module" | "text/javascript" | undefined; - devtoolNamespace?: string | undefined; - devtoolModuleFilenameTemplate?: string | ((args_0: any) => any) | undefined; - devtoolFallbackModuleFilenameTemplate?: string | ((args_0: any) => any) | undefined; - environment?: { - module?: boolean | undefined; - document?: boolean | undefined; - nodePrefixForCoreModules?: boolean | undefined; - globalThis?: boolean | undefined; - bigIntLiteral?: boolean | undefined; - const?: boolean | undefined; - arrowFunction?: boolean | undefined; - forOf?: boolean | undefined; - destructuring?: boolean | undefined; - dynamicImport?: boolean | undefined; - dynamicImportInWorker?: boolean | undefined; - optionalChaining?: boolean | undefined; - templateLiteral?: boolean | undefined; - asyncFunction?: boolean | undefined; - } | undefined; - charset?: boolean | undefined; - chunkLoadTimeout?: number | undefined; - compareBeforeEmit?: boolean | undefined; - libraryExport?: string | string[] | undefined; - libraryTarget?: string | undefined; - strictModuleExceptionHandling?: boolean | undefined; - } | undefined; resolveLoader?: t.ResolveOptions | undefined; externalsType?: "module" | "jsonp" | "import" | "var" | "assign" | "this" | "window" | "self" | "global" | "commonjs" | "commonjs2" | "commonjs-module" | "commonjs-static" | "amd" | "amd-require" | "umd" | "umd2" | "system" | "promise" | "module-import" | "script" | "node-commonjs" | "commonjs-import" | undefined; externalsPresets?: { @@ -8858,74 +8891,6 @@ export const rspackOptions: z.ZodObject<{ console?: Console | undefined; level?: "error" | "warn" | "info" | "log" | "none" | "verbose" | undefined; } | undefined; - snapshot?: {} | undefined; - optimization?: { - usedExports?: boolean | "global" | undefined; - providedExports?: boolean | undefined; - moduleIds?: "named" | "natural" | "deterministic" | undefined; - chunkIds?: "named" | "natural" | "deterministic" | "size" | "total-size" | undefined; - minimize?: boolean | undefined; - minimizer?: (false | "" | 0 | "..." | t.RspackPluginInstance | t.WebpackPluginInstance | t.RspackPluginFunction | t.WebpackPluginFunction | null | undefined)[] | undefined; - mergeDuplicateChunks?: boolean | undefined; - splitChunks?: false | { - name?: string | false | ((args_0: Module | undefined, ...args: unknown[]) => unknown) | undefined; - chunks?: RegExp | "initial" | "async" | "all" | ((args_0: Chunk, ...args: unknown[]) => boolean) | undefined; - usedExports?: boolean | undefined; - defaultSizeTypes?: string[] | undefined; - cacheGroups?: Record unknown) | undefined; - filename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; - type?: string | RegExp | undefined; - chunks?: RegExp | "initial" | "async" | "all" | ((args_0: Chunk, ...args: unknown[]) => boolean) | undefined; - usedExports?: boolean | undefined; - defaultSizeTypes?: string[] | undefined; - maxSize?: number | Record | undefined; - priority?: number | undefined; - minSize?: number | Record | undefined; - maxAsyncSize?: number | Record | undefined; - maxInitialSize?: number | Record | undefined; - minChunks?: number | undefined; - maxAsyncRequests?: number | undefined; - maxInitialRequests?: number | undefined; - automaticNameDelimiter?: string | undefined; - test?: string | RegExp | ((args_0: Module, ...args: unknown[]) => unknown) | undefined; - enforce?: boolean | undefined; - reuseExistingChunk?: boolean | undefined; - idHint?: string | undefined; - }> | undefined; - maxSize?: number | Record | undefined; - fallbackCacheGroup?: { - chunks?: RegExp | "initial" | "async" | "all" | ((args_0: Chunk, ...args: unknown[]) => boolean) | undefined; - maxSize?: number | undefined; - minSize?: number | undefined; - maxAsyncSize?: number | undefined; - maxInitialSize?: number | undefined; - automaticNameDelimiter?: string | undefined; - } | undefined; - minSize?: number | Record | undefined; - maxAsyncSize?: number | Record | undefined; - maxInitialSize?: number | Record | undefined; - hidePathInfo?: boolean | undefined; - minChunks?: number | undefined; - maxAsyncRequests?: number | undefined; - maxInitialRequests?: number | undefined; - automaticNameDelimiter?: string | undefined; - } | undefined; - runtimeChunk?: boolean | "single" | "multiple" | { - name?: string | ((args_0: { - name: string; - }, ...args: unknown[]) => string) | undefined; - } | undefined; - removeAvailableModules?: boolean | undefined; - removeEmptyChunks?: boolean | undefined; - realContentHash?: boolean | undefined; - sideEffects?: boolean | "flag" | undefined; - concatenateModules?: boolean | undefined; - innerGraph?: boolean | undefined; - mangleExports?: boolean | "deterministic" | "size" | undefined; - nodeEnv?: string | false | undefined; - emitOnErrors?: boolean | undefined; - } | undefined; plugins?: (false | "" | 0 | t.RspackPluginInstance | t.WebpackPluginInstance | t.RspackPluginFunction | t.WebpackPluginFunction | null | undefined)[] | undefined; watch?: boolean | undefined; watchOptions?: { @@ -9053,8 +9018,8 @@ export const rspackOptions: z.ZodObject<{ dataUrl?: { encoding?: false | "base64" | undefined; mimetype?: string | undefined; - } | ((args_0: Buffer, args_1: { - module: Module; + } | ((args_0: { + content: string; filename: string; }, ...args: unknown[]) => string) | undefined; emit?: boolean | undefined; @@ -9075,8 +9040,8 @@ export const rspackOptions: z.ZodObject<{ dataUrl?: { encoding?: false | "base64" | undefined; mimetype?: string | undefined; - } | ((args_0: Buffer, args_1: { - module: Module; + } | ((args_0: { + content: string; filename: string; }, ...args: unknown[]) => string) | undefined; } | undefined; @@ -9097,12 +9062,7 @@ export const rspackOptions: z.ZodObject<{ __dirname?: boolean | "warn-mock" | "mock" | "eval-only" | "node-module" | undefined; __filename?: boolean | "warn-mock" | "mock" | "eval-only" | "node-module" | undefined; } | undefined; - performance?: false | { - maxAssetSize?: number | undefined; - assetFilter?: ((args_0: string, ...args: unknown[]) => boolean) | undefined; - hints?: false | "error" | "warning" | undefined; - maxEntrypointSize?: number | undefined; - } | undefined; + 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; context?: string | undefined; mode?: "development" | "production" | "none" | undefined; experiments?: { @@ -9111,6 +9071,10 @@ export const rspackOptions: z.ZodObject<{ type: "memory"; } | { type: "persistent"; + storage: { + type: "filesystem"; + directory?: string | undefined; + }; version?: string | undefined; snapshot?: { immutablePaths?: (string | RegExp)[] | undefined; @@ -9118,32 +9082,7 @@ export const rspackOptions: z.ZodObject<{ managedPaths?: (string | RegExp)[] | undefined; } | undefined; buildDependencies?: string[] | undefined; - storage?: { - type: "filesystem"; - directory?: string | undefined; - } | undefined; - } | undefined; - lazyCompilation?: boolean | { - entries?: boolean | undefined; - test?: RegExp | ((args_0: Module, ...args: unknown[]) => boolean) | undefined; - imports?: boolean | undefined; - backend?: { - client?: string | undefined; - listen?: number | { - path?: string | undefined; - port?: number | undefined; - host?: string | undefined; - backlog?: number | undefined; - exclusive?: boolean | undefined; - readableAll?: boolean | undefined; - writableAll?: boolean | undefined; - ipv6Only?: boolean | undefined; - } | undefined; - protocol?: "http" | "https" | undefined; - } | undefined; } | undefined; - asyncWebAssembly?: boolean | undefined; - outputModule?: boolean | undefined; topLevelAwait?: boolean | undefined; layers?: boolean | undefined; incremental?: boolean | { @@ -9162,7 +9101,6 @@ export const rspackOptions: z.ZodObject<{ chunksRender?: boolean | undefined; emitAssets?: boolean | undefined; } | undefined; - futureDefaults?: boolean | undefined; rspackFuture?: { bundlerInfo?: { version?: string | undefined; @@ -9170,49 +9108,245 @@ export const rspackOptions: z.ZodObject<{ bundler?: string | undefined; } | undefined; } | undefined; + asyncWebAssembly?: boolean | undefined; + outputModule?: boolean | undefined; + futureDefaults?: boolean | undefined; + lazyCompilation?: boolean | { + entries?: boolean | undefined; + test?: RegExp | ((args_0: Module, ...args: unknown[]) => boolean) | undefined; + imports?: boolean | undefined; + backend?: { + client?: string | undefined; + listen?: number | { + path?: string | undefined; + port?: number | undefined; + host?: string | undefined; + backlog?: number | undefined; + exclusive?: boolean | undefined; + readableAll?: boolean | undefined; + writableAll?: boolean | undefined; + ipv6Only?: boolean | undefined; + } | undefined; + protocol?: "http" | "https" | undefined; + } | undefined; + } | undefined; } | undefined; - 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; + performance?: false | { + maxAssetSize?: number | undefined; + assetFilter?: ((args_0: string, ...args: unknown[]) => boolean) | undefined; + hints?: false | "error" | "warning" | undefined; + maxEntrypointSize?: number | undefined; + } | undefined; + target?: false | "async-node" | `node${number}` | `async-node${number}` | `node${number}.${number}` | `async-node${number}.${number}` | `electron${number}-main` | `electron${number}.${number}-main` | `electron${number}-renderer` | `electron${number}.${number}-renderer` | `electron${number}-preload` | `electron${number}.${number}-preload` | `nwjs${number}` | `nwjs${number}.${number}` | `node-webkit${number}` | `node-webkit${number}.${number}` | `browserslist:${string}` | "web" | "webworker" | "es3" | "es5" | "es2015" | "es2016" | "es2017" | "es2018" | "es2019" | "es2020" | "es2021" | "es2022" | "node" | "electron-main" | "electron-renderer" | "electron-preload" | "nwjs" | "node-webkit" | "browserslist" | ("async-node" | `node${number}` | `async-node${number}` | `node${number}.${number}` | `async-node${number}.${number}` | `electron${number}-main` | `electron${number}.${number}-main` | `electron${number}-renderer` | `electron${number}.${number}-renderer` | `electron${number}-preload` | `electron${number}.${number}-preload` | `nwjs${number}` | `nwjs${number}.${number}` | `node-webkit${number}` | `node-webkit${number}.${number}` | `browserslist:${string}` | "web" | "webworker" | "es3" | "es5" | "es2015" | "es2016" | "es2017" | "es2018" | "es2019" | "es2020" | "es2021" | "es2022" | "node" | "electron-main" | "electron-renderer" | "electron-preload" | "nwjs" | "node-webkit" | "browserslist")[] | undefined; resolve?: t.ResolveOptions | undefined; - stats?: boolean | "none" | "verbose" | "normal" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | { - all?: boolean | undefined; - version?: boolean | undefined; - runtime?: boolean | undefined; - publicPath?: boolean | undefined; - preset?: boolean | "none" | "verbose" | "normal" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | undefined; - assets?: boolean | undefined; - chunks?: boolean | undefined; - modules?: boolean | undefined; - entrypoints?: boolean | "auto" | undefined; - chunkGroups?: boolean | undefined; - warnings?: boolean | undefined; - warningsCount?: boolean | undefined; - errors?: boolean | undefined; - errorsCount?: boolean | undefined; - colors?: boolean | undefined; - hash?: boolean | undefined; - reasons?: boolean | undefined; - outputPath?: boolean | undefined; - chunkModules?: boolean | undefined; - chunkRelations?: boolean | undefined; - ids?: boolean | undefined; - timings?: boolean | undefined; - builtAt?: boolean | undefined; - moduleAssets?: boolean | undefined; - nestedModules?: boolean | undefined; - source?: boolean | undefined; - logging?: boolean | "error" | "warn" | "info" | "log" | "none" | "verbose" | undefined; - loggingDebug?: string | boolean | RegExp | ((args_0: string, ...args: unknown[]) => boolean) | (string | RegExp | ((args_0: string, ...args: unknown[]) => boolean))[] | undefined; - loggingTrace?: boolean | undefined; - runtimeModules?: boolean | undefined; - children?: boolean | undefined; - usedExports?: boolean | undefined; - providedExports?: boolean | undefined; - optimizationBailout?: boolean | undefined; - groupModulesByType?: boolean | undefined; - groupModulesByCacheStatus?: boolean | undefined; - groupModulesByLayer?: boolean | undefined; - groupModulesByAttributes?: boolean | undefined; - groupModulesByPath?: boolean | undefined; + output?: { + module?: boolean | undefined; + path?: string | undefined; + chunkLoading?: string | false | undefined; + asyncChunks?: boolean | undefined; + publicPath?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; + filename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; + library?: string | string[] | { + commonjs?: string | undefined; + amd?: string | undefined; + root?: string | string[] | undefined; + } | { + type: string; + name?: string | string[] | { + commonjs?: string | undefined; + amd?: string | undefined; + root?: string | string[] | undefined; + } | undefined; + amdContainer?: string | undefined; + auxiliaryComment?: string | { + commonjs?: string | undefined; + commonjs2?: string | undefined; + amd?: string | undefined; + root?: string | undefined; + } | undefined; + export?: string | string[] | undefined; + umdNamedDefine?: boolean | undefined; + } | undefined; + wasmLoading?: string | false | undefined; + cssHeadDataCompression?: boolean | undefined; + auxiliaryComment?: string | { + commonjs?: string | undefined; + commonjs2?: string | undefined; + amd?: string | undefined; + root?: string | undefined; + } | undefined; + umdNamedDefine?: boolean | undefined; + crossOriginLoading?: false | "anonymous" | "use-credentials" | undefined; + environment?: { + module?: boolean | undefined; + document?: boolean | undefined; + nodePrefixForCoreModules?: boolean | undefined; + globalThis?: boolean | undefined; + bigIntLiteral?: boolean | undefined; + const?: boolean | undefined; + arrowFunction?: boolean | undefined; + forOf?: boolean | undefined; + destructuring?: boolean | undefined; + dynamicImport?: boolean | undefined; + dynamicImportInWorker?: boolean | undefined; + optionalChaining?: boolean | undefined; + templateLiteral?: boolean | undefined; + asyncFunction?: boolean | undefined; + } | undefined; + chunkFilename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; + uniqueName?: string | undefined; + pathinfo?: boolean | "verbose" | undefined; + clean?: boolean | { + keep?: string | undefined; + } | undefined; + cssFilename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; + cssChunkFilename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; + hotUpdateMainFilename?: string | undefined; + hotUpdateChunkFilename?: string | undefined; + hotUpdateGlobal?: string | undefined; + assetModuleFilename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; + chunkLoadingGlobal?: string | undefined; + enabledLibraryTypes?: string[] | undefined; + strictModuleErrorHandling?: boolean | undefined; + globalObject?: string | undefined; + importFunctionName?: string | undefined; + importMetaName?: string | undefined; + iife?: boolean | undefined; + enabledWasmLoadingTypes?: string[] | undefined; + webassemblyModuleFilename?: string | undefined; + chunkFormat?: string | false | undefined; + enabledChunkLoadingTypes?: string[] | undefined; + trustedTypes?: string | true | { + policyName?: string | undefined; + onPolicyCreationFailure?: "continue" | "stop" | undefined; + } | undefined; + sourceMapFilename?: string | undefined; + hashDigest?: string | undefined; + hashDigestLength?: number | undefined; + hashFunction?: "md4" | "xxhash64" | undefined; + hashSalt?: string | undefined; + workerChunkLoading?: string | false | undefined; + workerWasmLoading?: string | false | undefined; + workerPublicPath?: string | undefined; + scriptType?: false | "module" | "text/javascript" | undefined; + devtoolNamespace?: string | undefined; + devtoolModuleFilenameTemplate?: string | ((args_0: any) => any) | undefined; + devtoolFallbackModuleFilenameTemplate?: string | ((args_0: any) => any) | undefined; + charset?: boolean | undefined; + chunkLoadTimeout?: number | undefined; + compareBeforeEmit?: boolean | undefined; + libraryExport?: string | string[] | undefined; + libraryTarget?: string | undefined; + strictModuleExceptionHandling?: boolean | undefined; + } | undefined; + optimization?: { + usedExports?: boolean | "global" | undefined; + providedExports?: boolean | undefined; + splitChunks?: false | { + name?: string | false | ((args_0: Module | undefined, ...args: unknown[]) => unknown) | undefined; + chunks?: RegExp | "initial" | "async" | "all" | ((args_0: Chunk, ...args: unknown[]) => boolean) | undefined; + usedExports?: boolean | undefined; + defaultSizeTypes?: string[] | undefined; + cacheGroups?: Record unknown) | undefined; + type?: string | RegExp | undefined; + filename?: string | undefined; + chunks?: RegExp | "initial" | "async" | "all" | ((args_0: Chunk, ...args: unknown[]) => boolean) | undefined; + usedExports?: boolean | undefined; + defaultSizeTypes?: string[] | undefined; + maxSize?: number | Record | undefined; + priority?: number | undefined; + minSize?: number | Record | undefined; + maxAsyncSize?: number | Record | undefined; + maxInitialSize?: number | Record | undefined; + minChunks?: number | undefined; + maxAsyncRequests?: number | undefined; + maxInitialRequests?: number | undefined; + automaticNameDelimiter?: string | undefined; + test?: string | RegExp | ((args_0: Module, ...args: unknown[]) => unknown) | undefined; + enforce?: boolean | undefined; + reuseExistingChunk?: boolean | undefined; + idHint?: string | undefined; + }> | undefined; + maxSize?: number | Record | undefined; + fallbackCacheGroup?: { + chunks?: RegExp | "initial" | "async" | "all" | ((args_0: Chunk, ...args: unknown[]) => boolean) | undefined; + maxSize?: number | undefined; + minSize?: number | undefined; + maxAsyncSize?: number | undefined; + maxInitialSize?: number | undefined; + automaticNameDelimiter?: string | undefined; + } | undefined; + minSize?: number | Record | undefined; + maxAsyncSize?: number | Record | undefined; + maxInitialSize?: number | Record | undefined; + hidePathInfo?: boolean | undefined; + minChunks?: number | undefined; + maxAsyncRequests?: number | undefined; + maxInitialRequests?: number | undefined; + automaticNameDelimiter?: string | undefined; + } | undefined; + moduleIds?: "named" | "natural" | "deterministic" | undefined; + chunkIds?: "named" | "natural" | "deterministic" | "size" | "total-size" | undefined; + removeAvailableModules?: boolean | undefined; + minimize?: boolean | undefined; + minimizer?: (false | "" | 0 | "..." | t.RspackPluginInstance | t.WebpackPluginInstance | t.RspackPluginFunction | t.WebpackPluginFunction | null | undefined)[] | undefined; + mergeDuplicateChunks?: boolean | undefined; + runtimeChunk?: boolean | "single" | "multiple" | { + name?: string | ((args_0: { + name: string; + }, ...args: unknown[]) => string) | undefined; + } | undefined; + removeEmptyChunks?: boolean | undefined; + realContentHash?: boolean | undefined; + sideEffects?: boolean | "flag" | undefined; + concatenateModules?: boolean | undefined; + innerGraph?: boolean | undefined; + mangleExports?: boolean | "deterministic" | "size" | undefined; + nodeEnv?: string | false | undefined; + emitOnErrors?: boolean | undefined; + } | undefined; + snapshot?: {} | undefined; + stats?: boolean | "none" | "verbose" | "normal" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | { + all?: boolean | undefined; + version?: boolean | undefined; + runtime?: boolean | undefined; + publicPath?: boolean | undefined; + preset?: boolean | "none" | "verbose" | "normal" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | undefined; + assets?: boolean | undefined; + chunks?: boolean | undefined; + modules?: boolean | undefined; + entrypoints?: boolean | "auto" | undefined; + chunkGroups?: boolean | undefined; + warnings?: boolean | undefined; + warningsCount?: boolean | undefined; + errors?: boolean | undefined; + errorsCount?: boolean | undefined; + colors?: boolean | undefined; + hash?: boolean | undefined; + reasons?: boolean | undefined; + outputPath?: boolean | undefined; + chunkModules?: boolean | undefined; + chunkRelations?: boolean | undefined; + ids?: boolean | undefined; + timings?: boolean | undefined; + builtAt?: boolean | undefined; + moduleAssets?: boolean | undefined; + nestedModules?: boolean | undefined; + source?: boolean | undefined; + logging?: boolean | "error" | "warn" | "info" | "log" | "none" | "verbose" | undefined; + loggingDebug?: string | boolean | RegExp | ((args_0: string, ...args: unknown[]) => boolean) | (string | RegExp | ((args_0: string, ...args: unknown[]) => boolean))[] | undefined; + loggingTrace?: boolean | undefined; + runtimeModules?: boolean | undefined; + children?: boolean | undefined; + usedExports?: boolean | undefined; + providedExports?: boolean | undefined; + optimizationBailout?: boolean | undefined; + groupModulesByType?: boolean | undefined; + groupModulesByCacheStatus?: boolean | undefined; + groupModulesByLayer?: boolean | undefined; + groupModulesByAttributes?: boolean | undefined; + groupModulesByPath?: boolean | undefined; groupModulesByExtension?: boolean | undefined; modulesSpace?: number | undefined; chunkModulesSpace?: number | undefined; @@ -9253,7 +9387,6 @@ export const rspackOptions: z.ZodObject<{ } | undefined; loader?: Record | undefined; externals?: string | RegExp | Record | ((args_0: t.ExternalItemFunctionData, args_1: (args_0: Error | undefined, args_1: string | boolean | string[] | t.ExternalItemUmdValue | t.ExternalItemObjectValue | undefined, args_2: "module" | "jsonp" | "import" | "var" | "assign" | "this" | "window" | "self" | "global" | "commonjs" | "commonjs2" | "commonjs-module" | "commonjs-static" | "amd" | "amd-require" | "umd" | "umd2" | "system" | "promise" | "module-import" | "script" | "node-commonjs" | "commonjs-import" | undefined, ...args: unknown[]) => void, ...args: unknown[]) => unknown) | ((args_0: t.ExternalItemFunctionData, ...args: unknown[]) => Promise) | (string | RegExp | Record | ((args_0: t.ExternalItemFunctionData, args_1: (args_0: Error | undefined, args_1: string | boolean | string[] | t.ExternalItemUmdValue | t.ExternalItemObjectValue | undefined, args_2: "module" | "jsonp" | "import" | "var" | "assign" | "this" | "window" | "self" | "global" | "commonjs" | "commonjs2" | "commonjs-module" | "commonjs-static" | "amd" | "amd-require" | "umd" | "umd2" | "system" | "promise" | "module-import" | "script" | "node-commonjs" | "commonjs-import" | undefined, ...args: unknown[]) => void, ...args: unknown[]) => unknown) | ((args_0: t.ExternalItemFunctionData, ...args: unknown[]) => Promise))[] | undefined; - target?: false | "async-node" | `node${number}` | `async-node${number}` | `node${number}.${number}` | `async-node${number}.${number}` | `electron${number}-main` | `electron${number}.${number}-main` | `electron${number}-renderer` | `electron${number}.${number}-renderer` | `electron${number}-preload` | `electron${number}.${number}-preload` | `nwjs${number}` | `nwjs${number}.${number}` | `node-webkit${number}` | `node-webkit${number}.${number}` | `browserslist:${string}` | "web" | "webworker" | "es3" | "es5" | "es2015" | "es2016" | "es2017" | "es2018" | "es2019" | "es2020" | "es2021" | "es2022" | "node" | "electron-main" | "electron-renderer" | "electron-preload" | "nwjs" | "node-webkit" | "browserslist" | ("async-node" | `node${number}` | `async-node${number}` | `node${number}.${number}` | `async-node${number}.${number}` | `electron${number}-main` | `electron${number}.${number}-main` | `electron${number}-renderer` | `electron${number}.${number}-renderer` | `electron${number}-preload` | `electron${number}.${number}-preload` | `nwjs${number}` | `nwjs${number}.${number}` | `node-webkit${number}` | `node-webkit${number}.${number}` | `browserslist:${string}` | "web" | "webworker" | "es3" | "es5" | "es2015" | "es2016" | "es2017" | "es2018" | "es2019" | "es2020" | "es2021" | "es2022" | "node" | "electron-main" | "electron-renderer" | "electron-preload" | "nwjs" | "node-webkit" | "browserslist")[] | undefined; entry?: string | string[] | Record>) | undefined; dependencies?: string[] | undefined; - output?: { - module?: boolean | undefined; - chunkLoading?: string | false | undefined; - asyncChunks?: boolean | undefined; - publicPath?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; - filename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; - library?: string | string[] | { - commonjs?: string | undefined; - amd?: string | undefined; - root?: string | string[] | undefined; - } | { - type: string; - name?: string | string[] | { - commonjs?: string | undefined; - amd?: string | undefined; - root?: string | string[] | undefined; - } | undefined; - amdContainer?: string | undefined; - auxiliaryComment?: string | { - commonjs?: string | undefined; - commonjs2?: string | undefined; - amd?: string | undefined; - root?: string | undefined; - } | undefined; - export?: string | string[] | undefined; - umdNamedDefine?: boolean | undefined; - } | undefined; - wasmLoading?: string | false | undefined; - cssHeadDataCompression?: boolean | undefined; - auxiliaryComment?: string | { - commonjs?: string | undefined; - commonjs2?: string | undefined; - amd?: string | undefined; - root?: string | undefined; - } | undefined; - umdNamedDefine?: boolean | undefined; - path?: string | undefined; - pathinfo?: boolean | "verbose" | undefined; - clean?: boolean | { - keep?: string | undefined; - } | undefined; - chunkFilename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; - crossOriginLoading?: false | "anonymous" | "use-credentials" | undefined; - cssFilename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; - cssChunkFilename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; - hotUpdateMainFilename?: string | undefined; - hotUpdateChunkFilename?: string | undefined; - hotUpdateGlobal?: string | undefined; - assetModuleFilename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; - uniqueName?: string | undefined; - chunkLoadingGlobal?: string | undefined; - enabledLibraryTypes?: string[] | undefined; - strictModuleErrorHandling?: boolean | undefined; - globalObject?: string | undefined; - importFunctionName?: string | undefined; - importMetaName?: string | undefined; - iife?: boolean | undefined; - enabledWasmLoadingTypes?: string[] | undefined; - webassemblyModuleFilename?: string | undefined; - chunkFormat?: string | false | undefined; - enabledChunkLoadingTypes?: string[] | undefined; - trustedTypes?: string | true | { - policyName?: string | undefined; - onPolicyCreationFailure?: "continue" | "stop" | undefined; - } | undefined; - sourceMapFilename?: string | undefined; - hashDigest?: string | undefined; - hashDigestLength?: number | undefined; - hashFunction?: "md4" | "xxhash64" | undefined; - hashSalt?: string | undefined; - workerChunkLoading?: string | false | undefined; - workerWasmLoading?: string | false | undefined; - workerPublicPath?: string | undefined; - scriptType?: false | "module" | "text/javascript" | undefined; - devtoolNamespace?: string | undefined; - devtoolModuleFilenameTemplate?: string | ((args_0: any) => any) | undefined; - devtoolFallbackModuleFilenameTemplate?: string | ((args_0: any) => any) | undefined; - environment?: { - module?: boolean | undefined; - document?: boolean | undefined; - nodePrefixForCoreModules?: boolean | undefined; - globalThis?: boolean | undefined; - bigIntLiteral?: boolean | undefined; - const?: boolean | undefined; - arrowFunction?: boolean | undefined; - forOf?: boolean | undefined; - destructuring?: boolean | undefined; - dynamicImport?: boolean | undefined; - dynamicImportInWorker?: boolean | undefined; - optionalChaining?: boolean | undefined; - templateLiteral?: boolean | undefined; - asyncFunction?: boolean | undefined; - } | undefined; - charset?: boolean | undefined; - chunkLoadTimeout?: number | undefined; - compareBeforeEmit?: boolean | undefined; - libraryExport?: string | string[] | undefined; - libraryTarget?: string | undefined; - strictModuleExceptionHandling?: boolean | undefined; - } | undefined; resolveLoader?: t.ResolveOptions | undefined; externalsType?: "module" | "jsonp" | "import" | "var" | "assign" | "this" | "window" | "self" | "global" | "commonjs" | "commonjs2" | "commonjs-module" | "commonjs-static" | "amd" | "amd-require" | "umd" | "umd2" | "system" | "promise" | "module-import" | "script" | "node-commonjs" | "commonjs-import" | undefined; externalsPresets?: { @@ -9460,74 +9493,6 @@ export const rspackOptions: z.ZodObject<{ console?: Console | undefined; level?: "error" | "warn" | "info" | "log" | "none" | "verbose" | undefined; } | undefined; - snapshot?: {} | undefined; - optimization?: { - usedExports?: boolean | "global" | undefined; - providedExports?: boolean | undefined; - moduleIds?: "named" | "natural" | "deterministic" | undefined; - chunkIds?: "named" | "natural" | "deterministic" | "size" | "total-size" | undefined; - minimize?: boolean | undefined; - minimizer?: (false | "" | 0 | "..." | t.RspackPluginInstance | t.WebpackPluginInstance | t.RspackPluginFunction | t.WebpackPluginFunction | null | undefined)[] | undefined; - mergeDuplicateChunks?: boolean | undefined; - splitChunks?: false | { - name?: string | false | ((args_0: Module | undefined, ...args: unknown[]) => unknown) | undefined; - chunks?: RegExp | "initial" | "async" | "all" | ((args_0: Chunk, ...args: unknown[]) => boolean) | undefined; - usedExports?: boolean | undefined; - defaultSizeTypes?: string[] | undefined; - cacheGroups?: Record unknown) | undefined; - filename?: string | ((args_0: PathData, args_1: JsAssetInfo | undefined, ...args: unknown[]) => string) | undefined; - type?: string | RegExp | undefined; - chunks?: RegExp | "initial" | "async" | "all" | ((args_0: Chunk, ...args: unknown[]) => boolean) | undefined; - usedExports?: boolean | undefined; - defaultSizeTypes?: string[] | undefined; - maxSize?: number | Record | undefined; - priority?: number | undefined; - minSize?: number | Record | undefined; - maxAsyncSize?: number | Record | undefined; - maxInitialSize?: number | Record | undefined; - minChunks?: number | undefined; - maxAsyncRequests?: number | undefined; - maxInitialRequests?: number | undefined; - automaticNameDelimiter?: string | undefined; - test?: string | RegExp | ((args_0: Module, ...args: unknown[]) => unknown) | undefined; - enforce?: boolean | undefined; - reuseExistingChunk?: boolean | undefined; - idHint?: string | undefined; - }> | undefined; - maxSize?: number | Record | undefined; - fallbackCacheGroup?: { - chunks?: RegExp | "initial" | "async" | "all" | ((args_0: Chunk, ...args: unknown[]) => boolean) | undefined; - maxSize?: number | undefined; - minSize?: number | undefined; - maxAsyncSize?: number | undefined; - maxInitialSize?: number | undefined; - automaticNameDelimiter?: string | undefined; - } | undefined; - minSize?: number | Record | undefined; - maxAsyncSize?: number | Record | undefined; - maxInitialSize?: number | Record | undefined; - hidePathInfo?: boolean | undefined; - minChunks?: number | undefined; - maxAsyncRequests?: number | undefined; - maxInitialRequests?: number | undefined; - automaticNameDelimiter?: string | undefined; - } | undefined; - runtimeChunk?: boolean | "single" | "multiple" | { - name?: string | ((args_0: { - name: string; - }, ...args: unknown[]) => string) | undefined; - } | undefined; - removeAvailableModules?: boolean | undefined; - removeEmptyChunks?: boolean | undefined; - realContentHash?: boolean | undefined; - sideEffects?: boolean | "flag" | undefined; - concatenateModules?: boolean | undefined; - innerGraph?: boolean | undefined; - mangleExports?: boolean | "deterministic" | "size" | undefined; - nodeEnv?: string | false | undefined; - emitOnErrors?: boolean | undefined; - } | undefined; plugins?: (false | "" | 0 | t.RspackPluginInstance | t.WebpackPluginInstance | t.RspackPluginFunction | t.WebpackPluginFunction | null | undefined)[] | undefined; watch?: boolean | undefined; watchOptions?: { @@ -9713,7 +9678,7 @@ const RuntimeChunkPlugin: { new (options: RawRuntimeChunkOptions): { name: BuiltinPluginName; _args: [options: RawRuntimeChunkOptions]; - affectedHooks: "done" | "make" | "environment" | "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; + 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" | "additionalPass" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -10010,7 +9975,7 @@ export const SourceMapDevToolPlugin: { new (options: SourceMapDevToolPluginOptions): { name: BuiltinPluginName; _args: [options: SourceMapDevToolPluginOptions]; - affectedHooks: "done" | "make" | "environment" | "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; + 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" | "additionalPass" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -10314,7 +10279,7 @@ export const SwcJsMinimizerRspackPlugin: { new (options?: SwcJsMinimizerRspackPluginOptions | undefined): { name: BuiltinPluginName; _args: [options?: SwcJsMinimizerRspackPluginOptions | undefined]; - affectedHooks: "done" | "make" | "environment" | "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; + 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" | "additionalPass" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; @@ -10479,7 +10444,6 @@ declare namespace t { AssetGeneratorDataUrlFunction, AssetGeneratorDataUrl, AssetInlineGeneratorOptions, - AssetModuleOutputPath, AssetResourceGeneratorOptions, AssetGeneratorOptions, CssGeneratorExportsConvention, @@ -11043,7 +11007,7 @@ export const WarnCaseSensitiveModulesPlugin: { new (): { name: BuiltinPluginName; _args: []; - affectedHooks: "done" | "make" | "environment" | "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; + 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" | "additionalPass" | undefined; raw(compiler: Compiler_2): BuiltinPlugin; apply(compiler: Compiler_2): void; }; diff --git a/packages/rspack/src/Compiler.ts b/packages/rspack/src/Compiler.ts index f3f60dc8f6a7..de006ef28927 100644 --- a/packages/rspack/src/Compiler.ts +++ b/packages/rspack/src/Compiler.ts @@ -1061,69 +1061,73 @@ class Compiler { codegenResults, runtimeModules }: binding.JsExecuteModuleArg) { - const __webpack_require__: any = (id: string) => { - const cached = moduleCache[id]; - if (cached !== undefined) { - if (cached.error) throw cached.error; - return cached.exports; - } + try { + const __webpack_require__: any = (id: string) => { + const cached = moduleCache[id]; + if (cached !== undefined) { + if (cached.error) throw cached.error; + return cached.exports; + } - const execOptions = { - id, - module: { + const execOptions = { id, - exports: {}, - loaded: false, - error: undefined - }, - require: __webpack_require__ - }; - - for (const handler of interceptModuleExecution) { - handler(execOptions); - } + module: { + id, + exports: {}, + loaded: false, + error: undefined + }, + require: __webpack_require__ + }; + + for (const handler of interceptModuleExecution) { + handler(execOptions); + } - const result = codegenResults.map[id]["build time"]; - const moduleObject = execOptions.module; - - if (id) moduleCache[id] = moduleObject; - - tryRunOrWebpackError( - () => - queried.call( - { - codeGenerationResult: new CodeGenerationResult(result), - moduleObject - }, - { __webpack_require__ } - ), - "Compilation.hooks.executeModule" - ); - moduleObject.loaded = true; - return moduleObject.exports; - }; + const result = codegenResults.map[id]["build time"]; + const moduleObject = execOptions.module; + + if (id) moduleCache[id] = moduleObject; + + tryRunOrWebpackError( + () => + queried.call( + { + codeGenerationResult: new CodeGenerationResult(result), + moduleObject + }, + { __webpack_require__ } + ), + "Compilation.hooks.executeModule" + ); + moduleObject.loaded = true; + return moduleObject.exports; + }; - const moduleCache: Record = (__webpack_require__[ - RuntimeGlobals.moduleCache.replace( - `${RuntimeGlobals.require}.`, - "" - ) - ] = {}); - const interceptModuleExecution: ((execOptions: any) => void)[] = - (__webpack_require__[ - RuntimeGlobals.interceptModuleExecution.replace( + const moduleCache: Record = (__webpack_require__[ + RuntimeGlobals.moduleCache.replace( `${RuntimeGlobals.require}.`, "" ) - ] = []); - - for (const runtimeModule of runtimeModules) { - __webpack_require__(runtimeModule); - } + ] = {}); + const interceptModuleExecution: ((execOptions: any) => void)[] = + (__webpack_require__[ + RuntimeGlobals.interceptModuleExecution.replace( + `${RuntimeGlobals.require}.`, + "" + ) + ] = []); - const executeResult = __webpack_require__(entry); + for (const runtimeModule of runtimeModules) { + __webpack_require__(runtimeModule); + } - that.deref()!.#moduleExecutionResultsMap.set(id, executeResult); + const executeResult = __webpack_require__(entry); + that.deref()!.#moduleExecutionResultsMap.set(id, executeResult); + } catch (e) { + that.deref()!.#moduleExecutionResultsMap.set(id, e); + throw e; + } }; } ), diff --git a/packages/rspack/src/loader-runner/index.ts b/packages/rspack/src/loader-runner/index.ts index 4f8e2fe5dfc1..58ed4d0191e7 100644 --- a/packages/rspack/src/loader-runner/index.ts +++ b/packages/rspack/src/loader-runner/index.ts @@ -410,6 +410,42 @@ export async function runLoaders( callback ) { const options = userOptions ? userOptions : {}; + const context = this; + function finalCallback( + onError: (err: Error) => void, + onDone: (res: any) => void + ) { + return function (err?: Error, res?: any) { + if (err) { + onError(err); + } else { + for (const dep of res.buildDependencies) { + context.addBuildDependency(dep); + } + for (const dep of res.contextDependencies) { + context.addContextDependency(dep); + } + for (const dep of res.missingDependencies) { + context.addMissingDependency(dep); + } + for (const dep of res.fileDependencies) { + context.addDependency(dep); + } + if (res.cacheable === false) { + context.cacheable(false); + } + + if (res.error) { + onError( + compiler.__internal__getModuleExecutionResult(res.id) ?? + new Error(err) + ); + } else { + onDone(compiler.__internal__getModuleExecutionResult(res.id)); + } + } + }; + } if (!callback) { return new Promise((resolve, reject) => { compiler @@ -419,81 +455,25 @@ export async function runLoaders( options.layer, options.publicPath, options.baseUri, - context._module.moduleIdentifier, + context._module.identifier(), loaderContext.context, - (err: Error, res: any) => { - if (err) reject(err); - else { - for (const dep of res.buildDependencies) { - this.addBuildDependency(dep); - } - for (const dep of res.contextDependencies) { - this.addContextDependency(dep); - } - for (const dep of res.missingDependencies) { - this.addMissingDependency(dep); - } - for (const dep of res.fileDependencies) { - this.addDependency(dep); - } - if (res.cacheable === false) { - this.cacheable(false); - } - - if (res.error) { - reject(new Error(res.error)); - } else { - resolve( - compiler.__internal__getModuleExecutionResult(res.id) - ); - } - } - } + finalCallback(reject, resolve) ); }); } - return compiler - ._lastCompilation!.__internal_getInner() - .importModule( - request, - options.layer, - options.publicPath, - options.baseUri, - context._module.moduleIdentifier, - loaderContext.context, - (err: Error, res: any) => { - if (err) { - callback(err, undefined); - } else { - for (const dep of res.buildDependencies) { - this.addBuildDependency(dep); - } - for (const dep of res.contextDependencies) { - this.addContextDependency(dep); - } - for (const dep of res.missingDependencies) { - this.addMissingDependency(dep); - } - for (const dep of res.fileDependencies) { - this.addDependency(dep); - } - if (res.cacheable === false) { - this.cacheable(false); - } - - if (res.error) { - callback(new Error(err), undefined); - } else { - callback( - undefined, - compiler.__internal__getModuleExecutionResult(res.id) - ); - } - } - } - ); + return compiler._lastCompilation!.__internal_getInner().importModule( + request, + options.layer, + options.publicPath, + options.baseUri, + context._module.identifier(), + loaderContext.context, + finalCallback( + err => callback(err), + res => callback(undefined, res) + ) + ); } as LoaderContext["importModule"]; - Object.defineProperty(loaderContext, "resource", { enumerable: true, get: () => {