/** * The following code is modified based on * https://github.com/webpack/webpack/blob/4b4ca3b/lib/config/normalization.js * * MIT Licensed * Author Tobias Koppers @sokra * Copyright (c) JS Foundation and other contributors * https://github.com/webpack/webpack/blob/main/LICENSE */ import { Compilation } from ".."; import type { Context, Dependencies, Node, DevTool, Externals, ExternalsPresets, ExternalsType, InfrastructureLogging, LibraryOptions, Mode, Name, Resolve, RspackOptions, Target, SnapshotOptions, CacheOptions, StatsValue, Optimization, Plugins, Watch, WatchOptions, DevServer, Profile, Bail, Builtins, EntryRuntime, ChunkLoading, PublicPath, EntryFilename, Path, Clean, Filename, ChunkFilename, CrossOriginLoading, CssFilename, CssChunkFilename, HotUpdateMainFilename, HotUpdateChunkFilename, AssetModuleFilename, UniqueName, ChunkLoadingGlobal, EnabledLibraryTypes, OutputModule, StrictModuleErrorHandling, GlobalObject, ImportFunctionName, Iife, WasmLoading, EnabledWasmLoadingTypes, WebassemblyModuleFilename, TrustedTypes, SourceMapFilename, HashDigest, HashDigestLength, HashFunction, HashSalt, WorkerPublicPath, RuleSetRules, ParserOptionsByModuleType, GeneratorOptionsByModuleType, RspackFutureOptions, HotUpdateGlobal, ScriptType, NoParseOption, DevtoolNamespace, DevtoolModuleFilenameTemplate, DevtoolFallbackModuleFilenameTemplate } from "./zod"; export declare const getNormalizedRspackOptions: (config: RspackOptions) => RspackOptionsNormalized; export type EntryNormalized = EntryStaticNormalized; export interface EntryStaticNormalized { [k: string]: EntryDescriptionNormalized; } export interface EntryDescriptionNormalized { import?: string[]; runtime?: EntryRuntime; chunkLoading?: ChunkLoading; asyncChunks?: boolean; publicPath?: PublicPath; baseUri?: string; filename?: EntryFilename; library?: LibraryOptions; } export interface OutputNormalized { path?: Path; clean?: Clean; publicPath?: PublicPath; filename?: Filename; chunkFilename?: ChunkFilename; crossOriginLoading?: CrossOriginLoading; cssFilename?: CssFilename; cssChunkFilename?: CssChunkFilename; hotUpdateMainFilename?: HotUpdateMainFilename; hotUpdateChunkFilename?: HotUpdateChunkFilename; hotUpdateGlobal?: HotUpdateGlobal; assetModuleFilename?: AssetModuleFilename; uniqueName?: UniqueName; chunkLoadingGlobal?: ChunkLoadingGlobal; enabledLibraryTypes?: EnabledLibraryTypes; library?: LibraryOptions; module?: OutputModule; strictModuleErrorHandling?: StrictModuleErrorHandling; globalObject?: GlobalObject; importFunctionName?: ImportFunctionName; iife?: Iife; wasmLoading?: WasmLoading; enabledWasmLoadingTypes?: EnabledWasmLoadingTypes; webassemblyModuleFilename?: WebassemblyModuleFilename; chunkFormat?: string | false; chunkLoading?: string | false; enabledChunkLoadingTypes?: string[]; trustedTypes?: TrustedTypes; sourceMapFilename?: SourceMapFilename; hashDigest?: HashDigest; hashDigestLength?: HashDigestLength; hashFunction?: HashFunction; hashSalt?: HashSalt; asyncChunks?: boolean; workerChunkLoading?: ChunkLoading; workerWasmLoading?: WasmLoading; workerPublicPath?: WorkerPublicPath; scriptType?: ScriptType; devtoolNamespace?: DevtoolNamespace; devtoolModuleFilenameTemplate?: DevtoolModuleFilenameTemplate; devtoolFallbackModuleFilenameTemplate?: DevtoolFallbackModuleFilenameTemplate; } export interface ModuleOptionsNormalized { defaultRules?: RuleSetRules; rules: RuleSetRules; parser: ParserOptionsByModuleType; generator: GeneratorOptionsByModuleType; noParse?: NoParseOption; } export interface ExperimentsNormalized { lazyCompilation?: boolean; asyncWebAssembly?: boolean; outputModule?: boolean; newSplitChunks?: boolean; topLevelAwait?: boolean; css?: boolean; futureDefaults?: boolean; rspackFuture?: RspackFutureOptions; } export type IgnoreWarningsNormalized = ((warning: Error, compilation: Compilation) => boolean)[]; export type OptimizationRuntimeChunkNormalized = false | { name: (...args: any[]) => string | undefined; }; export interface RspackOptionsNormalized { name?: Name; dependencies?: Dependencies; context?: Context; mode?: Mode; entry: EntryNormalized; output: OutputNormalized; resolve: Resolve; resolveLoader: Resolve; module: ModuleOptionsNormalized; target?: Target; externals?: Externals; externalsType?: ExternalsType; externalsPresets: ExternalsPresets; infrastructureLogging: InfrastructureLogging; devtool?: DevTool; node: Node; snapshot: SnapshotOptions; cache?: CacheOptions; stats: StatsValue; optimization: Optimization; plugins: Plugins; experiments: ExperimentsNormalized; watch?: Watch; watchOptions: WatchOptions; devServer?: DevServer; ignoreWarnings?: IgnoreWarningsNormalized; profile?: Profile; bail?: Bail; builtins: Builtins; }