Project Init

This commit is contained in:
Muluhabt
2026-05-29 15:23:46 +03:00
commit 2fbc557aac
67387 changed files with 6063341 additions and 0 deletions

17
node_modules/@rspack/core/dist/BuildInfo.d.ts generated vendored Normal file
View File

@@ -0,0 +1,17 @@
import binding from "@rspack/binding";
import type { Source } from "../compiled/webpack-sources";
declare const $assets: unique symbol;
declare module "@rspack/binding" {
interface Assets {
[$assets]: Record<string, Source>;
}
interface KnownBuildInfo {
assets: Record<string, Source>;
fileDependencies: Set<string>;
contextDependencies: Set<string>;
missingDependencies: Set<string>;
buildDependencies: Set<string>;
}
}
export type { BuildInfo } from "@rspack/binding";
export declare const commitCustomFieldsToRust: (buildInfo: binding.BuildInfo) => void;

16
node_modules/@rspack/core/dist/Chunk.d.ts generated vendored Normal file
View File

@@ -0,0 +1,16 @@
import { type ChunkGroup } from "@rspack/binding";
interface ChunkMaps {
hash: Record<string | number, string>;
contentHash: Record<string | number, Record<string, string>>;
name: Record<string | number, string>;
}
declare module "@rspack/binding" {
interface Chunk {
readonly files: ReadonlySet<string>;
readonly runtime: ReadonlySet<string>;
readonly auxiliaryFiles: ReadonlySet<string>;
readonly groupsIterable: ReadonlySet<ChunkGroup>;
getChunkMaps(realHash: boolean): ChunkMaps;
}
}
export { Chunk } from "@rspack/binding";

9
node_modules/@rspack/core/dist/ChunkGraph.d.ts generated vendored Normal file
View File

@@ -0,0 +1,9 @@
import type { RuntimeSpec } from "./util/runtime";
declare module "@rspack/binding" {
interface ChunkGraph {
getModuleChunksIterable(module: Module): Iterable<Chunk>;
getOrderedChunkModulesIterable(chunk: Chunk, compareFn: (a: Module, b: Module) => number): Iterable<Module>;
getModuleHash(module: Module, runtime: RuntimeSpec): string | null;
}
}
export { ChunkGraph } from "@rspack/binding";

12
node_modules/@rspack/core/dist/Chunks.d.ts generated vendored Normal file
View File

@@ -0,0 +1,12 @@
import { Chunks } from "@rspack/binding";
declare module "@rspack/binding" {
interface Chunks {
[Symbol.iterator](): SetIterator<Chunk>;
entries(): SetIterator<[Chunk, Chunk]>;
values(): SetIterator<Chunk>;
keys(): SetIterator<Chunk>;
forEach(callbackfn: (value: Chunk, value2: Chunk, set: ReadonlySet<Chunk>) => void, thisArg?: any): void;
has(value: Chunk): boolean;
}
}
export default Chunks;

View File

@@ -0,0 +1 @@
export {};

417
node_modules/@rspack/core/dist/Compilation.d.ts generated vendored Normal file
View File

@@ -0,0 +1,417 @@
/**
* The following code is modified based on
* https://github.com/webpack/webpack/blob/4b4ca3bb53f36a5b8fc6bc1bd976ed7af161bd80/lib/Compilation.js
*
* MIT Licensed
* Author Tobias Koppers @sokra
* Copyright (c) JS Foundation and other contributors
* https://github.com/webpack/webpack/blob/main/LICENSE
*/
import type { AssetInfo, ChunkGroup, Dependency, ExternalObject, JsCompilation, JsRuntimeModule } from "@rspack/binding";
import binding from "@rspack/binding";
export type { AssetInfo } from "@rspack/binding";
import * as liteTapable from "@rspack/lite-tapable";
import type { Source } from "../compiled/webpack-sources";
import type { EntryOptions, EntryPlugin } from "./builtin-plugin";
import type { Chunk } from "./Chunk";
import type { ChunkGraph } from "./ChunkGraph";
import type { Compiler } from "./Compiler";
import type { ContextModuleFactory } from "./ContextModuleFactory";
import type { OutputNormalized, RspackOptionsNormalized, RspackPluginInstance, StatsOptions, StatsValue } from "./config";
import type { Entrypoint } from "./Entrypoint";
import WebpackError from "./lib/WebpackError";
import { Logger } from "./logging/Logger";
import type { Module } from "./Module";
import ModuleGraph from "./ModuleGraph";
import type { NormalModuleCompilationHooks } from "./NormalModule";
import type { NormalModuleFactory } from "./NormalModuleFactory";
import type { ResolverFactory } from "./ResolverFactory";
import type { RspackError } from "./RspackError";
import { RuntimeModule } from "./RuntimeModule";
import { Stats, type StatsAsset, type StatsError, type StatsModule } from "./Stats";
import { StatsFactory } from "./stats/StatsFactory";
import { StatsPrinter } from "./stats/StatsPrinter";
import type { InputFileSystem } from "./util/fs";
import type Hash from "./util/hash";
import "./Chunk";
import "./Chunks";
import "./ChunkGraph";
import "./CodeGenerationResults";
import type { CodeGenerationResult } from "./taps/compilation";
export type Assets = Record<string, Source>;
export interface Asset {
name: string;
source: Source;
info: AssetInfo;
}
export type ChunkPathData = {
id?: string;
name?: string;
hash?: string;
contentHash?: Record<string, string>;
};
export type PathData = {
filename?: string;
hash?: string;
contentHash?: string;
runtime?: string;
url?: string;
id?: string;
chunk?: Chunk | ChunkPathData;
contentHashType?: string;
};
export interface LogEntry {
type: string;
args: any[];
time?: number;
trace?: string[];
}
export interface CompilationParams {
normalModuleFactory: NormalModuleFactory;
contextModuleFactory: ContextModuleFactory;
}
export interface KnownCreateStatsOptionsContext {
forToString?: boolean;
}
export interface ExecuteModuleArgument {
codeGenerationResult: CodeGenerationResult;
moduleObject: {
id: string;
exports: any;
loaded: boolean;
error?: Error;
};
}
export interface ExecuteModuleContext {
[key: string]: (id: string) => any;
}
export interface KnownNormalizedStatsOptions {
context: string;
chunksSort: string;
modulesSort: string;
chunkModulesSort: string;
nestedModulesSort: string;
assetsSort: string;
ids: boolean;
cachedAssets: boolean;
groupAssetsByEmitStatus: boolean;
groupAssetsByPath: boolean;
groupAssetsByExtension: boolean;
assetsSpace: number;
excludeAssets: ((value: string, asset: StatsAsset) => boolean)[];
excludeModules: ((name: string, module: StatsModule, type: "module" | "chunk" | "root-of-chunk" | "nested") => boolean)[];
warningsFilter: ((warning: StatsError, textValue: string) => boolean)[];
cachedModules: boolean;
orphanModules: boolean;
dependentModules: boolean;
runtimeModules: boolean;
groupModulesByCacheStatus: boolean;
groupModulesByLayer: boolean;
groupModulesByAttributes: boolean;
groupModulesByPath: boolean;
groupModulesByExtension: boolean;
groupModulesByType: boolean;
entrypoints: boolean | "auto";
chunkGroups: boolean;
chunkGroupAuxiliary: boolean;
chunkGroupChildren: boolean;
chunkGroupMaxAssets: number;
modulesSpace: number;
chunkModulesSpace: number;
nestedModulesSpace: number;
logging: false | "none" | "error" | "warn" | "info" | "log" | "verbose";
loggingDebug: ((value: string) => boolean)[];
loggingTrace: boolean;
chunkModules: boolean;
chunkRelations: boolean;
reasons: boolean;
moduleAssets: boolean;
nestedModules: boolean;
source: boolean;
usedExports: boolean;
providedExports: boolean;
optimizationBailout: boolean;
depth: boolean;
assets: boolean;
chunks: boolean;
errors: boolean;
errorsCount: boolean;
hash: boolean;
modules: boolean;
warnings: boolean;
warningsCount: boolean;
}
export type CreateStatsOptionsContext = KnownCreateStatsOptionsContext & Record<string, any>;
export type NormalizedStatsOptions = KnownNormalizedStatsOptions & Omit<StatsOptions, keyof KnownNormalizedStatsOptions> & Record<string, any>;
export declare const checkCompilation: (compilation: Compilation) => void;
export declare class Compilation {
#private;
hooks: Readonly<{
processAssets: liteTapable.AsyncSeriesHook<Assets>;
afterProcessAssets: liteTapable.SyncHook<Assets>;
childCompiler: liteTapable.SyncHook<[Compiler, string, number]>;
log: liteTapable.SyncBailHook<[string, LogEntry], true>;
additionalAssets: any;
optimizeModules: liteTapable.SyncBailHook<Iterable<Module>, void>;
afterOptimizeModules: liteTapable.SyncHook<Iterable<Module>>;
optimizeTree: liteTapable.AsyncSeriesHook<[
Iterable<Chunk>,
Iterable<Module>
]>;
optimizeChunkModules: liteTapable.AsyncSeriesBailHook<[
Iterable<Chunk>,
Iterable<Module>
], void>;
finishModules: liteTapable.AsyncSeriesHook<[Iterable<Module>], void>;
chunkHash: liteTapable.SyncHook<[Chunk, Hash]>;
chunkAsset: liteTapable.SyncHook<[Chunk, string]>;
processWarnings: liteTapable.SyncWaterfallHook<[WebpackError[]]>;
succeedModule: liteTapable.SyncHook<[Module]>;
stillValidModule: liteTapable.SyncHook<[Module]>;
statsPreset: liteTapable.HookMap<liteTapable.SyncHook<[Partial<StatsOptions>, CreateStatsOptionsContext]>>;
statsNormalize: liteTapable.SyncHook<[
Partial<StatsOptions>,
CreateStatsOptionsContext
]>;
statsFactory: liteTapable.SyncHook<[StatsFactory, StatsOptions]>;
statsPrinter: liteTapable.SyncHook<[StatsPrinter, StatsOptions]>;
buildModule: liteTapable.SyncHook<[Module]>;
executeModule: liteTapable.SyncHook<[
ExecuteModuleArgument,
ExecuteModuleContext
]>;
additionalTreeRuntimeRequirements: liteTapable.SyncHook<[
Chunk,
Set<string>
]>;
runtimeRequirementInTree: liteTapable.HookMap<liteTapable.SyncBailHook<[Chunk, Set<string>], void>>;
runtimeModule: liteTapable.SyncHook<[JsRuntimeModule, Chunk]>;
seal: liteTapable.SyncHook<[]>;
afterSeal: liteTapable.AsyncSeriesHook<[], void>;
needAdditionalPass: liteTapable.SyncBailHook<[], boolean>;
}>;
name?: string;
startTime?: number;
endTime?: number;
compiler: Compiler;
resolverFactory: ResolverFactory;
inputFileSystem: InputFileSystem | null;
options: RspackOptionsNormalized;
outputOptions: OutputNormalized;
logging: Map<string, LogEntry[]>;
childrenCounters: Record<string, number>;
children: Compilation[];
chunkGraph: ChunkGraph;
moduleGraph: ModuleGraph;
fileSystemInfo: {
createSnapshot(): null;
};
needAdditionalPass: boolean;
[binding.COMPILATION_HOOKS_MAP_SYMBOL]: WeakMap<Compilation, NormalModuleCompilationHooks>;
constructor(compiler: Compiler, inner: JsCompilation);
get hash(): Readonly<string | null>;
get fullHash(): Readonly<string | null>;
/**
* Get a map of all assets.
*/
get assets(): Record<string, Source>;
/**
* Get a map of all entrypoints.
*/
get entrypoints(): ReadonlyMap<string, Entrypoint>;
get chunkGroups(): readonly ChunkGroup[];
/**
* Get the named chunk groups.
*
* Note: This is a proxy for webpack internal API, only method `get`, `keys`, `values` and `entries` are supported now.
*/
get namedChunkGroups(): ReadonlyMap<string, Readonly<ChunkGroup>>;
get modules(): ReadonlySet<Module>;
get builtModules(): ReadonlySet<Module>;
get chunks(): ReadonlySet<Chunk>;
/**
* Get the named chunks.
*
* Note: This is a proxy for webpack internal API, only method `get`, `keys`, `values` and `entries` are supported now.
*/
get namedChunks(): ReadonlyMap<string, Readonly<binding.Chunk>>;
get entries(): Map<string, EntryData>;
get codeGenerationResults(): binding.CodeGenerationResults;
getCache(name: string): import("./lib/CacheFacade").CacheFacade;
createStatsOptions(statsValue: StatsValue | undefined, context?: CreateStatsOptionsContext): NormalizedStatsOptions;
createStatsFactory(options: StatsOptions): StatsFactory;
createStatsPrinter(options: StatsOptions): StatsPrinter;
/**
* Update an existing asset. Trying to update an asset that doesn't exist will throw an error.
*/
updateAsset(filename: string, newSourceOrFunction: Source | ((source: Source) => Source), assetInfoUpdateOrFunction?: AssetInfo | ((assetInfo: AssetInfo) => AssetInfo | undefined)): void;
/**
* Emit an not existing asset. Trying to emit an asset that already exists will throw an error.
*
* @param file - file name
* @param source - asset source
* @param assetInfo - extra asset information
*/
emitAsset(filename: string, source: Source, assetInfo?: AssetInfo): void;
deleteAsset(filename: string): void;
renameAsset(filename: string, newFilename: string): void;
/**
* Get an array of Asset
*/
getAssets(): readonly Asset[];
getAsset(name: string): Readonly<Asset> | void;
/**
* Note: This is not a webpack public API, maybe removed in future.
*
* @internal
*/
__internal__pushRspackDiagnostic(diagnostic: binding.JsRspackDiagnostic): void;
/**
* Note: This is not a webpack public API, maybe removed in future.
*
* @internal
*/
__internal__pushDiagnostic(diagnostic: ExternalObject<"Diagnostic">): void;
/**
* Note: This is not a webpack public API, maybe removed in future.
*
* @internal
*/
__internal__pushDiagnostics(diagnostics: ExternalObject<"Diagnostic[]">): void;
get errors(): RspackError[];
set errors(errors: RspackError[]);
get warnings(): RspackError[];
set warnings(warnings: RspackError[]);
getPath(filename: string, data?: PathData): string;
getPathWithInfo(filename: string, data?: PathData): binding.PathWithInfo;
getAssetPath(filename: string, data?: PathData): string;
getAssetPathWithInfo(filename: string, data?: PathData): binding.PathWithInfo;
getLogger(name: string | (() => string)): Logger;
fileDependencies: {
[Symbol.iterator](): Generator<string, void, unknown>;
has(dep: string): boolean;
add: (dep: string) => void;
addAll: (deps: Iterable<string>) => void;
};
get __internal__addedFileDependencies(): string[];
get __internal__removedFileDependencies(): string[];
get __internal__addedContextDependencies(): string[];
get __internal__removedContextDependencies(): string[];
get __internal__addedMissingDependencies(): string[];
get __internal__removedMissingDependencies(): string[];
contextDependencies: {
[Symbol.iterator](): Generator<string, void, unknown>;
has(dep: string): boolean;
add: (dep: string) => void;
addAll: (deps: Iterable<string>) => void;
};
missingDependencies: {
[Symbol.iterator](): Generator<string, void, unknown>;
has(dep: string): boolean;
add: (dep: string) => void;
addAll: (deps: Iterable<string>) => void;
};
buildDependencies: {
[Symbol.iterator](): Generator<string, void, unknown>;
has(dep: string): boolean;
add: (dep: string) => void;
addAll: (deps: Iterable<string>) => void;
};
getStats(): Stats;
createChildCompiler(name: string, outputOptions: OutputNormalized, plugins: RspackPluginInstance[]): Compiler;
rebuildModule(module: Module, f: (err: Error | null, module: Module | null) => void): void;
addRuntimeModule(chunk: Chunk, runtimeModule: RuntimeModule): void;
addInclude(context: string, dependency: ReturnType<typeof EntryPlugin.createDependency>, options: EntryOptions, callback: (err?: null | WebpackError, module?: Module) => void): void;
addEntry(context: string, dependency: ReturnType<typeof EntryPlugin.createDependency>, optionsOrName: EntryOptions | string, callback: (err?: null | WebpackError, module?: Module) => void): void;
getWarnings(): WebpackError[];
getErrors(): WebpackError[];
/**
* Get the `Source` of a given asset filename.
*
* Note: This is not a webpack public API, maybe removed in the future.
*
* @internal
*/
__internal__getAssetSource(filename: string): Source | void;
/**
* Set the `Source` of an given asset filename.
*
* Note: This is not a webpack public API, maybe removed in future.
*
* @internal
*/
__internal__setAssetSource(filename: string, source: Source): void;
/**
* Delete the `Source` of an given asset filename.
*
* Note: This is not a webpack public API, maybe removed in future.
*
* @internal
*/
__internal__deleteAssetSource(filename: string): void;
/**
* Get a list of asset filenames.
*
* Note: This is not a webpack public API, maybe removed in future.
*
* @internal
*/
__internal__getAssetFilenames(): string[];
/**
* Test if an asset exists.
*
* Note: This is not a webpack public API, maybe removed in future.
*
* @internal
*/
__internal__hasAsset(name: string): boolean;
/**
* Note: This is not a webpack public API, maybe removed in future.
*
* @internal
*/
__internal_getInner(): JsCompilation;
get __internal__shutdown(): boolean;
set __internal__shutdown(shutdown: boolean);
seal(): void;
unseal(): void;
static PROCESS_ASSETS_STAGE_ADDITIONAL: number;
static PROCESS_ASSETS_STAGE_PRE_PROCESS: number;
static PROCESS_ASSETS_STAGE_DERIVED: number;
static PROCESS_ASSETS_STAGE_ADDITIONS: number;
static PROCESS_ASSETS_STAGE_NONE: number;
static PROCESS_ASSETS_STAGE_OPTIMIZE: number;
static PROCESS_ASSETS_STAGE_OPTIMIZE_COUNT: number;
static PROCESS_ASSETS_STAGE_OPTIMIZE_COMPATIBILITY: number;
static PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE: number;
static PROCESS_ASSETS_STAGE_DEV_TOOLING: number;
static PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE: number;
static PROCESS_ASSETS_STAGE_SUMMARIZE: number;
static PROCESS_ASSETS_STAGE_OPTIMIZE_HASH: number;
static PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER: number;
static PROCESS_ASSETS_STAGE_ANALYSE: number;
static PROCESS_ASSETS_STAGE_REPORT: number;
}
export declare class EntryData {
dependencies: Dependency[];
includeDependencies: Dependency[];
options: binding.JsEntryOptions;
static __from_binding(binding: binding.JsEntryData): EntryData;
private constructor();
}
export declare class Entries implements Map<string, EntryData> {
#private;
constructor(data: binding.JsEntries);
clear(): void;
forEach(callback: (value: EntryData, key: string, map: Map<string, EntryData>) => void, thisArg?: any): void;
get size(): number;
entries(): ReturnType<Map<string, EntryData>["entries"]>;
values(): ReturnType<Map<string, EntryData>["values"]>;
[Symbol.iterator](): ReturnType<Map<string, EntryData>["entries"]>;
readonly [Symbol.toStringTag] = "Map";
has(key: string): boolean;
set(key: string, value: EntryData): this;
delete(key: string): boolean;
get(key: string): EntryData | undefined;
keys(): ReturnType<Map<string, EntryData>["keys"]>;
}

223
node_modules/@rspack/core/dist/Compiler.d.ts generated vendored Normal file
View File

@@ -0,0 +1,223 @@
/**
* The following code is modified based on
* https://github.com/webpack/webpack/blob/4b4ca3bb53f36a5b8fc6bc1bd976ed7af161bd80/lib/Compiler.js
*
* MIT Licensed
* Author Tobias Koppers @sokra
* Copyright (c) JS Foundation and other contributors
* https://github.com/webpack/webpack/blob/main/LICENSE
*/
import type binding from "@rspack/binding";
import * as liteTapable from "@rspack/lite-tapable";
import type Watchpack from "../compiled/watchpack";
import type { Source } from "../compiled/webpack-sources";
import type { Chunk } from "./Chunk";
import type { CompilationParams } from "./Compilation";
import { Compilation } from "./Compilation";
import { ContextModuleFactory } from "./ContextModuleFactory";
import type { EntryNormalized, OutputNormalized, RspackOptionsNormalized, RspackPluginInstance } from "./config";
import type { FileSystemInfoEntry } from "./FileSystemInfo";
import { rspack } from "./index";
import Cache from "./lib/Cache";
import CacheFacade from "./lib/CacheFacade";
import { Logger } from "./logging/Logger";
import { NormalModuleFactory } from "./NormalModuleFactory";
import { ResolverFactory } from "./ResolverFactory";
import { RuleSetCompiler } from "./RuleSetCompiler";
import { Stats } from "./Stats";
import type { InputFileSystem, IntermediateFileSystem, OutputFileSystem, WatchFileSystem } from "./util/fs";
import { Watching } from "./Watching";
export interface AssetEmittedInfo {
content: Buffer;
source: Source;
outputPath: string;
targetPath: string;
compilation: Compilation;
}
export type CompilerHooks = {
done: liteTapable.AsyncSeriesHook<Stats>;
afterDone: liteTapable.SyncHook<Stats>;
thisCompilation: liteTapable.SyncHook<[Compilation, CompilationParams]>;
compilation: liteTapable.SyncHook<[Compilation, CompilationParams]>;
invalid: liteTapable.SyncHook<[string | null, number]>;
compile: liteTapable.SyncHook<[CompilationParams]>;
normalModuleFactory: liteTapable.SyncHook<NormalModuleFactory>;
contextModuleFactory: liteTapable.SyncHook<ContextModuleFactory>;
initialize: liteTapable.SyncHook<[]>;
shouldEmit: liteTapable.SyncBailHook<[Compilation], boolean>;
/**
* Called when infrastructure logging is triggered, allowing plugins to intercept, modify, or handle log messages.
* If the hook returns `true`, the default infrastructure logging will be prevented.
* If it returns `undefined`, the default logging will proceed.
* @param name - The name of the logger
* @param type - The log type (e.g., 'log', 'warn', 'error', ...)
* @param args - An array of arguments passed to the logging method
*/
infrastructureLog: liteTapable.SyncBailHook<[
string,
string,
any[]
], true | void>;
beforeRun: liteTapable.AsyncSeriesHook<[Compiler]>;
run: liteTapable.AsyncSeriesHook<[Compiler]>;
emit: liteTapable.AsyncSeriesHook<[Compilation]>;
assetEmitted: liteTapable.AsyncSeriesHook<[string, AssetEmittedInfo]>;
afterEmit: liteTapable.AsyncSeriesHook<[Compilation]>;
failed: liteTapable.SyncHook<[Error]>;
shutdown: liteTapable.AsyncSeriesHook<[]>;
watchRun: liteTapable.AsyncSeriesHook<[Compiler]>;
watchClose: liteTapable.SyncHook<[]>;
environment: liteTapable.SyncHook<[]>;
afterEnvironment: liteTapable.SyncHook<[]>;
afterPlugins: liteTapable.SyncHook<[Compiler]>;
afterResolvers: liteTapable.SyncHook<[Compiler]>;
make: liteTapable.AsyncParallelHook<[Compilation]>;
beforeCompile: liteTapable.AsyncSeriesHook<[CompilationParams]>;
afterCompile: liteTapable.AsyncSeriesHook<[Compilation]>;
finishMake: liteTapable.AsyncSeriesHook<[Compilation]>;
entryOption: liteTapable.SyncBailHook<[string, EntryNormalized], any>;
additionalPass: liteTapable.AsyncSeriesHook<[]>;
};
declare class Compiler {
#private;
hooks: CompilerHooks;
webpack: typeof rspack;
rspack: typeof rspack;
name?: string;
parentCompilation?: Compilation;
root: Compiler;
outputPath: string;
running: boolean;
idle: boolean;
resolverFactory: ResolverFactory;
infrastructureLogger: any;
watching?: Watching;
inputFileSystem: InputFileSystem | null;
intermediateFileSystem: IntermediateFileSystem | null;
outputFileSystem: OutputFileSystem | null;
watchFileSystem: WatchFileSystem | null;
records: Record<string, any[]>;
modifiedFiles?: ReadonlySet<string>;
removedFiles?: ReadonlySet<string>;
fileTimestamps?: ReadonlyMap<string, FileSystemInfoEntry | "ignore" | null>;
contextTimestamps?: ReadonlyMap<string, FileSystemInfoEntry | "ignore" | null>;
fsStartTime?: number;
watchMode: boolean;
context: string;
cache: Cache;
compilerPath: string;
options: RspackOptionsNormalized;
/**
* Whether to skip dropping Rust compiler instance to improve performance.
* This is an internal option api and could be removed or changed at any time.
* @internal
* true: Skip dropping Rust compiler instance.
* false: Drop Rust compiler instance when Compiler is garbage collected.
*/
unsafeFastDrop: boolean;
/**
* Note: This is not a webpack public API, maybe removed in future.
* @internal
*/
__internal_browser_require: (id: string) => unknown;
constructor(context: string, options: RspackOptionsNormalized);
get recordsInputPath(): never;
get recordsOutputPath(): never;
get managedPaths(): never;
get immutablePaths(): never;
get _lastCompilation(): Compilation | undefined;
/**
* Note: This is not a webpack public API, maybe removed in future.
* @internal
*/
get __internal__builtinPlugins(): binding.BuiltinPlugin[];
/**
* Note: This is not a webpack public API, maybe removed in future.
* @internal
*/
get __internal__ruleSet(): RuleSetCompiler;
/**
* @param name - cache name
* @returns the cache facade instance
*/
getCache(name: string): CacheFacade;
/**
* @param name - name of the logger, or function called once to get the logger name
* @returns a logger with that name
*/
getInfrastructureLogger(name: string | (() => string)): Logger;
/**
* @param watchOptions - the watcher's options
* @param handler - signals when the call finishes
* @returns a compiler watcher
*/
watch(watchOptions: Watchpack.WatchOptions, handler: liteTapable.Callback<Error, Stats>): Watching;
/**
* @param callback - signals when the call finishes
* @param options - additional data like modifiedFiles, removedFiles
*/
run(callback: liteTapable.Callback<Error, Stats>, options?: {
modifiedFiles?: ReadonlySet<string>;
removedFiles?: ReadonlySet<string>;
}): void;
runAsChild(callback: (err?: null | Error, entries?: Chunk[], compilation?: Compilation) => any): void;
purgeInputFileSystem(): void;
/**
* @param compilation - the compilation
* @param compilerName - the compiler's name
* @param compilerIndex - the compiler's index
* @param outputOptions - the output options
* @param plugins - the plugins to apply
* @returns a child compiler
*/
createChildCompiler(compilation: Compilation, compilerName: string, compilerIndex: number, outputOptions: OutputNormalized, plugins: RspackPluginInstance[]): Compiler;
isChild(): boolean;
/**
* Create a compilation and run it, which is the basic method that `compiler.run` and `compiler.watch` depend on.
* TODO: make this method private in the next major release
* @private this method is only used in Rspack core
*/
compile(callback: liteTapable.Callback<Error, Compilation>): void;
close(callback: (error?: Error | null) => void): void;
/**
* Note: This is not a webpack public API, maybe removed in future.
* @internal
*/
__internal__rebuild(modifiedFiles?: ReadonlySet<string>, removedFiles?: ReadonlySet<string>, callback?: (error: Error | null) => void): void;
/**
* Note: This is not a webpack public API, maybe removed in future.
* @internal
*/
__internal__create_compilation(native: binding.JsCompilation): Compilation;
/**
* Note: This is not a webpack public API, maybe removed in future.
* @internal
*/
__internal__get_virtual_file_store(): binding.VirtualFileStore | null | undefined;
/**
* Note: This is not a webpack public API, maybe removed in future.
* @internal
*/
__internal__registerBuiltinPlugin(plugin: binding.BuiltinPlugin): void;
/**
* Note: This is not a webpack public API, maybe removed in future.
* @internal
*/
__internal__takeModuleExecutionResult(id: number): any;
/**
* Note: This is not a webpack public API, maybe removed in future.
* @internal
*/
__internal__get_compilation(): Compilation | undefined;
/**
* Note: This is not a webpack public API, maybe removed in future.
* @internal
*/
__internal__get_compilation_params(): CompilationParams | undefined;
/**
* Note: This is not a webpack public API, maybe removed in future.
* @internal
*/
__internal__get_module_execution_results_map(): Map<number, any>;
}
export { Compiler };

View File

@@ -0,0 +1 @@
export { ConcatenatedModule } from "@rspack/binding";

1
node_modules/@rspack/core/dist/ContextModule.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export { ContextModule } from "@rspack/binding";

View File

@@ -0,0 +1,13 @@
import * as liteTapable from "@rspack/lite-tapable";
import type { ContextModuleFactoryAfterResolveResult, ContextModuleFactoryBeforeResolveResult } from "./Module";
export declare class ContextModuleFactory {
hooks: {
beforeResolve: liteTapable.AsyncSeriesWaterfallHook<[
ContextModuleFactoryBeforeResolveResult
], ContextModuleFactoryBeforeResolveResult | void>;
afterResolve: liteTapable.AsyncSeriesWaterfallHook<[
ContextModuleFactoryAfterResolveResult
], ContextModuleFactoryAfterResolveResult | void>;
};
constructor();
}

7
node_modules/@rspack/core/dist/Diagnostics.d.ts generated vendored Normal file
View File

@@ -0,0 +1,7 @@
import type { Diagnostics } from "@rspack/binding";
import type { RspackError } from "./RspackError";
declare const $proxy: unique symbol;
export declare function createDiagnosticArray(adm: Diagnostics & {
[$proxy]?: RspackError[];
}): RspackError[];
export {};

2
node_modules/@rspack/core/dist/Entrypoint.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
import type { ChunkGroup } from "@rspack/binding";
export type Entrypoint = ChunkGroup;

3
node_modules/@rspack/core/dist/ErrorHelpers.d.ts generated vendored Normal file
View File

@@ -0,0 +1,3 @@
export declare const cutOffLoaderExecution: (stack: string) => string;
export declare const cleanUp: (stack: string, name: string, message: string) => string;
export declare const cutOffMessage: (stack: string, name: string, message: string) => string;

View File

@@ -0,0 +1,4 @@
import type { Compiler } from "./Compiler";
export default class ExecuteModulePlugin {
apply(compiler: Compiler): void;
}

20
node_modules/@rspack/core/dist/ExportsInfo.d.ts generated vendored Normal file
View File

@@ -0,0 +1,20 @@
import type { JsExportsInfo } from "@rspack/binding";
import type { RuntimeSpec } from "./util/runtime";
/**
* Unused: 0
* OnlyPropertiesUsed: 1
* NoInfo: 2
* Unknown: 3
* Used: 4
*/
type UsageStateType = 0 | 1 | 2 | 3 | 4;
export declare class ExportsInfo {
#private;
static __from_binding(binding: JsExportsInfo): ExportsInfo;
private constructor();
isUsed(runtime: RuntimeSpec): boolean;
isModuleUsed(runtime: RuntimeSpec): boolean;
setUsedInUnknownWay(runtime: RuntimeSpec): boolean;
getUsed(name: string | string[], runtime: RuntimeSpec): UsageStateType;
}
export {};

1
node_modules/@rspack/core/dist/ExternalModule.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export { ExternalModule } from "@rspack/binding";

54
node_modules/@rspack/core/dist/FileSystem.d.ts generated vendored Normal file
View File

@@ -0,0 +1,54 @@
import type { NodeFsStats, ThreadsafeNodeFS } from "@rspack/binding";
import { type InputFileSystem, type IntermediateFileSystem, type OutputFileSystem } from "./util/fs";
declare class ThreadsafeInputNodeFS implements ThreadsafeNodeFS {
writeFile: (name: string, content: Buffer) => Promise<void>;
removeFile: (name: string) => Promise<void>;
mkdir: (name: string) => Promise<void>;
mkdirp: (name: string) => Promise<string | void>;
removeDirAll: (name: string) => Promise<string | void>;
readDir: (name: string) => Promise<string[] | void>;
readFile: (name: string) => Promise<Buffer | string | void>;
stat: (name: string) => Promise<NodeFsStats | void>;
lstat: (name: string) => Promise<NodeFsStats | void>;
chmod?: (name: string, mode: number) => Promise<void>;
realpath: (name: string) => Promise<string | void>;
open: (name: string, flags: string) => Promise<number | void>;
rename: (from: string, to: string) => Promise<void>;
close: (fd: number) => Promise<void>;
write: (fd: number, content: Buffer, position: number) => Promise<number | void>;
writeAll: (fd: number, content: Buffer) => Promise<number | void>;
read: (fd: number, length: number, position: number) => Promise<Buffer | void>;
readUntil: (fd: number, code: number, position: number) => Promise<Buffer | void>;
readToEnd: (fd: number, position: number) => Promise<Buffer | void>;
constructor(fs?: InputFileSystem);
static __to_binding(fs?: InputFileSystem): ThreadsafeInputNodeFS;
static needsBinding(ifs?: false | RegExp[]): boolean;
}
declare class ThreadsafeOutputNodeFS implements ThreadsafeNodeFS {
writeFile: (name: string, content: Buffer) => Promise<void>;
removeFile: (name: string) => Promise<void>;
mkdir: (name: string) => Promise<void>;
mkdirp: (name: string) => Promise<string | void>;
removeDirAll: (name: string) => Promise<string | void>;
readDir: (name: string) => Promise<string[] | void>;
readFile: (name: string) => Promise<Buffer | string | void>;
stat: (name: string) => Promise<NodeFsStats | void>;
lstat: (name: string) => Promise<NodeFsStats | void>;
chmod?: (name: string, mode: number) => Promise<void>;
realpath: (name: string) => Promise<string | void>;
open: (name: string, flags: string) => Promise<number | void>;
rename: (from: string, to: string) => Promise<void>;
close: (fd: number) => Promise<void>;
write: (fd: number, content: Buffer, position: number) => Promise<number | void>;
writeAll: (fd: number, content: Buffer) => Promise<number | void>;
read: (fd: number, length: number, position: number) => Promise<Buffer | void>;
readUntil: (fd: number, code: number, position: number) => Promise<Buffer | void>;
readToEnd: (fd: number, position: number) => Promise<Buffer | void>;
constructor(fs?: OutputFileSystem);
static __to_binding(fs?: OutputFileSystem): ThreadsafeOutputNodeFS;
}
declare class ThreadsafeIntermediateNodeFS extends ThreadsafeOutputNodeFS {
constructor(fs?: IntermediateFileSystem);
static __to_binding(fs?: IntermediateFileSystem): ThreadsafeIntermediateNodeFS;
}
export { ThreadsafeInputNodeFS, ThreadsafeOutputNodeFS, ThreadsafeIntermediateNodeFS };

5
node_modules/@rspack/core/dist/FileSystemInfo.d.ts generated vendored Normal file
View File

@@ -0,0 +1,5 @@
interface FileSystemInfoEntry {
safeTime: number;
timestamp?: number;
}
export type { FileSystemInfoEntry };

42
node_modules/@rspack/core/dist/Module.d.ts generated vendored Normal file
View File

@@ -0,0 +1,42 @@
import binding, { type AssetInfo } from "@rspack/binding";
import type { Source } from "../compiled/webpack-sources";
import type { ResourceData } from "./Resolver";
import "./BuildInfo";
export type ResourceDataWithData = ResourceData & {
data?: Record<string, any>;
};
export type CreateData = binding.JsCreateData;
export type ContextInfo = binding.ContextInfo;
export type ResolveData = binding.JsResolveData;
export declare class ContextModuleFactoryBeforeResolveData {
#private;
context: string;
request: string;
regExp: RegExp | undefined;
recursive: boolean;
static __from_binding(binding: binding.JsContextModuleFactoryBeforeResolveData): ContextModuleFactoryBeforeResolveData;
static __to_binding(data: ContextModuleFactoryBeforeResolveData): binding.JsContextModuleFactoryBeforeResolveData;
private constructor();
}
export type ContextModuleFactoryBeforeResolveResult = false | ContextModuleFactoryBeforeResolveData;
export declare class ContextModuleFactoryAfterResolveData {
#private;
resource: number;
context: string;
request: string;
regExp: RegExp | undefined;
recursive: boolean;
readonly dependencies: binding.Dependency[];
static __from_binding(binding: binding.JsContextModuleFactoryAfterResolveData): ContextModuleFactoryAfterResolveData;
static __to_binding(data: ContextModuleFactoryAfterResolveData): binding.JsContextModuleFactoryAfterResolveData;
private constructor();
}
export type ContextModuleFactoryAfterResolveResult = false | ContextModuleFactoryAfterResolveData;
declare module "@rspack/binding" {
interface Module {
identifier(): string;
originalSource(): Source | null;
emitFile(filename: string, source: Source, assetInfo?: AssetInfo): void;
}
}
export { Module } from "@rspack/binding";

19
node_modules/@rspack/core/dist/ModuleGraph.d.ts generated vendored Normal file
View File

@@ -0,0 +1,19 @@
import type { Dependency, JsModuleGraph, ModuleGraphConnection } from "@rspack/binding";
import { ExportsInfo } from "./ExportsInfo";
import type { Module } from "./Module";
export default class ModuleGraph {
#private;
static __from_binding(binding: JsModuleGraph): ModuleGraph;
constructor(binding: JsModuleGraph);
getModule(dependency: Dependency): Module | null;
getResolvedModule(dependency: Dependency): Module | null;
getParentModule(dependency: Dependency): Module | null;
getIssuer(module: Module): Module | null;
getExportsInfo(module: Module): ExportsInfo;
getConnection(dependency: Dependency): ModuleGraphConnection | null;
getOutgoingConnections(module: Module): ModuleGraphConnection[];
getIncomingConnections(module: Module): ModuleGraphConnection[];
getParentBlockIndex(dependency: Dependency): number;
isAsync(module: Module): boolean;
getOutgoingConnectionsInOrder(module: Module): ModuleGraphConnection[];
}

View File

@@ -0,0 +1,8 @@
/**
* This is the module type used for JSON files. JSON files are always parsed as ES Module.
*/
export declare const JSON_MODULE_TYPE = "json";
/**
* This is the module type used for automatically choosing between `asset/inline`, `asset/resource` based on asset size limit (8096).
*/
export declare const ASSET_MODULE_TYPE = "asset";

82
node_modules/@rspack/core/dist/MultiCompiler.d.ts generated vendored Normal file
View File

@@ -0,0 +1,82 @@
/**
* The following code is modified based on
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/MultiCompiler.js
*
* MIT Licensed
* Author Tobias Koppers @sokra
* Copyright (c) JS Foundation and other contributors
* https://github.com/webpack/webpack/blob/main/LICENSE
*/
import * as liteTapable from "@rspack/lite-tapable";
import type { CompilationParams, Compiler, CompilerHooks, RspackOptions } from ".";
import type { WatchOptions } from "./config";
import MultiStats from "./MultiStats";
import MultiWatching from "./MultiWatching";
import type { InputFileSystem, IntermediateFileSystem, WatchFileSystem } from "./util/fs";
export interface MultiCompilerOptions {
/**
* how many Compilers are allows to run at the same time in parallel
*/
parallelism?: number;
}
export type MultiRspackOptions = readonly RspackOptions[] & MultiCompilerOptions;
export declare class MultiCompiler {
#private;
compilers: Compiler[];
dependencies: WeakMap<Compiler, string[]>;
hooks: {
done: liteTapable.SyncHook<MultiStats>;
invalid: liteTapable.MultiHook<liteTapable.SyncHook<[string | null, number]>>;
beforeCompile: liteTapable.MultiHook<liteTapable.AsyncSeriesHook<[CompilationParams]>>;
shutdown: liteTapable.MultiHook<liteTapable.AsyncSeriesHook<[]>>;
run: liteTapable.MultiHook<liteTapable.AsyncSeriesHook<[Compiler]>>;
watchClose: liteTapable.SyncHook<[]>;
watchRun: liteTapable.MultiHook<liteTapable.AsyncSeriesHook<[Compiler]>>;
/**
* @see {@link CompilerHooks['infrastructureLog']}
*/
infrastructureLog: liteTapable.MultiHook<CompilerHooks["infrastructureLog"]>;
};
_options: MultiCompilerOptions;
running: boolean;
watching?: MultiWatching;
constructor(compilers: Compiler[] | Record<string, Compiler>, options?: MultiCompilerOptions);
set unsafeFastDrop(value: boolean);
get options(): import(".").RspackOptionsNormalized[] & MultiCompilerOptions;
get outputPath(): string;
get inputFileSystem(): InputFileSystem;
get outputFileSystem(): typeof import("fs");
get watchFileSystem(): WatchFileSystem;
get intermediateFileSystem(): IntermediateFileSystem;
set inputFileSystem(value: InputFileSystem);
set outputFileSystem(value: typeof import("fs"));
set watchFileSystem(value: WatchFileSystem);
set intermediateFileSystem(value: IntermediateFileSystem);
getInfrastructureLogger(name: string): import("./logging/Logger").Logger;
/**
* @param compiler - the child compiler
* @param dependencies - its dependencies
*/
setDependencies(compiler: Compiler, dependencies: string[]): void;
/**
* @param callback - signals when the validation is complete
* @returns true if the dependencies are valid
*/
validateDependencies(callback: liteTapable.Callback<Error, MultiStats>): boolean;
/**
* @param watchOptions - the watcher's options
* @param handler - signals when the call finishes
* @returns a compiler watcher
*/
watch(watchOptions: WatchOptions | WatchOptions[], handler: liteTapable.Callback<Error, MultiStats>): MultiWatching;
/**
* @param callback - signals when the call finishes
* @param options - additional data like modifiedFiles, removedFiles
*/
run(callback: liteTapable.Callback<Error, MultiStats>, options?: {
modifiedFiles?: ReadonlySet<string>;
removedFiles?: ReadonlySet<string>;
}): void;
purgeInputFileSystem(): void;
close(callback: liteTapable.Callback<Error, void>): void;
}

23
node_modules/@rspack/core/dist/MultiStats.d.ts generated vendored Normal file
View File

@@ -0,0 +1,23 @@
/**
* The following code is modified based on
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/MultiStats.js
*
* MIT Licensed
* Author Tobias Koppers @sokra
* Copyright (c) JS Foundation and other contributors
* https://github.com/webpack/webpack/blob/main/LICENSE
*/
import type { MultiStatsOptions, StatsPresets } from "./config";
import type { Stats } from "./Stats";
import type { StatsCompilation } from "./stats/statsFactoryUtils";
export default class MultiStats {
#private;
stats: Stats[];
constructor(stats: Stats[]);
get hash(): string;
hasErrors(): boolean;
hasWarnings(): boolean;
toJson(options: boolean | StatsPresets | MultiStatsOptions): StatsCompilation;
toString(options: boolean | StatsPresets | MultiStatsOptions): string;
}
export { MultiStats };

27
node_modules/@rspack/core/dist/MultiWatching.d.ts generated vendored Normal file
View File

@@ -0,0 +1,27 @@
/**
* The following code is modified based on
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/MultiWatching.js
*
* MIT Licensed
* Author Tobias Koppers @sokra
* Copyright (c) JS Foundation and other contributors
* https://github.com/webpack/webpack/blob/main/LICENSE
*/
import type { Callback } from "@rspack/lite-tapable";
import type { MultiCompiler } from "./MultiCompiler";
import type { Watching } from "./Watching";
declare class MultiWatching {
watchings: Watching[];
compiler: MultiCompiler;
/**
* @param watchings - child compilers' watchers
* @param compiler - the compiler
*/
constructor(watchings: Watching[], compiler: MultiCompiler);
invalidate(callback?: Callback<Error, void>): void;
invalidateWithChangesAndRemovals(changedFiles?: Set<string>, removedFiles?: Set<string>, callback?: Callback<Error, void>): void;
close(callback: Callback<Error, void>): void;
suspend(): void;
resume(): void;
}
export default MultiWatching;

View File

@@ -0,0 +1,23 @@
import binding from "@rspack/binding";
import type Watchpack from "../compiled/watchpack";
import type { FileSystemInfoEntry, InputFileSystem, Watcher, WatchFileSystem } from "./util/fs";
export default class NativeWatchFileSystem implements WatchFileSystem {
#private;
constructor(inputFileSystem: InputFileSystem);
watch(files: Iterable<string> & {
added?: Iterable<string>;
removed?: Iterable<string>;
}, directories: Iterable<string> & {
added?: Iterable<string>;
removed?: Iterable<string>;
}, missing: Iterable<string> & {
added?: Iterable<string>;
removed?: Iterable<string>;
}, startTime: number, options: Watchpack.WatchOptions, callback: (error: Error | null, fileTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">, contextTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">, changedFiles: Set<string>, removedFiles: Set<string>) => void, callbackUndelayed: (fileName: string, changeTime: number) => void): Watcher;
getNativeWatcher(options: Watchpack.WatchOptions): binding.NativeWatcher;
triggerEvent(kind: "change" | "remove" | "create", path: string): void;
formatWatchDependencies(dependencies: Iterable<string> & {
added?: Iterable<string>;
removed?: Iterable<string>;
}): [string[], string[]];
}

15
node_modules/@rspack/core/dist/NormalModule.d.ts generated vendored Normal file
View File

@@ -0,0 +1,15 @@
import * as liteTapable from "@rspack/lite-tapable";
import type { Compilation } from "./Compilation";
import type { LoaderContext } from "./config";
import type { Module } from "./Module";
export interface NormalModuleCompilationHooks {
loader: liteTapable.SyncHook<[LoaderContext, Module]>;
readResourceForScheme: any;
readResource: liteTapable.HookMap<liteTapable.AsyncSeriesBailHook<[LoaderContext], string | Buffer>>;
}
declare module "@rspack/binding" {
interface NormalModuleConstructor {
getCompilationHooks(compilation: Compilation): NormalModuleCompilationHooks;
}
}
export { NormalModule } from "@rspack/binding";

View File

@@ -0,0 +1,23 @@
import type binding from "@rspack/binding";
import * as liteTapable from "@rspack/lite-tapable";
import type { ResolveData, ResourceDataWithData } from "./Module";
import type { ResolveOptionsWithDependencyType, ResolverFactory } from "./ResolverFactory";
export type NormalModuleCreateData = binding.JsNormalModuleFactoryCreateModuleArgs & {
settings: {};
};
export declare class NormalModuleFactory {
hooks: {
resolveForScheme: liteTapable.HookMap<liteTapable.AsyncSeriesBailHook<[ResourceDataWithData], true | void>>;
beforeResolve: liteTapable.AsyncSeriesBailHook<[ResolveData], false | void>;
factorize: liteTapable.AsyncSeriesBailHook<[ResolveData], void>;
resolve: liteTapable.AsyncSeriesBailHook<[ResolveData], void>;
afterResolve: liteTapable.AsyncSeriesBailHook<[ResolveData], false | void>;
createModule: liteTapable.AsyncSeriesBailHook<[
NormalModuleCreateData,
{}
], void>;
};
resolverFactory: ResolverFactory;
constructor(resolverFactory: ResolverFactory);
getResolver(type: string, resolveOptions: ResolveOptionsWithDependencyType): import("./ResolverFactory").ResolverWithOptions;
}

30
node_modules/@rspack/core/dist/Resolver.d.ts generated vendored Normal file
View File

@@ -0,0 +1,30 @@
import type binding from "@rspack/binding";
import type { ResolveCallback } from "./config/adapterRuleUse";
export type ResolveContext = {
contextDependencies?: {
add: (context: string) => void;
};
missingDependencies?: {
add: (dependency: string) => void;
};
fileDependencies?: {
add: (dependency: string) => void;
};
};
export type ResourceData = binding.JsResourceData;
export interface ResolveRequest {
path: string;
query: string;
fragment: string;
descriptionFileData?: string;
descriptionFilePath?: string;
fileDependencies?: string[];
missingDependencies?: string[];
contextDependencies?: string[];
}
export declare class Resolver {
#private;
constructor(binding: binding.JsResolver);
resolveSync(context: object, path: string, request: string): string | false;
resolve(context: object, path: string, request: string, resolveContext: ResolveContext, callback: ResolveCallback): void;
}

17
node_modules/@rspack/core/dist/ResolverFactory.d.ts generated vendored Normal file
View File

@@ -0,0 +1,17 @@
import binding from "@rspack/binding";
import { type Resolve } from "./config";
import { Resolver } from "./Resolver";
export type ResolveOptionsWithDependencyType = Resolve & {
dependencyType?: string;
resolveToContext?: boolean;
};
export type WithOptions = {
withOptions: (options: ResolveOptionsWithDependencyType) => ResolverWithOptions;
};
export type ResolverWithOptions = Resolver & WithOptions;
export declare class ResolverFactory {
#private;
static __to_binding(resolver_factory: ResolverFactory): binding.JsResolverFactory;
constructor(pnp: boolean, resolveOptions: Resolve, loaderResolveOptions: Resolve);
get(type: string, resolveOptions?: ResolveOptionsWithDependencyType): ResolverWithOptions;
}

12
node_modules/@rspack/core/dist/RspackError.d.ts generated vendored Normal file
View File

@@ -0,0 +1,12 @@
import type binding from "@rspack/binding";
export type { RspackError } from "@rspack/binding";
export type RspackSeverity = binding.JsRspackSeverity;
export declare class NonErrorEmittedError extends Error {
constructor(error: Error);
}
export declare class DeadlockRiskError extends Error {
constructor(message: string);
}
export declare class ValidationError extends Error {
constructor(message: string);
}

9
node_modules/@rspack/core/dist/RuleSetCompiler.d.ts generated vendored Normal file
View File

@@ -0,0 +1,9 @@
declare class RuleSetCompiler {
references: Map<string, any>;
/**
* builtin references that should be serializable and passed to Rust.
*/
builtinReferences: Map<string, any>;
constructor();
}
export { RuleSetCompiler };

356
node_modules/@rspack/core/dist/RuntimeGlobals.d.ts generated vendored Normal file
View File

@@ -0,0 +1,356 @@
/**
* The following code is modified based on
* https://github.com/webpack/webpack/blob/v5.88.2/lib/RuntimeGlobals.js
*
* MIT Licensed
* Author Tobias Koppers \@sokra
* Copyright (c) JS Foundation and other contributors
* https://github.com/webpack/webpack/blob/main/LICENSE
*/
import type { JsRuntimeGlobals } from "@rspack/binding";
import type { RspackOptionsNormalized } from "./config";
export declare function __from_binding_runtime_globals(runtimeRequirements: JsRuntimeGlobals, compilerRuntimeGlobals: Record<string, string>): Set<string>;
export declare function __to_binding_runtime_globals(runtimeRequirements: Set<string>, compilerRuntimeGlobals: Record<string, string>): JsRuntimeGlobals;
declare enum RuntimeGlobals {
/**
* the internal require function
*/
require = 0,
/**
* access to properties of the internal require function/object
*/
requireScope = 1,
/**
* the internal exports object
*/
exports = 2,
/**
* top-level this need to be the exports object
*/
thisAsExports = 3,
/**
* runtime need to return the exports of the last entry module
*/
returnExportsFromRuntime = 4,
/**
* the internal module object
*/
module = 5,
/**
* the internal module object
*/
moduleId = 6,
/**
* the internal module object
*/
moduleLoaded = 7,
/**
* the bundle public path
*/
publicPath = 8,
/**
* the module id of the entry point
*/
entryModuleId = 9,
/**
* the module cache
*/
moduleCache = 10,
/**
* the module functions
*/
moduleFactories = 11,
/**
* the module functions, with only write access
*/
moduleFactoriesAddOnly = 12,
/**
* the chunk ensure function
*/
ensureChunk = 13,
/**
* an object with handlers to ensure a chunk
*/
ensureChunkHandlers = 14,
/**
* a runtime requirement if ensureChunkHandlers should include loading of chunk needed for entries
*/
ensureChunkIncludeEntries = 15,
/**
* the chunk prefetch function
*/
prefetchChunk = 16,
/**
* an object with handlers to prefetch a chunk
*/
prefetchChunkHandlers = 17,
/**
* the chunk preload function
*/
preloadChunk = 18,
/**
* an object with handlers to preload a chunk
*/
preloadChunkHandlers = 19,
/**
* the exported property define getters function
*/
definePropertyGetters = 20,
/**
* define compatibility on export
*/
makeNamespaceObject = 21,
/**
* create a fake namespace object
*/
createFakeNamespaceObject = 22,
/**
* compatibility get default export
*/
compatGetDefaultExport = 23,
/**
* ES modules decorator
*/
harmonyModuleDecorator = 24,
/**
* node.js module decorator
*/
nodeModuleDecorator = 25,
/**
* the webpack hash
*/
getFullHash = 26,
/**
* an object containing all installed WebAssembly.Instance export objects keyed by module id
*/
wasmInstances = 27,
/**
* instantiate a wasm instance from module exports object, id, hash and importsObject
*/
instantiateWasm = 28,
/**
* the uncaught error handler for the webpack runtime
*/
uncaughtErrorHandler = 29,
/**
* the script nonce
*/
scriptNonce = 30,
/**
* function to load a script tag.
* Arguments: (url: string, done: (event) =\> void), key?: string | number, chunkId?: string | number) =\> void
* done function is called when loading has finished or timeout occurred.
* It will attach to existing script tags with data-webpack == uniqueName + ":" + key or src == url.
*/
loadScript = 31,
/**
* function to promote a string to a TrustedScript using webpack's Trusted
* Types policy
* Arguments: (script: string) =\> TrustedScript
*/
createScript = 32,
/**
* function to promote a string to a TrustedScriptURL using webpack's Trusted
* Types policy
* Arguments: (url: string) =\> TrustedScriptURL
*/
createScriptUrl = 33,
/**
* function to return webpack's Trusted Types policy
* Arguments: () =\> TrustedTypePolicy
*/
getTrustedTypesPolicy = 34,
/**
* a flag when a chunk has a fetch priority
*/
hasFetchPriority = 35,
/**
* the chunk name of the chunk with the runtime
*/
chunkName = 36,
/**
* the runtime id of the current runtime
*/
runtimeId = 37,
/**
* the filename of the script part of the chunk
*/
getChunkScriptFilename = 38,
/**
* the filename of the css part of the chunk
*/
getChunkCssFilename = 39,
/**
* rspack version
* @internal
*/
rspackVersion = 40,
/**
* a flag when a module/chunk/tree has css modules
*/
hasCssModules = 41,
/**
* rspack unique id
* @internal
*/
rspackUniqueId = 42,
/**
* the filename of the script part of the hot update chunk
*/
getChunkUpdateScriptFilename = 43,
/**
* the filename of the css part of the hot update chunk
*/
getChunkUpdateCssFilename = 44,
/**
* startup signal from runtime
* This will be called when the runtime chunk has been loaded.
*/
startup = 45,
/**
* @deprecated
* creating a default startup function with the entry modules
*/
startupNoDefault = 46,
/**
* startup signal from runtime but only used to add logic after the startup
*/
startupOnlyAfter = 47,
/**
* startup signal from runtime but only used to add sync logic before the startup
*/
startupOnlyBefore = 48,
/**
* global callback functions for installing chunks
*/
chunkCallback = 49,
/**
* method to startup an entrypoint with needed chunks.
* Signature: (moduleId: Id, chunkIds: Id[]) =\> any.
* Returns the exports of the module or a Promise
*/
startupEntrypoint = 50,
/**
* startup signal from runtime for chunk dependencies
*/
startupChunkDependencies = 51,
/**
* register deferred code, which will run when certain
* chunks are loaded.
* Signature: (chunkIds: Id[], fn: () =\> any, priority: int \>= 0 = 0) =\> any
* Returned value will be returned directly when all chunks are already loaded
* When (priority & 1) it will wait for all other handlers with lower priority to
* be executed before itself is executed
*/
onChunksLoaded = 52,
/**
* method to install a chunk that was loaded somehow
* Signature: (\{ id, ids, modules, runtime \}) =\> void
*/
externalInstallChunk = 53,
/**
* interceptor for module executions
*/
interceptModuleExecution = 54,
/**
* the global object
*/
global = 55,
/**
* an object with all share scopes
*/
shareScopeMap = 56,
/**
* The sharing init sequence function (only runs once per share scope).
* Has one argument, the name of the share scope.
* Creates a share scope if not existing
*/
initializeSharing = 57,
/**
* The current scope when getting a module from a remote
*/
currentRemoteGetScope = 58,
/**
* the filename of the HMR manifest
*/
getUpdateManifestFilename = 59,
/**
* function downloading the update manifest
*/
hmrDownloadManifest = 60,
/**
* array with handler functions to download chunk updates
*/
hmrDownloadUpdateHandlers = 61,
/**
* object with all hmr module data for all modules
*/
hmrModuleData = 62,
/**
* array with handler functions when a module should be invalidated
*/
hmrInvalidateModuleHandlers = 63,
/**
* the prefix for storing state of runtime modules when hmr is enabled
*/
hmrRuntimeStatePrefix = 64,
/**
* the AMD define function
*/
amdDefine = 65,
/**
* the AMD options
*/
amdOptions = 66,
/**
* the System polyfill object
*/
system = 67,
/**
* the shorthand for Object.prototype.hasOwnProperty
* using of it decreases the compiled bundle size
*/
hasOwnProperty = 68,
/**
* the System.register context object
*/
systemContext = 69,
/**
* the baseURI of current document
*/
baseURI = 70,
/**
* a RelativeURL class when relative URLs are used
*/
relativeUrl = 71,
/**
* Creates an async module. The body function must be a async function.
* "module.exports" will be decorated with an AsyncModulePromise.
* The body function will be called.
* To handle async dependencies correctly do this: "([a, b, c] = await handleDependencies([a, b, c]));".
* If "hasAwaitAfterDependencies" is truthy, "handleDependencies()" must be called at the end of the body function.
* Signature: function(
* module: Module,
* body: (handleDependencies: (deps: AsyncModulePromise[]) =\> Promise\<any[]\> & () =\> void,
* hasAwaitAfterDependencies?: boolean
* ) =\> void
*/
asyncModule = 72,
asyncModuleExportSymbol = 73,
makeDeferredNamespaceObject = 74,
makeDeferredNamespaceObjectSymbol = 75
}
export declare const isReservedRuntimeGlobal: (r: string, compilerRuntimeGlobals: Record<string, string>) => boolean;
export declare function renderModulePrefix(_compilerOptions: RspackOptionsNormalized): string;
export declare enum RuntimeVariable {
Require = 0,
Modules = 1,
ModuleCache = 2,
Module = 3,
Exports = 4,
StartupExec = 5
}
export declare function renderRuntimeVariables(variable: RuntimeVariable, _compilerOptions?: RspackOptionsNormalized): string;
export declare function createCompilerRuntimeGlobals(compilerOptions?: RspackOptionsNormalized): typeof RuntimeGlobals;
declare const DefaultRuntimeGlobals: typeof RuntimeGlobals;
export { DefaultRuntimeGlobals as RuntimeGlobals };

32
node_modules/@rspack/core/dist/RuntimeModule.d.ts generated vendored Normal file
View File

@@ -0,0 +1,32 @@
import type { JsAddingRuntimeModule } from "@rspack/binding";
import type { Chunk } from "./Chunk";
import type { ChunkGraph } from "./ChunkGraph";
import type { Compilation } from "./Compilation";
export declare enum RuntimeModuleStage {
NORMAL = 0,
BASIC = 5,
ATTACH = 10,
TRIGGER = 20
}
export declare class RuntimeModule {
static STAGE_NORMAL: RuntimeModuleStage;
static STAGE_BASIC: RuntimeModuleStage;
static STAGE_ATTACH: RuntimeModuleStage;
static STAGE_TRIGGER: RuntimeModuleStage;
static __to_binding(module: RuntimeModule): JsAddingRuntimeModule;
private _name;
private _stage;
fullHash: boolean;
dependentHash: boolean;
protected chunk: Chunk | null;
protected compilation: Compilation | null;
protected chunkGraph: ChunkGraph | null;
constructor(name: string, stage?: RuntimeModuleStage);
attach(compilation: Compilation, chunk: Chunk, chunkGraph: ChunkGraph): void;
get name(): string;
get stage(): RuntimeModuleStage;
identifier(): string;
readableIdentifier(): string;
shouldIsolate(): boolean;
generate(): string;
}

17
node_modules/@rspack/core/dist/Stats.d.ts generated vendored Normal file
View File

@@ -0,0 +1,17 @@
import type { Compilation } from "./Compilation";
import type { StatsOptions, StatsValue } from "./config";
import type { StatsCompilation } from "./stats/statsFactoryUtils";
export type { StatsAsset, StatsChunk, StatsCompilation, StatsError, StatsModule } from "./stats/statsFactoryUtils";
export declare class Stats {
#private;
constructor(compilation: Compilation);
get compilation(): Compilation;
get hash(): Readonly<string | null>;
get startTime(): number | undefined;
get endTime(): number | undefined;
hasErrors(): boolean;
hasWarnings(): boolean;
toJson(opts?: StatsValue, forToString?: boolean): StatsCompilation;
toString(opts?: StatsValue): string;
}
export declare function normalizeStatsPreset(options?: StatsValue): StatsOptions;

77
node_modules/@rspack/core/dist/Template.d.ts generated vendored Normal file
View File

@@ -0,0 +1,77 @@
/**
* The following code is modified based on
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/Template.js
*
* MIT Licensed
* Author Tobias Koppers @sokra
* Copyright (c) JS Foundation and other contributors
* https://github.com/webpack/webpack/blob/main/LICENSE
*/
declare class Template {
/**
*
* @param fn a runtime function (.runtime.js) "template"
* @returns the updated and normalized function string
*/
static getFunctionContent(fn: Function): string;
/**
* @param str the string converted to identifier
* @returns created identifier
*/
static toIdentifier(str: any): string;
/**
*
* @param str string to be converted to commented in bundle code
* @returns returns a commented version of string
*/
static toComment(str: string): string;
/**
*
* @param str string to be converted to "normal comment"
* @returns returns a commented version of string
*/
static toNormalComment(str: string): string;
/**
* @param str string path to be normalized
* @returns normalized bundle-safe path
*/
static toPath(str: string): string;
/**
* @param num number to convert to ident
* @returns returns single character ident
*/
static numberToIdentifier(num: number): string;
/**
* @param num number to convert to ident
* @returns returns single character ident
*/
static numberToIdentifierContinuation(num: number): string;
/**
*
* @param s string to convert to identity
* @returns converted identity
*/
static indent(s: string | string[]): string;
/**
*
* @param s string to create prefix for
* @param prefix prefix to compose
* @returns returns new prefix string
*/
static prefix(s: string | string[], prefix: string): string;
/**
*
* @param str string or string collection
* @returns returns a single string from array
*/
static asString(str: string | string[]): string;
/**
* @param modules a collection of modules to get array bounds for
* @returns returns the upper and lower array bounds
* or false if not every module has a number based id
*/
static getModulesArrayBounds(modules: {
id: string | number;
}[]): [number, number] | false;
}
export { Template };

View File

@@ -0,0 +1,12 @@
import type { Compiler } from "./Compiler";
export declare class VirtualModulesPlugin {
#private;
constructor(modules?: Record<string, string>);
apply(compiler: Compiler): void;
writeModule(filePath: string, contents: string): void;
private getVirtualFileStore;
static __internal__take_virtual_files(compiler: Compiler): {
path: string;
content: string;
}[] | undefined;
}

56
node_modules/@rspack/core/dist/Watching.d.ts generated vendored Normal file
View File

@@ -0,0 +1,56 @@
/**
* The following code is modified based on
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/Watching.js
*
* MIT Licensed
* Author Tobias Koppers @sokra
* Copyright (c) JS Foundation and other contributors
* https://github.com/webpack/webpack/blob/main/LICENSE
*/
import type { Callback } from "@rspack/lite-tapable";
import type { Compiler } from ".";
import { Stats } from ".";
import type { WatchOptions } from "./config";
import type { Watcher } from "./util/fs";
export declare class Watching {
#private;
watcher?: Watcher;
pausedWatcher?: Watcher;
compiler: Compiler;
handler: Callback<Error, Stats>;
callbacks: Callback<Error, void>[];
watchOptions: WatchOptions;
lastWatcherStartTime: number;
running: boolean;
blocked: boolean;
isBlocked: () => boolean;
onChange: () => void;
onInvalid: () => void;
invalid: boolean;
startTime?: number;
suspended: boolean;
constructor(compiler: Compiler, watchOptions: WatchOptions, handler: Callback<Error, Stats>);
watch(files: Iterable<string> & {
added?: Iterable<string>;
removed?: Iterable<string>;
}, dirs: Iterable<string> & {
added?: Iterable<string>;
removed?: Iterable<string>;
}, missing: Iterable<string> & {
added?: Iterable<string>;
removed?: Iterable<string>;
}): void;
close(callback?: () => void): void;
invalidate(callback?: Callback<Error, void>): void;
/**
* @internal This is not a public API yet, still unstable, might change in the future
*/
invalidateWithChangesAndRemovals(changedFiles?: Set<string>, removedFiles?: Set<string>, callback?: Callback<Error, void>): void;
/**
* The reason why this is _done instead of #done, is that in Webpack,
* it will rewrite this function to another function
*/
private _done;
suspend(): void;
resume(): void;
}

View File

@@ -0,0 +1 @@
export * from "./swc";

View File

@@ -0,0 +1,117 @@
/**
MIT License
Copyright (c) 2021-present Devon Govett
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
export declare function toFeatures(featureOptions: FeatureOptions): Features;
export declare enum Features {
Empty = 0,
Nesting = 1,
NotSelectorList = 2,
DirSelector = 4,
LangSelectorList = 8,
IsSelector = 16,
TextDecorationThicknessPercent = 32,
MediaIntervalSyntax = 64,
MediaRangeSyntax = 128,
CustomMediaQueries = 256,
ClampFunction = 512,
ColorFunction = 1024,
OklabColors = 2048,
LabColors = 4096,
P3Colors = 8192,
HexAlphaColors = 16384,
SpaceSeparatedColorNotation = 32768,
FontFamilySystemUi = 65536,
DoublePositionGradients = 131072,
VendorPrefixes = 262144,
LogicalProperties = 524288,
Selectors = 31,
MediaQueries = 448,
Color = 64512
}
export interface Targets {
android?: number;
chrome?: number;
edge?: number;
firefox?: number;
ie?: number;
ios_saf?: number;
opera?: number;
safari?: number;
samsung?: number;
}
export interface Drafts {
/** Whether to enable @custom-media rules. */
customMedia?: boolean;
}
export interface NonStandard {
/** Whether to enable the non-standard >>> and /deep/ selector combinators used by Angular and Vue. */
deepSelectorCombinator?: boolean;
}
export interface PseudoClasses {
hover?: string;
active?: string;
focus?: string;
focusVisible?: string;
focusWithin?: string;
}
export type FeatureOptions = {
nesting?: boolean;
notSelectorList?: boolean;
dirSelector?: boolean;
langSelectorList?: boolean;
isSelector?: boolean;
textDecorationThicknessPercent?: boolean;
mediaIntervalSyntax?: boolean;
mediaRangeSyntax?: boolean;
customMediaQueries?: boolean;
clampFunction?: boolean;
colorFunction?: boolean;
oklabColors?: boolean;
labColors?: boolean;
p3Colors?: boolean;
hexAlphaColors?: boolean;
spaceSeparatedColorNotation?: boolean;
fontFamilySystemUi?: boolean;
doublePositionGradients?: boolean;
vendorPrefixes?: boolean;
logicalProperties?: boolean;
selectors?: boolean;
mediaQueries?: boolean;
color?: boolean;
};
export type LoaderOptions = {
minify?: boolean;
errorRecovery?: boolean;
targets?: Targets | string[] | string;
include?: FeatureOptions;
exclude?: FeatureOptions;
/**
* @deprecated Use `drafts` instead.
* This will be removed in the next major version.
*/
draft?: Drafts;
drafts?: Drafts;
nonStandard?: NonStandard;
pseudoClasses?: PseudoClasses;
unusedSymbols?: string[];
};

View File

@@ -0,0 +1,21 @@
export type CollectTypeScriptInfoOptions = {
/**
* Whether to collect type exports information for `typeReexportsPresence`.
* This is used to check type exports of submodules when running in `'tolerant'` mode.
* @default false
*/
typeExports?: boolean;
/**
* Whether to collect information about exported `enum`s.
* - `true` will collect all `enum` information, including `const enum`s and regular `enum`s.
* - `false` will not collect any `enum` information.
* - `'const-only'` will gather only `const enum`s, enabling Rspack to perform cross-module
* inlining optimizations for them.
* @default false
*/
exportedEnum?: boolean | "const-only";
};
export declare function resolveCollectTypeScriptInfo(options: CollectTypeScriptInfoOptions): {
typeExports: boolean | undefined;
exportedEnum: string;
};

View File

@@ -0,0 +1,5 @@
export type { CollectTypeScriptInfoOptions } from "./collectTypeScriptInfo";
export { resolveCollectTypeScriptInfo } from "./collectTypeScriptInfo";
export type { PluginImportOptions } from "./pluginImport";
export { resolvePluginImport } from "./pluginImport";
export type { SwcLoaderEnvConfig, SwcLoaderEsParserConfig, SwcLoaderJscConfig, SwcLoaderModuleConfig, SwcLoaderOptions, SwcLoaderParserConfig, SwcLoaderTransformConfig, SwcLoaderTsParserConfig } from "./types";

View File

@@ -0,0 +1,33 @@
type RawStyleConfig = {
styleLibraryDirectory?: string;
custom?: string;
css?: string;
bool?: boolean;
};
type RawPluginImportConfig = {
libraryName: string;
libraryDirectory?: string;
customName?: string;
customStyleName?: string;
style?: RawStyleConfig;
camelToDashComponentName?: boolean;
transformToDefaultImport?: boolean;
ignoreEsComponent?: string[];
ignoreStyleComponent?: string[];
};
type PluginImportConfig = {
libraryName: string;
libraryDirectory?: string;
customName?: string;
customStyleName?: string;
style?: string | boolean;
styleLibraryDirectory?: string;
camelToDashComponentName?: boolean;
transformToDefaultImport?: boolean;
ignoreEsComponent?: string[];
ignoreStyleComponent?: string[];
};
type PluginImportOptions = PluginImportConfig[];
declare function resolvePluginImport(pluginImport: PluginImportOptions): RawPluginImportConfig[] | undefined;
export { resolvePluginImport };
export type { PluginImportOptions };

View File

@@ -0,0 +1,83 @@
import type { Config, EnvConfig, EsParserConfig, JscConfig, ModuleConfig, ParserConfig, TerserEcmaVersion, TransformConfig, TsParserConfig } from "../../../compiled/@swc/types";
import type { CollectTypeScriptInfoOptions } from "./collectTypeScriptInfo";
import type { PluginImportOptions } from "./pluginImport";
export type SwcLoaderEnvConfig = EnvConfig;
export type SwcLoaderJscConfig = JscConfig;
export type SwcLoaderModuleConfig = ModuleConfig;
export type SwcLoaderParserConfig = ParserConfig;
export type SwcLoaderEsParserConfig = EsParserConfig;
export type SwcLoaderTsParserConfig = TsParserConfig;
export type SwcLoaderTransformConfig = TransformConfig;
export type SwcLoaderOptions = Config & {
isModule?: boolean | "unknown";
/**
* Experimental features provided by Rspack.
* @experimental
*/
rspackExperiments?: {
import?: PluginImportOptions;
/**
* Collects information from TypeScript's AST for consumption by subsequent Rspack processes,
* providing better TypeScript development experience and smaller output bundle size.
*/
collectTypeScriptInfo?: CollectTypeScriptInfoOptions;
};
};
export interface TerserCompressOptions {
arguments?: boolean;
arrows?: boolean;
booleans?: boolean;
booleans_as_integers?: boolean;
collapse_vars?: boolean;
comparisons?: boolean;
computed_props?: boolean;
conditionals?: boolean;
dead_code?: boolean;
defaults?: boolean;
directives?: boolean;
drop_console?: boolean;
drop_debugger?: boolean;
ecma?: TerserEcmaVersion;
evaluate?: boolean;
expression?: boolean;
global_defs?: any;
hoist_funs?: boolean;
hoist_props?: boolean;
hoist_vars?: boolean;
ie8?: boolean;
if_return?: boolean;
inline?: 0 | 1 | 2 | 3;
join_vars?: boolean;
keep_classnames?: boolean;
keep_fargs?: boolean;
keep_fnames?: boolean;
keep_infinity?: boolean;
loops?: boolean;
negate_iife?: boolean;
passes?: number;
properties?: boolean;
pure_getters?: any;
pure_funcs?: string[];
reduce_funcs?: boolean;
reduce_vars?: boolean;
sequences?: any;
side_effects?: boolean;
switches?: boolean;
top_retain?: any;
toplevel?: any;
typeofs?: boolean;
unsafe?: boolean;
unsafe_passes?: boolean;
unsafe_arrows?: boolean;
unsafe_comps?: boolean;
unsafe_function?: boolean;
unsafe_math?: boolean;
unsafe_symbols?: boolean;
unsafe_methods?: boolean;
unsafe_proto?: boolean;
unsafe_regexp?: boolean;
unsafe_undefined?: boolean;
unused?: boolean;
const_to_let?: boolean;
module?: boolean;
}

View File

@@ -0,0 +1,9 @@
export declare const APIPlugin: {
new (): {
name: string;
_args: [];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};

View File

@@ -0,0 +1,9 @@
export declare const ArrayPushCallbackChunkFormatPlugin: {
new (): {
name: string;
_args: [];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};

View File

@@ -0,0 +1,9 @@
export declare const AssetModulesPlugin: {
new (): {
name: string;
_args: [];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};

View File

@@ -0,0 +1,9 @@
export declare const AsyncWebAssemblyModulesPlugin: {
new (): {
name: string;
_args: [];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};

View File

@@ -0,0 +1,40 @@
import { type Chunk } from "@rspack/binding";
export type Rule = string | RegExp;
export type Rules = Rule[] | Rule;
export type BannerFunction = (args: {
hash: string;
chunk: Chunk;
filename: string;
}) => string;
export type BannerContent = string | BannerFunction;
export type BannerPluginOptions = {
/** Specifies the banner, it will be wrapped in a comment. */
banner: BannerContent;
/** If true, the banner will only be added to the entry chunks. */
entryOnly?: boolean;
/** Exclude all modules matching any of these conditions. */
exclude?: Rules;
/** Include all modules matching any of these conditions. */
include?: Rules;
/** If true, banner will not be wrapped in a comment. */
raw?: boolean;
/** If true, banner will be placed at the end of the output. */
footer?: boolean;
/**
* The stage of the compilation in which the banner should be injected.
* @default PROCESS_ASSETS_STAGE_ADDITIONS (-100)
*/
stage?: number;
/** Include all modules that pass test assertion. */
test?: Rules;
};
export type BannerPluginArgument = BannerContent | BannerPluginOptions;
export declare const BannerPlugin: {
new (args: BannerPluginArgument): {
name: string;
_args: [args: BannerPluginArgument];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};

View File

@@ -0,0 +1,14 @@
export type BundleInfoOptions = {
version?: string;
bundler?: string;
force?: boolean | string[];
};
export declare const BundlerInfoRspackPlugin: {
new (options: BundleInfoOptions): {
name: string;
_args: [options: BundleInfoOptions];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};

View File

@@ -0,0 +1,9 @@
export declare const ChunkPrefetchPreloadPlugin: {
new (): {
name: string;
_args: [];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};

View File

@@ -0,0 +1,59 @@
import { type BuiltinPlugin, BuiltinPluginName } from "@rspack/binding";
import type { Compilation } from "../Compilation";
import type { Compiler } from "../Compiler";
import type { Module } from "../Module";
import { RspackBuiltinPlugin } from "./base";
export type CircularDependencyRspackPluginOptions = {
/**
* When `true`, the plugin will emit `ERROR` diagnostics rather than the
* default `WARN` level.
*/
failOnError?: boolean;
/**
* When `true`, asynchronous imports like `import("some-module")` will not
* be considered connections that can create cycles.
*/
allowAsyncCycles?: boolean;
/**
* Cycles containing any module name that matches this regex will _not_ be
* counted as a cycle.
*/
exclude?: RegExp;
/**
* List of dependency connections that should not count for creating cycles.
* Connections are represented as `[from, to]`, where each entry is matched
* against the _identifier_ for that module in the connection. The
* identifier contains the full, unique path for the module, including all
* of the loaders that were applied to it and any request parameters.
*
* When an entry is a String, it is tested as a _substring_ of the
* identifier. For example, the entry "components/Button" would match the
* module "app/design/components/Button.tsx". When the entry is a RegExp,
* it is tested against the entire identifier.
*/
ignoredConnections?: [string | RegExp, string | RegExp][];
/**
* Called once for every detected cycle. Providing this handler overrides the
* default behavior of adding diagnostics to the compilation.
*/
onDetected?(entrypoint: Module, modules: string[], compilation: Compilation): void;
/**
* Called once for every detected cycle that was ignored because of a rule,
* either from `exclude` or `ignoredConnections`.
*/
onIgnored?(entrypoint: Module, modules: string[], compilation: Compilation): void;
/**
* Called before cycle detection begins.
*/
onStart?(compilation: Compilation): void;
/**
* Called after cycle detection finishes.
*/
onEnd?(compilation: Compilation): void;
};
export declare class CircularDependencyRspackPlugin extends RspackBuiltinPlugin {
name: BuiltinPluginName;
_options: CircularDependencyRspackPluginOptions;
constructor(options: CircularDependencyRspackPluginOptions);
raw(compiler: Compiler): BuiltinPlugin;
}

View File

@@ -0,0 +1,9 @@
export declare const CommonJsChunkFormatPlugin: {
new (): {
name: string;
_args: [];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};

View File

@@ -0,0 +1,9 @@
export declare const ContextReplacementPlugin: {
new (resourceRegExp: RegExp, newContentResource?: any, newContentRecursive?: any, newContentRegExp?: any): {
name: string;
_args: [resourceRegExp: RegExp, newContentResource?: any, newContentRecursive?: any, newContentRegExp?: any];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};

View File

@@ -0,0 +1,14 @@
import { type RawCopyPattern } from "@rspack/binding";
export type CopyRspackPluginOptions = {
/** An array of objects that describe the copy operations to be performed. */
patterns: (string | (Pick<RawCopyPattern, "from"> & Partial<Omit<RawCopyPattern, "from">>))[];
};
export declare const CopyRspackPlugin: {
new (copy: CopyRspackPluginOptions): {
name: string;
_args: [copy: CopyRspackPluginOptions];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};

View File

@@ -0,0 +1,21 @@
import binding from "@rspack/binding";
export interface CssChunkingPluginOptions {
strict?: boolean;
minSize?: number;
maxSize?: number;
/**
* This plugin is intended to be generic, but currently requires some special handling for Next.js.
* A `next` option has been added to accommodate this.
* In the future, once the design of CssChunkingPlugin becomes more stable, this option may be removed.
*/
nextjs?: boolean;
}
export declare const CssChunkingPlugin: {
new (options?: CssChunkingPluginOptions | undefined): {
name: string;
_args: [options?: CssChunkingPluginOptions | undefined];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): binding.BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};

View File

@@ -0,0 +1,9 @@
export declare const CssModulesPlugin: {
new (): {
name: string;
_args: [];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};

View File

@@ -0,0 +1,9 @@
export declare const DataUriPlugin: {
new (): {
name: string;
_args: [];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};

View File

@@ -0,0 +1,16 @@
export type DefinePluginOptions = Record<string, CodeValue>;
export declare const DefinePlugin: {
new (define: DefinePluginOptions): {
name: string;
_args: [define: DefinePluginOptions];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};
type CodeValue = RecursiveArrayOrRecord<CodeValuePrimitive>;
type CodeValuePrimitive = null | undefined | RegExp | Function | string | number | boolean | bigint;
type RecursiveArrayOrRecord<T> = {
[index: string]: RecursiveArrayOrRecord<T>;
} | RecursiveArrayOrRecord<T>[] | T;
export {};

View File

@@ -0,0 +1,7 @@
import { type BuiltinPlugin, BuiltinPluginName } from "@rspack/binding";
import { RspackBuiltinPlugin } from "./base";
export declare class DeterministicChunkIdsPlugin extends RspackBuiltinPlugin {
name: BuiltinPluginName;
affectedHooks: "compilation";
raw(): BuiltinPlugin;
}

View File

@@ -0,0 +1,7 @@
import { type BuiltinPlugin, BuiltinPluginName } from "@rspack/binding";
import { RspackBuiltinPlugin } from "./base";
export declare class DeterministicModuleIdsPlugin extends RspackBuiltinPlugin {
name: BuiltinPluginName;
affectedHooks: "compilation";
raw(): BuiltinPlugin;
}

View File

@@ -0,0 +1,12 @@
export type DllEntryPluginOptions = {
name: string;
};
export declare const DllEntryPlugin: {
new (context: string, entries: string[], options: DllEntryPluginOptions): {
name: string;
_args: [context: string, entries: string[], options: DllEntryPluginOptions];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};

View File

@@ -0,0 +1,11 @@
import { type RawDllReferenceAgencyPluginOptions } from "@rspack/binding";
export type DllReferenceAgencyPluginOptions = RawDllReferenceAgencyPluginOptions;
export declare const DllReferenceAgencyPlugin: {
new (options: RawDllReferenceAgencyPluginOptions): {
name: string;
_args: [options: RawDllReferenceAgencyPluginOptions];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};

View File

@@ -0,0 +1,12 @@
import { type BuiltinPlugin, BuiltinPluginName } from "@rspack/binding";
import type { Compiler } from "../Compiler";
import type { EntryDynamicNormalized } from "../config";
import { RspackBuiltinPlugin } from "./base";
export declare class DynamicEntryPlugin extends RspackBuiltinPlugin {
private context;
private entry;
name: BuiltinPluginName;
affectedHooks: "make";
constructor(context: string, entry: EntryDynamicNormalized);
raw(compiler: Compiler): BuiltinPlugin | undefined;
}

View File

@@ -0,0 +1,9 @@
export declare const ElectronTargetPlugin: {
new (context?: string | undefined): {
name: string;
_args: [context?: string | undefined];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};

View File

@@ -0,0 +1,25 @@
/**
* The following code is modified based on
* https://github.com/webpack/webpack/blob/3919c84/lib/javascript/EnableChunkLoadingPlugin.js
*
* MIT Licensed
* Author Tobias Koppers @sokra
* Copyright (c) JS Foundation and other contributors
* https://github.com/webpack/webpack/blob/main/LICENSE
*/
import type { ChunkLoadingType, Compiler } from "../exports";
declare const EnableChunkLoadingPluginInner: {
new (type: string): {
name: string;
_args: [type: string];
affectedHooks: keyof import("../Compiler").CompilerHooks | undefined;
raw(compiler: Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: Compiler): void;
};
};
export declare class EnableChunkLoadingPlugin extends EnableChunkLoadingPluginInner {
static setEnabled(compiler: Compiler, type: ChunkLoadingType): void;
static checkEnabled(compiler: Compiler, type: ChunkLoadingType): void;
apply(compiler: Compiler): void;
}
export {};

View File

@@ -0,0 +1,11 @@
import { type BuiltinPlugin, BuiltinPluginName } from "@rspack/binding";
import type { Compiler, LibraryType } from "..";
import { RspackBuiltinPlugin } from "./base";
export declare class EnableLibraryPlugin extends RspackBuiltinPlugin {
private type;
name: BuiltinPluginName;
constructor(type: LibraryType);
static setEnabled(compiler: Compiler, type: LibraryType): void;
static checkEnabled(compiler: Compiler, type: LibraryType): void;
raw(compiler: Compiler): BuiltinPlugin | undefined;
}

View File

@@ -0,0 +1,9 @@
export declare const EnableWasmLoadingPlugin: {
new (type: string): {
name: string;
_args: [type: string];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};

View File

@@ -0,0 +1,9 @@
export declare const EnsureChunkConditionsPlugin: {
new (): {
name: string;
_args: [];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};

View File

@@ -0,0 +1,32 @@
import { EntryDependency, type JsEntryOptions } from "@rspack/binding";
import type { EntryDescriptionNormalized } from "../config";
/**
* Options for the `EntryPlugin`.
*/
export type EntryOptions = Omit<EntryDescriptionNormalized, "import"> & {
/**
* The name of the entry chunk.
*/
name?: string;
};
/**
* The entry plugin that will handle creation of the `EntryDependency`.
* It adds an entry chunk on compilation. The chunk is named `options.name` and
* contains only one module (plus dependencies). The module is resolved from
* `entry` in `context` (absolute path).
*/
declare const OriginEntryPlugin: {
new (context: string, entry: string, options?: string | EntryOptions | undefined): {
name: string;
_args: [context: string, entry: string, options?: string | EntryOptions | undefined];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};
type EntryPluginType = typeof OriginEntryPlugin & {
createDependency(entry: string): EntryDependency;
};
export declare const EntryPlugin: EntryPluginType;
export declare function getRawEntryOptions(entry: EntryOptions): JsEntryOptions;
export {};

View File

@@ -0,0 +1,11 @@
import type { Compiler } from "../Compiler";
export declare class EsmLibraryPlugin {
static PLUGIN_NAME: string;
options?: {
preserveModules?: string;
};
constructor(options?: {
preserveModules?: string;
});
apply(compiler: Compiler): void;
}

View File

@@ -0,0 +1,11 @@
import { type RawEvalDevToolModulePluginOptions } from "@rspack/binding";
export type { RawEvalDevToolModulePluginOptions as EvalDevToolModulePluginOptions };
export declare const EvalDevToolModulePlugin: {
new (options: RawEvalDevToolModulePluginOptions): {
name: string;
_args: [options: RawEvalDevToolModulePluginOptions];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};

View File

@@ -0,0 +1,10 @@
import { type SourceMapDevToolPluginOptions } from "@rspack/binding";
export declare const EvalSourceMapDevToolPlugin: {
new (options: SourceMapDevToolPluginOptions): {
name: string;
_args: [options: SourceMapDevToolPluginOptions];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};

View File

@@ -0,0 +1,12 @@
import { type BuiltinPlugin, BuiltinPluginName } from "@rspack/binding";
import type { Externals } from "..";
import { RspackBuiltinPlugin } from "./base";
export declare class ExternalsPlugin extends RspackBuiltinPlugin {
#private;
private type;
private externals;
private placeInInitial?;
name: BuiltinPluginName;
constructor(type: string, externals: Externals, placeInInitial?: boolean | undefined);
raw(): BuiltinPlugin | undefined;
}

View File

@@ -0,0 +1,9 @@
export declare const FetchCompileAsyncWasmPlugin: {
new (): {
name: string;
_args: [];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};

View File

@@ -0,0 +1,9 @@
export declare const FileUriPlugin: {
new (): {
name: string;
_args: [];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};

View File

@@ -0,0 +1,9 @@
export declare const FlagAllModulesAsUsedPlugin: {
new (explanation: string): {
name: string;
_args: [explanation: string];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};

View File

@@ -0,0 +1,9 @@
export declare const FlagDependencyExportsPlugin: {
new (): {
name: string;
_args: [];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};

View File

@@ -0,0 +1,9 @@
import { type BuiltinPlugin, BuiltinPluginName } from "@rspack/binding";
import { RspackBuiltinPlugin } from "./base";
export declare class FlagDependencyUsagePlugin extends RspackBuiltinPlugin {
private global;
name: BuiltinPluginName;
affectedHooks: "compilation";
constructor(global: boolean);
raw(): BuiltinPlugin;
}

View File

@@ -0,0 +1,7 @@
import { type BuiltinPlugin, BuiltinPluginName } from "@rspack/binding";
import type { Compiler } from "../Compiler";
import { RspackBuiltinPlugin } from "./base";
export declare class HotModuleReplacementPlugin extends RspackBuiltinPlugin {
name: BuiltinPluginName;
raw(compiler: Compiler): BuiltinPlugin;
}

View File

@@ -0,0 +1,9 @@
export declare const HttpExternalsRspackPlugin: {
new (css: boolean, webAsync: boolean): {
name: string;
_args: [css: boolean, webAsync: boolean];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};

View File

@@ -0,0 +1,36 @@
import { type BuiltinPlugin, BuiltinPluginName, type RawHttpUriPluginOptions } from "@rspack/binding";
import type { Compiler } from "../Compiler";
import { RspackBuiltinPlugin } from "./base";
export type HttpUriPluginOptionsAllowedUris = (string | RegExp)[];
export type HttpUriPluginOptions = {
/**
* A list of allowed URIs
*/
allowedUris: HttpUriPluginOptionsAllowedUris;
/**
* Define the location to store the lockfile
*/
lockfileLocation?: string;
/**
* Define the location for caching remote resources
*/
cacheLocation?: string | false;
/**
* Detect changes to remote resources and upgrade them automatically
*/
upgrade?: boolean;
/**
* Custom http client
*/
httpClient?: RawHttpUriPluginOptions["httpClient"];
};
/**
* Plugin that allows loading modules from HTTP URLs
*/
export declare class HttpUriPlugin extends RspackBuiltinPlugin {
private options;
name: BuiltinPluginName;
affectedHooks: "compilation";
constructor(options: HttpUriPluginOptions);
raw(compiler: Compiler): BuiltinPlugin | undefined;
}

View File

@@ -0,0 +1,19 @@
import { type RawIgnorePluginOptions } from "@rspack/binding";
export type IgnorePluginOptions = {
/** A RegExp to test the resource against. */
resourceRegExp: NonNullable<RawIgnorePluginOptions["resourceRegExp"]>;
/** A RegExp to test the context (directory) against. */
contextRegExp?: RawIgnorePluginOptions["contextRegExp"];
} | {
/** A Filter function that receives `resource` and `context` as arguments, must return boolean. */
checkResource: NonNullable<RawIgnorePluginOptions["checkResource"]>;
};
export declare const IgnorePlugin: {
new (options: IgnorePluginOptions): {
name: string;
_args: [options: IgnorePluginOptions];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};

View File

@@ -0,0 +1,9 @@
export declare const InferAsyncModulesPlugin: {
new (): {
name: string;
_args: [];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};

View File

@@ -0,0 +1,9 @@
export declare const InlineExportsPlugin: {
new (): {
name: string;
_args: [];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};

View File

@@ -0,0 +1,15 @@
import { type BuiltinPlugin, BuiltinPluginName } from "@rspack/binding";
import * as liteTapable from "@rspack/lite-tapable";
import type { Chunk } from "../Chunk";
import { type Compilation } from "../Compilation";
import type Hash from "../util/hash";
import { RspackBuiltinPlugin } from "./base";
export type CompilationHooks = {
chunkHash: liteTapable.SyncHook<[Chunk, Hash]>;
};
export declare class JavascriptModulesPlugin extends RspackBuiltinPlugin {
name: BuiltinPluginName;
affectedHooks: "compilation";
raw(): BuiltinPlugin;
static getCompilationHooks(compilation: Compilation): CompilationHooks;
}

View File

@@ -0,0 +1,10 @@
import type { Compiler } from "../Compiler";
export declare const JsLoaderRspackPlugin: {
new (compiler: Compiler): {
name: string;
_args: [compiler: Compiler];
affectedHooks: keyof import("../Compiler").CompilerHooks | undefined;
raw(compiler: Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: Compiler): void;
};
};

View File

@@ -0,0 +1,9 @@
export declare const JsonModulesPlugin: {
new (): {
name: string;
_args: [];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};

View File

@@ -0,0 +1,17 @@
export type LibManifestPluginOptions = {
context?: string;
entryOnly?: boolean;
format?: boolean;
name?: string;
path: string;
type?: string;
};
export declare const LibManifestPlugin: {
new (options: LibManifestPluginOptions): {
name: string;
_args: [options: LibManifestPluginOptions];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};

View File

@@ -0,0 +1,32 @@
import { type Drafts, type FeatureOptions, type NonStandard, type PseudoClasses } from "../builtin-loader/lightningcss";
import type { AssetConditions } from "../util/assetCondition";
export type LightningCssMinimizerRspackPluginOptions = {
test?: AssetConditions;
include?: AssetConditions;
exclude?: AssetConditions;
removeUnusedLocalIdents?: boolean;
minimizerOptions?: {
errorRecovery?: boolean;
targets?: string[] | string;
include?: FeatureOptions;
exclude?: FeatureOptions;
/**
* @deprecated Use `drafts` instead.
* This will be removed in the next major version.
*/
draft?: Drafts;
drafts?: Drafts;
nonStandard?: NonStandard;
pseudoClasses?: PseudoClasses;
unusedSymbols?: string[];
};
};
export declare const LightningCssMinimizerRspackPlugin: {
new (options?: LightningCssMinimizerRspackPluginOptions | undefined): {
name: string;
_args: [options?: LightningCssMinimizerRspackPluginOptions | undefined];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};

View File

@@ -0,0 +1,14 @@
export type LimitChunkCountOptions = {
chunkOverhead?: number;
entryChunkMultiplicator?: number;
maxChunks: number;
};
export declare const LimitChunkCountPlugin: {
new (options: LimitChunkCountOptions): {
name: string;
_args: [options: LimitChunkCountOptions];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};

View File

@@ -0,0 +1,9 @@
import { type BuiltinPlugin, BuiltinPluginName } from "@rspack/binding";
import { RspackBuiltinPlugin } from "./base";
export declare class MangleExportsPlugin extends RspackBuiltinPlugin {
private deterministic;
name: BuiltinPluginName;
affectedHooks: "compilation";
constructor(deterministic: boolean);
raw(): BuiltinPlugin;
}

View File

@@ -0,0 +1,9 @@
export declare const MergeDuplicateChunksPlugin: {
new (): {
name: string;
_args: [];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};

View File

@@ -0,0 +1,9 @@
export declare const ModuleChunkFormatPlugin: {
new (): {
name: string;
_args: [];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};

View File

@@ -0,0 +1,7 @@
import { type BuiltinPlugin, BuiltinPluginName } from "@rspack/binding";
import { RspackBuiltinPlugin } from "./base";
export declare class ModuleConcatenationPlugin extends RspackBuiltinPlugin {
name: BuiltinPluginName;
affectedHooks: "compilation";
raw(): BuiltinPlugin;
}

View File

@@ -0,0 +1,9 @@
export declare const ModuleInfoHeaderPlugin: {
new (verbose: any): {
name: string;
_args: [verbose: any];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};

View File

@@ -0,0 +1,9 @@
export declare const NamedChunkIdsPlugin: {
new (): {
name: string;
_args: [];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};

View File

@@ -0,0 +1,9 @@
export declare const NamedModuleIdsPlugin: {
new (): {
name: string;
_args: [];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};

View File

@@ -0,0 +1,7 @@
import { type BuiltinPlugin, BuiltinPluginName } from "@rspack/binding";
import { RspackBuiltinPlugin } from "./base";
export declare class NaturalChunkIdsPlugin extends RspackBuiltinPlugin {
name: BuiltinPluginName;
affectedHooks: "compilation";
raw(): BuiltinPlugin;
}

View File

@@ -0,0 +1,7 @@
import { type BuiltinPlugin, BuiltinPluginName } from "@rspack/binding";
import { RspackBuiltinPlugin } from "./base";
export declare class NaturalModuleIdsPlugin extends RspackBuiltinPlugin {
name: BuiltinPluginName;
affectedHooks: "compilation";
raw(): BuiltinPlugin;
}

View File

@@ -0,0 +1,9 @@
export declare const NoEmitOnErrorsPlugin: {
new (): {
name: string;
_args: [];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};

Some files were not shown because too many files have changed in this diff Show More