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

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;
};
};

View File

@@ -0,0 +1,9 @@
export declare const NodeTargetPlugin: {
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,10 @@
import type { ResolveData } from "../Module";
export declare const NormalModuleReplacementPlugin: {
new (resourceRegExp: RegExp, newResource: string | ((data: ResolveData) => void)): {
name: string;
_args: [resourceRegExp: RegExp, newResource: string | ((data: ResolveData) => void)];
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 RawOccurrenceChunkIdsPluginOptions } from "@rspack/binding";
export declare const OccurrenceChunkIdsPlugin: {
new (options?: RawOccurrenceChunkIdsPluginOptions | undefined): {
name: string;
_args: [options?: RawOccurrenceChunkIdsPluginOptions | undefined];
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 RawProgressPluginOptions } from "@rspack/binding";
export type ProgressPluginArgument = Partial<Omit<RawProgressPluginOptions, "handler">> | ((percentage: number, msg: string, ...args: string[]) => void) | undefined;
export declare const ProgressPlugin: {
new (progress?: ProgressPluginArgument): {
name: string;
_args: [progress?: ProgressPluginArgument];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};

View File

@@ -0,0 +1,10 @@
export type ProvidePluginOptions = Record<string, string | string[]>;
export declare const ProvidePlugin: {
new (provide: ProvidePluginOptions): {
name: string;
_args: [provide: ProvidePluginOptions];
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 RealContentHashPlugin: {
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 RemoveDuplicateModulesPlugin: {
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 RemoveEmptyChunksPlugin: {
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,49 @@
import { type JsRsdoctorAsset, type JsRsdoctorAssetPatch, type JsRsdoctorChunk, type JsRsdoctorChunkAssets, type JsRsdoctorChunkGraph, type JsRsdoctorChunkModules, type JsRsdoctorDependency, type JsRsdoctorEntrypoint, type JsRsdoctorEntrypointAssets, type JsRsdoctorExportInfo, type JsRsdoctorModule, type JsRsdoctorModuleGraph, type JsRsdoctorModuleGraphModule, type JsRsdoctorModuleIdsPatch, type JsRsdoctorModuleOriginalSource, type JsRsdoctorModuleSourcesPatch, type JsRsdoctorSideEffect, type JsRsdoctorSourcePosition, type JsRsdoctorSourceRange, type JsRsdoctorStatement, type JsRsdoctorVariable } from "@rspack/binding";
import * as liteTapable from "@rspack/lite-tapable";
import { type Compilation } from "../Compilation";
import type { Compiler } from "../Compiler";
import type { CreatePartialRegisters } from "../taps/types";
export declare namespace RsdoctorPluginData {
export type { JsRsdoctorAsset as RsdoctorAsset, JsRsdoctorChunkGraph as RsdoctorChunkGraph, JsRsdoctorModuleGraph as RsdoctorModuleGraph, JsRsdoctorChunk as RsdoctorChunk, JsRsdoctorModule as RsdoctorModule, JsRsdoctorSideEffect as RsdoctorSideEffect, JsRsdoctorExportInfo as RsdoctorExportInfo, JsRsdoctorVariable as RsdoctorVariable, JsRsdoctorDependency as RsdoctorDependency, JsRsdoctorEntrypoint as RsdoctorEntrypoint, JsRsdoctorStatement as RsdoctorStatement, JsRsdoctorSourceRange as RsdoctorSourceRange, JsRsdoctorSourcePosition as RsdoctorSourcePosition, JsRsdoctorModuleGraphModule as RsdoctorModuleGraphModule, JsRsdoctorModuleIdsPatch as RsdoctorModuleIdsPatch, JsRsdoctorModuleOriginalSource as RsdoctorModuleOriginalSource, JsRsdoctorAssetPatch as RsdoctorAssetPatch, JsRsdoctorChunkAssets as RsdoctorChunkAssets, JsRsdoctorEntrypointAssets as RsdoctorEntrypointAssets, JsRsdoctorChunkModules as RsdoctorChunkModules, JsRsdoctorModuleSourcesPatch as RsdoctorModuleSourcesPatch };
}
export type RsdoctorPluginOptions = {
moduleGraphFeatures?: boolean | ("graph" | "ids" | "sources")[];
chunkGraphFeatures?: boolean | ("graph" | "assets")[];
sourceMapFeatures?: {
module?: boolean;
cheap?: boolean;
};
};
declare const RsdoctorPluginImpl: {
new (c?: RsdoctorPluginOptions | undefined): {
name: string;
_args: [c?: RsdoctorPluginOptions | undefined];
affectedHooks: keyof import("../Compiler").CompilerHooks | undefined;
raw(compiler: Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: Compiler): void;
};
};
export type RsdoctorPluginHooks = {
moduleGraph: liteTapable.AsyncSeriesBailHook<[
JsRsdoctorModuleGraph
], false | void>;
chunkGraph: liteTapable.AsyncSeriesBailHook<[
JsRsdoctorChunkGraph
], false | void>;
moduleIds: liteTapable.AsyncSeriesBailHook<[
JsRsdoctorModuleIdsPatch
], false | void>;
moduleSources: liteTapable.AsyncSeriesBailHook<[
JsRsdoctorModuleSourcesPatch
], false | void>;
assets: liteTapable.AsyncSeriesBailHook<[JsRsdoctorAssetPatch], false | void>;
};
declare const RsdoctorPlugin: typeof RsdoctorPluginImpl & {
/**
* @deprecated Use `getCompilationHooks` instead.
*/
getHooks: (compilation: Compilation) => RsdoctorPluginHooks;
getCompilationHooks: (compilation: Compilation) => RsdoctorPluginHooks;
};
export declare const createRsdoctorPluginHooksRegisters: CreatePartialRegisters<`RsdoctorPlugin`>;
export { RsdoctorPlugin };

View File

@@ -0,0 +1,11 @@
import { type RawRslibPluginOptions } from "@rspack/binding";
export type RslibPluginArgument = Partial<Omit<RawRslibPluginOptions, "handler">> | ((percentage: number, msg: string, ...args: string[]) => void) | undefined;
export declare const RslibPlugin: {
new (rslib: RawRslibPluginOptions): {
name: string;
_args: [rslib: RawRslibPluginOptions];
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 RawRstestPluginOptions } from "@rspack/binding";
export type RstestPluginArgument = Partial<Omit<RawRstestPluginOptions, "handler">> | ((percentage: number, msg: string, ...args: string[]) => void) | undefined;
export declare const RstestPlugin: {
new (rstest: RawRstestPluginOptions): {
name: string;
_args: [rstest: RawRstestPluginOptions];
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 RawRuntimeChunkOptions } from "@rspack/binding";
export type RuntimeChunkPluginOptions = RawRuntimeChunkOptions;
export declare const RuntimeChunkPlugin: {
new (options: RawRuntimeChunkOptions): {
name: string;
_args: [options: RawRuntimeChunkOptions];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};

View File

@@ -0,0 +1,29 @@
import binding from "@rspack/binding";
import * as liteTapable from "@rspack/lite-tapable";
import type { Chunk } from "../Chunk";
import { type Compilation } from "../Compilation";
import type { CreatePartialRegisters } from "../taps/types";
export declare const RuntimePluginImpl: {
new (): {
name: string;
_args: [];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): binding.BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};
export type RuntimePluginHooks = {
createScript: liteTapable.SyncWaterfallHook<[string, Chunk]>;
createLink: liteTapable.SyncWaterfallHook<[string, Chunk]>;
linkPreload: liteTapable.SyncWaterfallHook<[string, Chunk]>;
linkPrefetch: liteTapable.SyncWaterfallHook<[string, Chunk]>;
};
declare const RuntimePlugin: typeof RuntimePluginImpl & {
/**
* @deprecated Use `getCompilationHooks` instead.
*/
getHooks: (compilation: Compilation) => RuntimePluginHooks;
getCompilationHooks: (compilation: Compilation) => RuntimePluginHooks;
};
export declare const createRuntimePluginHooksRegisters: CreatePartialRegisters<`RuntimePlugin`>;
export { RuntimePlugin };

View File

@@ -0,0 +1,9 @@
export declare const SideEffectsFlagPlugin: {
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,19 @@
export declare const SizeLimitsPlugin: {
new (options: {
assetFilter?: (assetFilename: string) => boolean;
hints?: false | "warning" | "error";
maxAssetSize?: number;
maxEntrypointSize?: number;
}): {
name: string;
_args: [options: {
assetFilter?: (assetFilename: string) => boolean;
hints?: false | "warning" | "error";
maxAssetSize?: number;
maxEntrypointSize?: number;
}];
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 SourceMapDevToolPluginOptions } from "@rspack/binding";
export type { SourceMapDevToolPluginOptions };
export declare const SourceMapDevToolPlugin: {
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,11 @@
import { type BuiltinPlugin, BuiltinPluginName } from "@rspack/binding";
import type { Compiler } from "../Compiler";
import type { OptimizationSplitChunksOptions } from "../config";
import { RspackBuiltinPlugin } from "./base";
export declare class SplitChunksPlugin extends RspackBuiltinPlugin {
private options;
name: BuiltinPluginName;
affectedHooks: "thisCompilation";
constructor(options: OptimizationSplitChunksOptions);
raw(compiler: Compiler): BuiltinPlugin;
}

View File

@@ -0,0 +1,39 @@
import { type RawSubresourceIntegrityPluginOptions } from "@rspack/binding";
import type { Compiler } from "../Compiler";
export type SubresourceIntegrityHashFunction = "sha256" | "sha384" | "sha512";
export type SubresourceIntegrityPluginOptions = {
hashFuncNames?: [
SubresourceIntegrityHashFunction,
...SubresourceIntegrityHashFunction[]
];
htmlPlugin?: string | false;
enabled?: "auto" | boolean;
};
export type NativeSubresourceIntegrityPluginOptions = Omit<RawSubresourceIntegrityPluginOptions, "htmlPlugin"> & {
htmlPlugin: string | false;
};
/**
* Note: This is not a webpack public API, maybe removed in future.
* @internal
*/
declare const NativeSubresourceIntegrityPlugin: {
new (options: NativeSubresourceIntegrityPluginOptions): {
name: string;
_args: [options: NativeSubresourceIntegrityPluginOptions];
affectedHooks: keyof import("../Compiler").CompilerHooks | undefined;
raw(compiler: Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: Compiler): void;
};
};
export declare class SubresourceIntegrityPlugin extends NativeSubresourceIntegrityPlugin {
private integrities;
private options;
constructor(options?: SubresourceIntegrityPluginOptions);
private isEnabled;
private getIntegrityChecksumForAsset;
private handleHwpPluginArgs;
private handleHwpBodyTags;
private processTag;
apply(compiler: Compiler): void;
}
export {};

View File

@@ -0,0 +1,215 @@
import type { LiteralUnion } from "../config";
import type { AssetConditions } from "../util/assetCondition";
type ExtractCommentsCondition = boolean | RegExp;
type ExtractCommentsBanner = string | boolean;
type ExtractCommentsObject = {
condition?: ExtractCommentsCondition | undefined;
banner?: ExtractCommentsBanner | undefined;
};
type ExtractCommentsOptions = ExtractCommentsCondition | ExtractCommentsObject;
export type SwcJsMinimizerRspackPluginOptions = {
test?: AssetConditions;
exclude?: AssetConditions;
include?: AssetConditions;
extractComments?: ExtractCommentsOptions | undefined;
minimizerOptions?: {
minify?: boolean;
ecma?: TerserEcmaVersion;
compress?: TerserCompressOptions | boolean;
mangle?: TerserMangleOptions | boolean;
format?: JsFormatOptions & ToSnakeCaseProperties<JsFormatOptions>;
module?: boolean;
};
};
/**
* @example ToSnakeCase<'indentLevel'> == 'indent_level'
*/
type ToSnakeCase<T extends string> = T extends `${infer A}${infer B}` ? `${A extends Lowercase<A> ? A : `_${Lowercase<A>}`}${ToSnakeCase<B>}` : T;
/**
* @example ToSnakeCaseProperties\<{indentLevel: 3\}\> == {indent_level: 3\}
*/
type ToSnakeCaseProperties<T> = {
[K in keyof T as K extends string ? ToSnakeCase<K> : K]: T[K];
};
export interface JsFormatOptions {
/**
* Currently noop.
* @default false
* @alias ascii_only
*/
asciiOnly?: boolean;
/**
* Currently noop.
* @default false
*/
beautify?: boolean;
/**
* Currently noop.
* @default false
*/
braces?: boolean;
/**
* - `false`: removes all comments
* - `'some'`: preserves some comments
* - `'all'`: preserves all comments
* @default false
*/
comments?: false | "some" | "all";
/**
* Currently noop.
* @default 5
*/
ecma?: TerserEcmaVersion;
/**
* Currently noop.
* @alias indent_level
*/
indentLevel?: number;
/**
* Currently noop.
* @alias indent_start
*/
indentStart?: number;
inlineScript?: number;
/**
* Currently noop.
* @alias keep_numbers
*/
keepNumbers?: number;
/**
* Currently noop.
* @alias keep_quoted_props
*/
keepQuotedProps?: boolean;
/**
* Currently noop.
* @alias max_line_len
*/
maxLineLen?: number | false;
/**
* When passed it must be a string and it will be prepended to the output literally.
* The source map will adjust for this text. Can be used to insert a comment containing licensing information.
*/
preamble?: string;
/**
* Currently noop.
* @alias quote_keys
*/
quoteKeys?: boolean;
/**
* Currently noop.
* @alias quote_style
*/
quoteStyle?: boolean;
/**
* Currently noop.
* @alias preserve_annotations
*/
preserveAnnotations?: boolean;
/**
* Currently noop.
*/
safari10?: boolean;
/**
* Currently noop.
*/
semicolons?: boolean;
/**
* Currently noop.
*/
shebang?: boolean;
/**
* Currently noop.
*/
webkit?: boolean;
/**
* Currently noop.
* @alias wrap_iife
*/
wrapIife?: boolean;
/**
* Currently noop.
* @alias wrap_func_args
*/
wrapFuncArgs?: boolean;
}
export type TerserEcmaVersion = LiteralUnion<5 | 2015 | 2016, number> | string;
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;
}
export interface TerserMangleOptions {
props?: TerserManglePropertiesOptions;
toplevel?: boolean;
keep_classnames?: boolean;
keep_fnames?: boolean;
keep_private_props?: boolean;
ie8?: boolean;
safari10?: boolean;
reserved?: string[];
}
export type TerserManglePropertiesOptions = {};
export declare const SwcJsMinimizerRspackPlugin: {
new (options?: SwcJsMinimizerRspackPluginOptions | undefined): {
name: string;
_args: [options?: SwcJsMinimizerRspackPluginOptions | undefined];
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("..").Compiler): void;
};
};
export {};

View File

@@ -0,0 +1,9 @@
export declare const URLPlugin: {
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 WarnCaseSensitiveModulesPlugin: {
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 type { Compiler } from "../Compiler";
import { RspackBuiltinPlugin } from "./base";
export declare class WebWorkerTemplatePlugin extends RspackBuiltinPlugin {
name: BuiltinPluginName;
raw(compiler: Compiler): BuiltinPlugin | undefined;
}

View File

@@ -0,0 +1,13 @@
import { type BuiltinPlugin, BuiltinPluginName } from "@rspack/binding";
import type { Compiler } from "../Compiler";
import type { ChunkLoading, OutputModule, WasmLoading, WorkerPublicPath } from "../config";
import { RspackBuiltinPlugin } from "./base";
export declare class WorkerPlugin extends RspackBuiltinPlugin {
private chunkLoading;
private wasmLoading;
private module;
private workerPublicPath;
name: BuiltinPluginName;
constructor(chunkLoading: ChunkLoading, wasmLoading: WasmLoading, module: OutputModule, workerPublicPath: WorkerPublicPath);
raw(compiler: Compiler): BuiltinPlugin;
}

View File

@@ -0,0 +1,45 @@
import binding from "@rspack/binding";
import type { Compiler, RspackPluginInstance } from "..";
type AffectedHooks = keyof Compiler["hooks"];
export declare function canInherentFromParent(affectedHooks?: AffectedHooks): boolean;
export declare abstract class RspackBuiltinPlugin implements RspackPluginInstance {
abstract raw(compiler: Compiler): binding.BuiltinPlugin | undefined;
abstract name: binding.BuiltinPluginName | CustomPluginName;
affectedHooks?: AffectedHooks;
apply(compiler: Compiler): void;
}
export declare function createBuiltinPlugin<R>(name: binding.BuiltinPluginName | CustomPluginName, options: R): binding.BuiltinPlugin;
type CustomPluginName = string;
export declare function create<T extends any[], R>(name: binding.BuiltinPluginName | CustomPluginName, resolve: (this: Compiler, ...args: T) => R, affectedHooks?: AffectedHooks): {
new (...args: T): {
name: string;
_args: T;
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: Compiler): binding.BuiltinPlugin;
apply(compiler: Compiler): void;
};
};
/**
* Create a wrapper class for builtin plugin.
*
* @example
* ```js
* const MyPlugin = createNativePlugin("MyPlugin", (options) => {
* return options;
* });
*
* new MyPlugin({
* foo: "bar"
* }).apply(compiler);
* ```
*/
export declare function createNativePlugin<T extends any[], R>(name: CustomPluginName, resolve: (this: Compiler, ...args: T) => R, affectedHooks?: AffectedHooks): {
new (...args: T): {
name: string;
_args: T;
affectedHooks: keyof import("..").CompilerHooks | undefined;
raw(compiler: Compiler): binding.BuiltinPlugin;
apply(compiler: Compiler): void;
};
};
export {};

View File

@@ -0,0 +1,24 @@
import { type RawCssExtractPluginOption } from "@rspack/binding";
import type { Compiler, LiteralUnion } from "../..";
export * from "./loader";
export type { CssExtractRspackLoaderOptions } from "./loader";
export interface CssExtractRspackPluginOptions {
filename?: RawCssExtractPluginOption["filename"];
chunkFilename?: RawCssExtractPluginOption["chunkFilename"];
ignoreOrder?: boolean;
insert?: string | ((linkTag: HTMLLinkElement) => void);
attributes?: Record<string, string>;
linkType?: LiteralUnion<"text/css", string> | false;
runtime?: boolean;
pathinfo?: boolean;
enforceRelative?: boolean;
}
export declare class CssExtractRspackPlugin {
static pluginName: string;
static loader: string;
options: CssExtractRspackPluginOptions;
constructor(options?: CssExtractRspackPluginOptions);
apply(compiler: Compiler): void;
normalizeOptions(options: CssExtractRspackPluginOptions): RawCssExtractPluginOption;
}
export default CssExtractRspackPlugin;

View File

@@ -0,0 +1,21 @@
import type { LoaderContext, LoaderDefinition } from "../..";
export declare const BASE_URI = "rspack-css-extract://";
export declare const MODULE_TYPE = "css/mini-extract";
export declare const AUTO_PUBLIC_PATH = "__css_extract_public_path_auto__";
export declare const ABSOLUTE_PUBLIC_PATH = "rspack-css-extract:///css-extract-plugin/";
export declare const SINGLE_DOT_PATH_SEGMENT = "__css_extract_single_dot_path_segment__";
export interface CssExtractRspackLoaderOptions {
publicPath?: string | ((resourcePath: string, context: string) => string);
emit?: boolean;
esModule?: boolean;
layer?: string;
defaultExport?: boolean;
}
export declare function hotLoader(content: string, context: {
loaderContext: LoaderContext;
options?: CssExtractRspackLoaderOptions;
locals?: Record<string, string>;
}): string;
declare const loader: LoaderDefinition;
export declare const pitch: LoaderDefinition["pitch"];
export default loader;

View File

@@ -0,0 +1,6 @@
import type { LoaderContext } from "../..";
export declare function isAbsolutePath(str: string): boolean;
export declare const PLUGIN_NAME = "css-extract-rspack-plugin";
export declare function isRelativePath(str: string): boolean;
export declare function stringifyRequest(loaderContext: LoaderContext, request: string): string;
export declare function stringifyLocal(value: any): any;

View File

@@ -0,0 +1,32 @@
import type { JsAfterEmitData, JsAfterTemplateExecutionData, JsAlterAssetTagGroupsData, JsAlterAssetTagsData, JsBeforeAssetTagGenerationData, JsBeforeEmitData } from "@rspack/binding";
import * as liteTapable from "@rspack/lite-tapable";
import { type Compilation } from "../../Compilation";
import type { HtmlRspackPluginOptions } from "./options";
type ExtraPluginHookData = {
plugin: {
options: HtmlRspackPluginOptions;
};
};
export type HtmlRspackPluginHooks = {
beforeAssetTagGeneration: liteTapable.AsyncSeriesWaterfallHook<[
JsBeforeAssetTagGenerationData & ExtraPluginHookData
]>;
alterAssetTags: liteTapable.AsyncSeriesWaterfallHook<[
JsAlterAssetTagsData & ExtraPluginHookData
]>;
alterAssetTagGroups: liteTapable.AsyncSeriesWaterfallHook<[
JsAlterAssetTagGroupsData & ExtraPluginHookData
]>;
afterTemplateExecution: liteTapable.AsyncSeriesWaterfallHook<[
JsAfterTemplateExecutionData & ExtraPluginHookData
]>;
beforeEmit: liteTapable.AsyncSeriesWaterfallHook<[
JsBeforeEmitData & ExtraPluginHookData
]>;
afterEmit: liteTapable.AsyncSeriesWaterfallHook<[
JsAfterEmitData & ExtraPluginHookData
]>;
};
export declare const getPluginHooks: (compilation: Compilation) => HtmlRspackPluginHooks;
export declare const cleanPluginHooks: (compilation: Compilation) => void;
export {};

View File

@@ -0,0 +1,2 @@
export * from "./options";
export * from "./plugin";

View File

@@ -0,0 +1,82 @@
import { Compilation } from "../../Compilation";
export type TemplateRenderFunction = (params: Record<string, any>) => string | Promise<string>;
export type TemplateParamFunction = (params: Record<string, any>) => Record<string, any> | Promise<Record<string, any>>;
export type HtmlRspackPluginOptions = {
/** The title to use for the generated HTML document. */
title?: string;
/**
* The file to write the HTML to. You can specify a subdirectory here too (e.g.: `"pages/index.html"`).
* @default "index.html"
*/
filename?: string | ((entry: string) => string);
/** The template file path. */
template?: string;
/**
* The template file content, priority is greater than `template` option.
*
* When using a function, pass in the template parameters and use the returned string as the template content.
*/
templateContent?: string | TemplateRenderFunction;
/**
* Allows to overwrite the parameters used in the template.
*
* When using a function, pass in the original template parameters and use the returned object as the final template parameters.
*/
templateParameters?: Record<string, string> | boolean | TemplateParamFunction;
/**
* The script and link tag inject position in template. Use `false` to not inject.
* If not specified, it will be automatically determined based on `scriptLoading` value.
* @default true
*/
inject?: boolean | "head" | "body";
/** The public path used for script and link tags. */
publicPath?: string;
/** Inject a [`base`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base) tag. */
base?: string | {
href?: string;
target?: "_self" | "_blank" | "_parent" | "_top";
};
/**
* Modern browsers support non-blocking JavaScript loading ([`defer` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#defer)) to improve the page startup performance.
*
* Setting this option to `'module'` adds attribute `type="module"` to the `script`. This also implies `defer` attribute on the `script`, since modules are automatically deferred.
* @default "defer"
* */
scriptLoading?: "blocking" | "defer" | "module" | "systemjs-module";
/** Allows you to add only some chunks. */
chunks?: string[];
/** Allows you to skip some chunks. */
excludeChunks?: string[];
/**
* Allows to control how chunks should be sorted before they are included to the HTML.
* @default "auto"
*/
chunksSortMode?: "auto" | "manual";
/**
* Configure the SRI hash algorithm, which is disabled by default.
* @deprecated Use `experiments.SubresourceIntegrityPlugin` instead.
*/
sri?: "sha256" | "sha384" | "sha512";
/**
* Controls whether to minify the output, disabled by default.
*/
minify?: boolean;
/** Adds the given favicon path to the output HTML. */
favicon?: string;
/**
* Allows to inject meta-tags.
* @default {}
*/
meta?: Record<string, string | Record<string, string>>;
/**
* If `true` then append a unique Rspack compilation hash to all included scripts and CSS files. This is useful for cache busting.
*/
hash?: boolean;
/**
* Any other options will be passed by hooks.
*/
[key: string]: any;
};
export declare const getPluginOptions: (compilation: Compilation, uid: number) => any;
export declare const setPluginOptions: (compilation: Compilation, uid: number, options: HtmlRspackPluginOptions) => void;
export declare const cleanPluginOptions: (compilation: Compilation, uid: number) => void;

View File

@@ -0,0 +1,24 @@
import { type JsHtmlPluginTag } from "@rspack/binding";
import type { Compilation } from "../../Compilation";
import type { Compiler } from "../../Compiler";
import { type HtmlRspackPluginHooks } from "./hooks";
import { type HtmlRspackPluginOptions } from "./options";
declare const HtmlRspackPluginImpl: {
new (c?: HtmlRspackPluginOptions | undefined): {
name: string;
_args: [c?: HtmlRspackPluginOptions | undefined];
affectedHooks: keyof import("../../Compiler").CompilerHooks | undefined;
raw(compiler: Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: Compiler): void;
};
};
declare const HtmlRspackPlugin: typeof HtmlRspackPluginImpl & {
/**
* @deprecated Use `getCompilationHooks` instead.
*/
getHooks: (compilation: Compilation) => HtmlRspackPluginHooks;
getCompilationHooks: (compilation: Compilation) => HtmlRspackPluginHooks;
createHtmlTagObject: (tagName: string, attributes?: Record<string, string | boolean>, innerHTML?: string) => JsHtmlPluginTag;
version: number;
};
export { HtmlRspackPlugin };

View File

@@ -0,0 +1,2 @@
import type { CreatePartialRegisters } from "../../taps/types";
export declare const createHtmlPluginHooksRegisters: CreatePartialRegisters<`HtmlPlugin`>;

View File

@@ -0,0 +1,84 @@
export * from "./APIPlugin";
export * from "./ArrayPushCallbackChunkFormatPlugin";
export * from "./AssetModulesPlugin";
export * from "./AsyncWebAssemblyModulesPlugin";
export * from "./BannerPlugin";
export * from "./BundlerInfoRspackPlugin";
export { createNativePlugin, RspackBuiltinPlugin } from "./base";
export * from "./ChunkPrefetchPreloadPlugin";
export * from "./CircularDependencyRspackPlugin";
export * from "./CommonJsChunkFormatPlugin";
export * from "./ContextReplacementPlugin";
export * from "./CopyRspackPlugin";
export * from "./CssChunkingPlugin";
export * from "./CssModulesPlugin";
export * from "./css-extract/index";
export * from "./DataUriPlugin";
export * from "./DefinePlugin";
export * from "./DeterministicChunkIdsPlugin";
export * from "./DeterministicModuleIdsPlugin";
export * from "./DllEntryPlugin";
export * from "./DllReferenceAgencyPlugin";
export * from "./DynamicEntryPlugin";
export * from "./ElectronTargetPlugin";
export * from "./EnableChunkLoadingPlugin";
export * from "./EnableLibraryPlugin";
export * from "./EnableWasmLoadingPlugin";
export * from "./EnsureChunkConditionsPlugin";
export * from "./EntryPlugin";
export * from "./EsmLibraryPlugin";
export * from "./EvalDevToolModulePlugin";
export * from "./EvalSourceMapDevToolPlugin";
export * from "./ExternalsPlugin";
export * from "./FetchCompileAsyncWasmPlugin";
export * from "./FileUriPlugin";
export * from "./FlagDependencyExportsPlugin";
export * from "./FlagDependencyUsagePlugin";
export * from "./HotModuleReplacementPlugin";
export * from "./HttpExternalsRspackPlugin";
export * from "./HttpUriPlugin";
export * from "./html-plugin/index";
export * from "./IgnorePlugin";
export * from "./InferAsyncModulesPlugin";
export * from "./InlineExportsPlugin";
export * from "./JavascriptModulesPlugin";
export * from "./JsLoaderRspackPlugin";
export * from "./JsonModulesPlugin";
export * from "./LibManifestPlugin";
export * from "./LightningCssMinimizerRspackPlugin";
export * from "./LightningCssMinimizerRspackPlugin";
export * from "./LimitChunkCountPlugin";
export * from "./lazy-compilation/middleware";
export * from "./MangleExportsPlugin";
export * from "./MergeDuplicateChunksPlugin";
export * from "./ModuleChunkFormatPlugin";
export * from "./ModuleConcatenationPlugin";
export * from "./ModuleInfoHeaderPlugin";
export * from "./NamedChunkIdsPlugin";
export * from "./NamedModuleIdsPlugin";
export * from "./NaturalChunkIdsPlugin";
export * from "./NaturalModuleIdsPlugin";
export * from "./NodeTargetPlugin";
export * from "./NoEmitOnErrorsPlugin";
export * from "./NormalModuleReplacementPlugin";
export * from "./OccurrenceChunkIdsPlugin";
export * from "./ProgressPlugin";
export * from "./ProvidePlugin";
export * from "./RealContentHashPlugin";
export * from "./RemoveDuplicateModulesPlugin";
export * from "./RemoveEmptyChunksPlugin";
export * from "./RsdoctorPlugin";
export * from "./RslibPlugin";
export * from "./RstestPlugin";
export * from "./RuntimeChunkPlugin";
export * from "./RuntimePlugin";
export * from "./SideEffectsFlagPlugin";
export * from "./SizeLimitsPlugin";
export * from "./SourceMapDevToolPlugin";
export * from "./SplitChunksPlugin";
export * from "./SubresourceIntegrityPlugin";
export * from "./SwcJsMinimizerPlugin";
export * from "./URLPlugin";
export * from "./WarnCaseSensitiveModulesPlugin";
export * from "./WebWorkerTemplatePlugin";
export * from "./WorkerPlugin";

View File

@@ -0,0 +1,10 @@
import type { Module } from "../../Module";
export declare const BuiltinLazyCompilationPlugin: {
new (currentActiveModules: () => Set<string>, entries: boolean, imports: boolean, client: string, test?: RegExp | ((module: Module) => boolean) | undefined): {
name: string;
_args: [currentActiveModules: () => Set<string>, entries: boolean, imports: boolean, client: string, test?: RegExp | ((module: Module) => boolean) | undefined];
affectedHooks: keyof import("../..").CompilerHooks | undefined;
raw(compiler: import("../..").Compiler): import("@rspack/binding").BuiltinPlugin;
apply(compiler: import("../..").Compiler): void;
};
};

View File

@@ -0,0 +1,4 @@
import { type Compiler, MultiCompiler } from "../..";
import type { MiddlewareHandler } from "../../config/devServer";
export declare const LAZY_COMPILATION_PREFIX = "/lazy-compilation-using-";
export declare const lazyCompilationMiddleware: (compiler: Compiler | MultiCompiler) => MiddlewareHandler;