@rspack-debug/browser 0.0.0-alpha.0 → 1.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +15 -0
- package/dist/BuildInfo.d.ts +17 -0
- package/dist/Chunk.d.ts +16 -0
- package/dist/ChunkGraph.d.ts +9 -0
- package/dist/Chunks.d.ts +12 -0
- package/dist/CodeGenerationResults.d.ts +1 -0
- package/dist/Compilation.d.ts +417 -0
- package/dist/Compiler.d.ts +223 -0
- package/dist/ConcatenatedModule.d.ts +1 -0
- package/dist/ContextModule.d.ts +1 -0
- package/dist/ContextModuleFactory.d.ts +13 -0
- package/dist/Diagnostics.d.ts +7 -0
- package/dist/Entrypoint.d.ts +2 -0
- package/dist/ErrorHelpers.d.ts +3 -0
- package/dist/ExecuteModulePlugin.d.ts +4 -0
- package/dist/ExportsInfo.d.ts +20 -0
- package/dist/ExternalModule.d.ts +1 -0
- package/dist/FileSystem.d.ts +54 -0
- package/dist/FileSystemInfo.d.ts +5 -0
- package/dist/Module.d.ts +42 -0
- package/dist/ModuleGraph.d.ts +19 -0
- package/dist/ModuleTypeConstants.d.ts +8 -0
- package/dist/MultiCompiler.d.ts +82 -0
- package/dist/MultiStats.d.ts +23 -0
- package/dist/MultiWatching.d.ts +27 -0
- package/dist/NativeWatchFileSystem.d.ts +23 -0
- package/dist/NormalModule.d.ts +15 -0
- package/dist/NormalModuleFactory.d.ts +23 -0
- package/dist/Resolver.d.ts +30 -0
- package/dist/ResolverFactory.d.ts +17 -0
- package/dist/RspackError.d.ts +12 -0
- package/dist/RuleSetCompiler.d.ts +9 -0
- package/dist/RuntimeGlobals.d.ts +328 -0
- package/dist/RuntimeModule.d.ts +32 -0
- package/dist/Stats.d.ts +17 -0
- package/dist/Template.d.ts +77 -0
- package/dist/VirtualModulesPlugin.d.ts +12 -0
- package/dist/Watching.d.ts +56 -0
- package/dist/binding.d.ts +8 -0
- package/dist/browser/BrowserHttpImportEsmPlugin.d.ts +48 -0
- package/dist/browser/BrowserRequirePlugin.d.ts +38 -0
- package/dist/browser/buffer.d.ts +1 -0
- package/dist/browser/fs.d.ts +13 -0
- package/dist/browser/index.d.ts +11 -0
- package/dist/browser/service.d.ts +25 -0
- package/dist/builtin-loader/index.d.ts +1 -0
- package/dist/builtin-loader/lightningcss/index.d.ts +117 -0
- package/dist/builtin-loader/swc/collectTypeScriptInfo.d.ts +21 -0
- package/dist/builtin-loader/swc/index.d.ts +5 -0
- package/dist/builtin-loader/swc/pluginImport.d.ts +33 -0
- package/dist/builtin-loader/swc/types.d.ts +83 -0
- package/dist/builtin-plugin/APIPlugin.d.ts +9 -0
- package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.d.ts +9 -0
- package/dist/builtin-plugin/AssetModulesPlugin.d.ts +9 -0
- package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.d.ts +9 -0
- package/dist/builtin-plugin/BannerPlugin.d.ts +40 -0
- package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +14 -0
- package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.d.ts +9 -0
- package/dist/builtin-plugin/CircularDependencyRspackPlugin.d.ts +59 -0
- package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +9 -0
- package/dist/builtin-plugin/ContextReplacementPlugin.d.ts +9 -0
- package/dist/builtin-plugin/CopyRspackPlugin.d.ts +14 -0
- package/dist/builtin-plugin/CssChunkingPlugin.d.ts +21 -0
- package/dist/builtin-plugin/CssModulesPlugin.d.ts +9 -0
- package/dist/builtin-plugin/DataUriPlugin.d.ts +9 -0
- package/dist/builtin-plugin/DefinePlugin.d.ts +16 -0
- package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +7 -0
- package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +7 -0
- package/dist/builtin-plugin/DllEntryPlugin.d.ts +12 -0
- package/dist/builtin-plugin/DllReferenceAgencyPlugin.d.ts +11 -0
- package/dist/builtin-plugin/DynamicEntryPlugin.d.ts +12 -0
- package/dist/builtin-plugin/ElectronTargetPlugin.d.ts +9 -0
- package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +25 -0
- package/dist/builtin-plugin/EnableLibraryPlugin.d.ts +11 -0
- package/dist/builtin-plugin/EnableWasmLoadingPlugin.d.ts +9 -0
- package/dist/builtin-plugin/EnsureChunkConditionsPlugin.d.ts +9 -0
- package/dist/builtin-plugin/EntryPlugin.d.ts +32 -0
- package/dist/builtin-plugin/EsmLibraryPlugin.d.ts +11 -0
- package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +11 -0
- package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +10 -0
- package/dist/builtin-plugin/ExternalsPlugin.d.ts +12 -0
- package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.d.ts +9 -0
- package/dist/builtin-plugin/FileUriPlugin.d.ts +9 -0
- package/dist/builtin-plugin/FlagAllModulesAsUsedPlugin.d.ts +9 -0
- package/dist/builtin-plugin/FlagDependencyExportsPlugin.d.ts +9 -0
- package/dist/builtin-plugin/FlagDependencyUsagePlugin.d.ts +9 -0
- package/dist/builtin-plugin/HotModuleReplacementPlugin.d.ts +7 -0
- package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +9 -0
- package/dist/builtin-plugin/HttpUriPlugin.d.ts +36 -0
- package/dist/builtin-plugin/IgnorePlugin.d.ts +19 -0
- package/dist/builtin-plugin/InferAsyncModulesPlugin.d.ts +9 -0
- package/dist/builtin-plugin/InlineExportsPlugin.d.ts +9 -0
- package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +15 -0
- package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +10 -0
- package/dist/builtin-plugin/JsonModulesPlugin.d.ts +9 -0
- package/dist/builtin-plugin/LibManifestPlugin.d.ts +17 -0
- package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +32 -0
- package/dist/builtin-plugin/LimitChunkCountPlugin.d.ts +14 -0
- package/dist/builtin-plugin/MangleExportsPlugin.d.ts +9 -0
- package/dist/builtin-plugin/MergeDuplicateChunksPlugin.d.ts +9 -0
- package/dist/builtin-plugin/ModuleChunkFormatPlugin.d.ts +9 -0
- package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +7 -0
- package/dist/builtin-plugin/ModuleInfoHeaderPlugin.d.ts +9 -0
- package/dist/builtin-plugin/NamedChunkIdsPlugin.d.ts +9 -0
- package/dist/builtin-plugin/NamedModuleIdsPlugin.d.ts +9 -0
- package/dist/builtin-plugin/NaturalChunkIdsPlugin.d.ts +7 -0
- package/dist/builtin-plugin/NaturalModuleIdsPlugin.d.ts +7 -0
- package/dist/builtin-plugin/NoEmitOnErrorsPlugin.d.ts +9 -0
- package/dist/builtin-plugin/NodeTargetPlugin.d.ts +9 -0
- package/dist/builtin-plugin/NormalModuleReplacementPlugin.d.ts +10 -0
- package/dist/builtin-plugin/OccurrenceChunkIdsPlugin.d.ts +10 -0
- package/dist/builtin-plugin/ProgressPlugin.d.ts +11 -0
- package/dist/builtin-plugin/ProvidePlugin.d.ts +10 -0
- package/dist/builtin-plugin/RealContentHashPlugin.d.ts +9 -0
- package/dist/builtin-plugin/RemoveDuplicateModulesPlugin.d.ts +9 -0
- package/dist/builtin-plugin/RemoveEmptyChunksPlugin.d.ts +9 -0
- package/dist/builtin-plugin/RsdoctorPlugin.d.ts +49 -0
- package/dist/builtin-plugin/RslibPlugin.d.ts +11 -0
- package/dist/builtin-plugin/RstestPlugin.d.ts +11 -0
- package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +11 -0
- package/dist/builtin-plugin/RuntimePlugin.d.ts +28 -0
- package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +9 -0
- package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +19 -0
- package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +11 -0
- package/dist/builtin-plugin/SplitChunksPlugin.d.ts +11 -0
- package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +39 -0
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +215 -0
- package/dist/builtin-plugin/URLPlugin.d.ts +9 -0
- package/dist/builtin-plugin/WarnCaseSensitiveModulesPlugin.d.ts +9 -0
- package/dist/builtin-plugin/WebWorkerTemplatePlugin.d.ts +7 -0
- package/dist/builtin-plugin/WorkerPlugin.d.ts +13 -0
- package/dist/builtin-plugin/base.d.ts +45 -0
- package/dist/builtin-plugin/css-extract/index.d.ts +24 -0
- package/dist/builtin-plugin/css-extract/loader.d.ts +21 -0
- package/dist/builtin-plugin/css-extract/utils.d.ts +6 -0
- package/dist/builtin-plugin/html-plugin/hooks.d.ts +32 -0
- package/dist/builtin-plugin/html-plugin/index.d.ts +2 -0
- package/dist/builtin-plugin/html-plugin/options.d.ts +82 -0
- package/dist/builtin-plugin/html-plugin/plugin.d.ts +24 -0
- package/dist/builtin-plugin/html-plugin/taps.d.ts +2 -0
- package/dist/builtin-plugin/index.d.ts +84 -0
- package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +10 -0
- package/dist/builtin-plugin/lazy-compilation/middleware.d.ts +4 -0
- package/dist/config/adapter.d.ts +8 -0
- package/dist/config/adapterRuleUse.d.ts +391 -0
- package/dist/config/browserslistTargetHandler.d.ts +15 -0
- package/dist/config/defaults.d.ts +4 -0
- package/dist/config/devServer.d.ts +206 -0
- package/dist/config/index.d.ts +5 -0
- package/dist/config/normalization.d.ts +169 -0
- package/dist/config/target.d.ts +89 -0
- package/dist/config/types.d.ts +2383 -0
- package/dist/container/ContainerPlugin.d.ts +40 -0
- package/dist/container/ContainerReferencePlugin.d.ts +33 -0
- package/dist/container/ModuleFederationManifestPlugin.d.ts +37 -0
- package/dist/container/ModuleFederationPlugin.d.ts +15 -0
- package/dist/container/ModuleFederationPluginV1.d.ts +22 -0
- package/dist/container/ModuleFederationRuntimePlugin.d.ts +12 -0
- package/dist/container/index.d.ts +4 -0
- package/dist/container/options.d.ts +3 -0
- package/dist/error/ConcurrentCompilationError.d.ts +14 -0
- package/dist/exports.d.ts +166 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.mjs +66931 -0
- package/dist/index.mjs.LICENSE.txt +19 -0
- package/dist/lib/AbstractMethodError.d.ts +23 -0
- package/dist/lib/Cache.d.ts +65 -0
- package/dist/lib/CacheFacade.d.ts +139 -0
- package/dist/lib/DllPlugin.d.ts +42 -0
- package/dist/lib/DllReferencePlugin.d.ts +119 -0
- package/dist/lib/EntryOptionPlugin.d.ts +33 -0
- package/dist/lib/EnvironmentPlugin.d.ts +22 -0
- package/dist/lib/HookWebpackError.d.ts +40 -0
- package/dist/lib/IgnoreWarningsPlugin.d.ts +25 -0
- package/dist/lib/LoaderOptionsPlugin.d.ts +28 -0
- package/dist/lib/LoaderTargetPlugin.d.ts +24 -0
- package/dist/lib/ModuleFilenameHelpers.d.ts +53 -0
- package/dist/lib/WebpackError.d.ts +21 -0
- package/dist/lib/cache/MemoryCachePlugin.d.ts +5 -0
- package/dist/lib/cache/getLazyHashedEtag.d.ts +35 -0
- package/dist/lib/cache/mergeEtags.d.ts +17 -0
- package/dist/loader-runner/LoaderLoadingError.d.ts +13 -0
- package/dist/loader-runner/ModuleError.d.ts +13 -0
- package/dist/loader-runner/index.d.ts +34 -0
- package/dist/loader-runner/loadLoader.d.ts +12 -0
- package/dist/loader-runner/service.d.ts +71 -0
- package/dist/loader-runner/utils.d.ts +7 -0
- package/dist/loader-runner/worker.d.ts +14 -0
- package/dist/logging/Logger.d.ts +61 -0
- package/dist/logging/createConsoleLogger.d.ts +35 -0
- package/dist/logging/truncateArgs.d.ts +16 -0
- package/dist/napi-binding.d.ts +3128 -0
- package/dist/node/NodeEnvironmentPlugin.d.ts +10 -0
- package/dist/node/NodeTemplatePlugin.d.ts +18 -0
- package/dist/node/NodeWatchFileSystem.d.ts +18 -0
- package/dist/node/nodeConsole.d.ts +15 -0
- package/dist/rspack.d.ts +16 -0
- package/dist/rspack.wasi-browser.js +125 -0
- package/dist/rspackOptionsApply.d.ts +4 -0
- package/dist/runtime/cssExtractHmr.d.ts +4 -0
- package/dist/runtime/moduleFederationDefaultRuntime.d.ts +2 -0
- package/dist/sharing/ConsumeSharedPlugin.d.ts +41 -0
- package/dist/sharing/ProvideSharedPlugin.d.ts +34 -0
- package/dist/sharing/SharePlugin.d.ts +51 -0
- package/dist/sharing/ShareRuntimePlugin.d.ts +9 -0
- package/dist/sharing/utils.d.ts +1 -0
- package/dist/stats/DefaultStatsFactoryPlugin.d.ts +20 -0
- package/dist/stats/DefaultStatsPresetPlugin.d.ts +4 -0
- package/dist/stats/DefaultStatsPrinterPlugin.d.ts +13 -0
- package/dist/stats/StatsFactory.d.ts +57 -0
- package/dist/stats/StatsPrinter.d.ts +57 -0
- package/dist/stats/statsFactoryUtils.d.ts +341 -0
- package/dist/swc.d.ts +7 -0
- package/dist/taps/compilation.d.ts +8 -0
- package/dist/taps/compiler.d.ts +2 -0
- package/dist/taps/contextModuleFactory.d.ts +2 -0
- package/dist/taps/index.d.ts +6 -0
- package/dist/taps/javascriptModules.d.ts +2 -0
- package/dist/taps/normalModuleFactory.d.ts +2 -0
- package/dist/taps/types.d.ts +11 -0
- package/dist/trace/index.d.ts +46 -0
- package/dist/trace/traceHookPlugin.d.ts +5 -0
- package/dist/util/ArrayQueue.d.ts +45 -0
- package/dist/util/AsyncTask.d.ts +7 -0
- package/dist/util/MergeCaller.d.ts +10 -0
- package/dist/util/SizeFormatHelpers.d.ts +10 -0
- package/dist/util/SplitChunkSize.d.ts +5 -0
- package/dist/util/assertNotNil.d.ts +1 -0
- package/dist/util/assetCondition.d.ts +2 -0
- package/dist/util/asyncLib.d.ts +54 -0
- package/dist/util/bindingVersionCheck.d.ts +5 -0
- package/dist/util/cleverMerge.d.ts +24 -0
- package/dist/util/comparators.d.ts +16 -0
- package/dist/util/createHash.d.ts +16 -0
- package/dist/util/createReadonlyMap.d.ts +1 -0
- package/dist/util/fake.d.ts +9 -0
- package/dist/util/fs.d.ts +375 -0
- package/dist/util/hash/index.d.ts +26 -0
- package/dist/util/hash/md4.d.ts +11 -0
- package/dist/util/hash/wasm-hash.d.ts +51 -0
- package/dist/util/hash/xxhash64.d.ts +11 -0
- package/dist/util/identifier.d.ts +31 -0
- package/dist/util/index.d.ts +8 -0
- package/dist/util/memoize.d.ts +2 -0
- package/dist/util/runtime.d.ts +2 -0
- package/dist/util/smartGrouping.d.ts +21 -0
- package/dist/util/source.d.ts +6 -0
- package/dist/util/validateConfig.d.ts +5 -0
- package/dist/wasi-worker-browser.mjs +23591 -0
- package/dist/wasi-worker-browser.mjs.LICENSE.txt +12 -0
- package/package.json +48 -9
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
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 "../binding";
|
|
2
|
+
import * as liteTapable from "@rspack/lite-tapable";
|
|
3
|
+
import { type Compilation } from "../Compilation";
|
|
4
|
+
import type { Compiler } from "../Compiler";
|
|
5
|
+
import type { CreatePartialRegisters } from "../taps/types";
|
|
6
|
+
export declare namespace RsdoctorPluginData {
|
|
7
|
+
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 };
|
|
8
|
+
}
|
|
9
|
+
export type RsdoctorPluginOptions = {
|
|
10
|
+
moduleGraphFeatures?: boolean | ("graph" | "ids" | "sources")[];
|
|
11
|
+
chunkGraphFeatures?: boolean | ("graph" | "assets")[];
|
|
12
|
+
sourceMapFeatures?: {
|
|
13
|
+
module?: boolean;
|
|
14
|
+
cheap?: boolean;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
declare const RsdoctorPluginImpl: {
|
|
18
|
+
new (c?: RsdoctorPluginOptions | undefined): {
|
|
19
|
+
name: string;
|
|
20
|
+
_args: [c?: RsdoctorPluginOptions | undefined];
|
|
21
|
+
affectedHooks: keyof import("../Compiler").CompilerHooks | undefined;
|
|
22
|
+
raw(compiler: Compiler): import("../binding").BuiltinPlugin;
|
|
23
|
+
apply(compiler: Compiler): void;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export type RsdoctorPluginHooks = {
|
|
27
|
+
moduleGraph: liteTapable.AsyncSeriesBailHook<[
|
|
28
|
+
JsRsdoctorModuleGraph
|
|
29
|
+
], false | void>;
|
|
30
|
+
chunkGraph: liteTapable.AsyncSeriesBailHook<[
|
|
31
|
+
JsRsdoctorChunkGraph
|
|
32
|
+
], false | void>;
|
|
33
|
+
moduleIds: liteTapable.AsyncSeriesBailHook<[
|
|
34
|
+
JsRsdoctorModuleIdsPatch
|
|
35
|
+
], false | void>;
|
|
36
|
+
moduleSources: liteTapable.AsyncSeriesBailHook<[
|
|
37
|
+
JsRsdoctorModuleSourcesPatch
|
|
38
|
+
], false | void>;
|
|
39
|
+
assets: liteTapable.AsyncSeriesBailHook<[JsRsdoctorAssetPatch], false | void>;
|
|
40
|
+
};
|
|
41
|
+
declare const RsdoctorPlugin: typeof RsdoctorPluginImpl & {
|
|
42
|
+
/**
|
|
43
|
+
* @deprecated Use `getCompilationHooks` instead.
|
|
44
|
+
*/
|
|
45
|
+
getHooks: (compilation: Compilation) => RsdoctorPluginHooks;
|
|
46
|
+
getCompilationHooks: (compilation: Compilation) => RsdoctorPluginHooks;
|
|
47
|
+
};
|
|
48
|
+
export declare const createRsdoctorPluginHooksRegisters: CreatePartialRegisters<`RsdoctorPlugin`>;
|
|
49
|
+
export { RsdoctorPlugin };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type RawRslibPluginOptions } from "../binding";
|
|
2
|
+
export type RslibPluginArgument = Partial<Omit<RawRslibPluginOptions, "handler">> | ((percentage: number, msg: string, ...args: string[]) => void) | undefined;
|
|
3
|
+
export declare const RslibPlugin: {
|
|
4
|
+
new (rslib: RawRslibPluginOptions): {
|
|
5
|
+
name: string;
|
|
6
|
+
_args: [rslib: RawRslibPluginOptions];
|
|
7
|
+
affectedHooks: keyof import("..").CompilerHooks | undefined;
|
|
8
|
+
raw(compiler: import("..").Compiler): import("../binding").BuiltinPlugin;
|
|
9
|
+
apply(compiler: import("..").Compiler): void;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type RawRstestPluginOptions } from "../binding";
|
|
2
|
+
export type RstestPluginArgument = Partial<Omit<RawRstestPluginOptions, "handler">> | ((percentage: number, msg: string, ...args: string[]) => void) | undefined;
|
|
3
|
+
export declare const RstestPlugin: {
|
|
4
|
+
new (rstest: RawRstestPluginOptions): {
|
|
5
|
+
name: string;
|
|
6
|
+
_args: [rstest: RawRstestPluginOptions];
|
|
7
|
+
affectedHooks: keyof import("..").CompilerHooks | undefined;
|
|
8
|
+
raw(compiler: import("..").Compiler): import("../binding").BuiltinPlugin;
|
|
9
|
+
apply(compiler: import("..").Compiler): void;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type RawRuntimeChunkOptions } from "../binding";
|
|
2
|
+
export type RuntimeChunkPluginOptions = RawRuntimeChunkOptions;
|
|
3
|
+
export declare const RuntimeChunkPlugin: {
|
|
4
|
+
new (options: RawRuntimeChunkOptions): {
|
|
5
|
+
name: string;
|
|
6
|
+
_args: [options: RawRuntimeChunkOptions];
|
|
7
|
+
affectedHooks: keyof import("..").CompilerHooks | undefined;
|
|
8
|
+
raw(compiler: import("..").Compiler): import("../binding").BuiltinPlugin;
|
|
9
|
+
apply(compiler: import("..").Compiler): void;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import binding from "../binding";
|
|
2
|
+
import * as liteTapable from "@rspack/lite-tapable";
|
|
3
|
+
import type { Chunk } from "../Chunk";
|
|
4
|
+
import { type Compilation } from "../Compilation";
|
|
5
|
+
import type { CreatePartialRegisters } from "../taps/types";
|
|
6
|
+
export declare const RuntimePluginImpl: {
|
|
7
|
+
new (): {
|
|
8
|
+
name: string;
|
|
9
|
+
_args: [];
|
|
10
|
+
affectedHooks: keyof import("..").CompilerHooks | undefined;
|
|
11
|
+
raw(compiler: import("..").Compiler): binding.BuiltinPlugin;
|
|
12
|
+
apply(compiler: import("..").Compiler): void;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export type RuntimePluginHooks = {
|
|
16
|
+
createScript: liteTapable.SyncWaterfallHook<[string, Chunk]>;
|
|
17
|
+
linkPreload: liteTapable.SyncWaterfallHook<[string, Chunk]>;
|
|
18
|
+
linkPrefetch: liteTapable.SyncWaterfallHook<[string, Chunk]>;
|
|
19
|
+
};
|
|
20
|
+
declare const RuntimePlugin: typeof RuntimePluginImpl & {
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated Use `getCompilationHooks` instead.
|
|
23
|
+
*/
|
|
24
|
+
getHooks: (compilation: Compilation) => RuntimePluginHooks;
|
|
25
|
+
getCompilationHooks: (compilation: Compilation) => RuntimePluginHooks;
|
|
26
|
+
};
|
|
27
|
+
export declare const createRuntimePluginHooksRegisters: CreatePartialRegisters<`RuntimePlugin`>;
|
|
28
|
+
export { RuntimePlugin };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const SideEffectsFlagPlugin: {
|
|
2
|
+
new (): {
|
|
3
|
+
name: string;
|
|
4
|
+
_args: [];
|
|
5
|
+
affectedHooks: keyof import("..").CompilerHooks | undefined;
|
|
6
|
+
raw(compiler: import("..").Compiler): import("../binding").BuiltinPlugin;
|
|
7
|
+
apply(compiler: import("..").Compiler): void;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const SizeLimitsPlugin: {
|
|
2
|
+
new (options: {
|
|
3
|
+
assetFilter?: (assetFilename: string) => boolean;
|
|
4
|
+
hints?: false | "warning" | "error";
|
|
5
|
+
maxAssetSize?: number;
|
|
6
|
+
maxEntrypointSize?: number;
|
|
7
|
+
}): {
|
|
8
|
+
name: string;
|
|
9
|
+
_args: [options: {
|
|
10
|
+
assetFilter?: (assetFilename: string) => boolean;
|
|
11
|
+
hints?: false | "warning" | "error";
|
|
12
|
+
maxAssetSize?: number;
|
|
13
|
+
maxEntrypointSize?: number;
|
|
14
|
+
}];
|
|
15
|
+
affectedHooks: keyof import("..").CompilerHooks | undefined;
|
|
16
|
+
raw(compiler: import("..").Compiler): import("../binding").BuiltinPlugin;
|
|
17
|
+
apply(compiler: import("..").Compiler): void;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type SourceMapDevToolPluginOptions } from "../binding";
|
|
2
|
+
export type { SourceMapDevToolPluginOptions };
|
|
3
|
+
export declare const SourceMapDevToolPlugin: {
|
|
4
|
+
new (options: SourceMapDevToolPluginOptions): {
|
|
5
|
+
name: string;
|
|
6
|
+
_args: [options: SourceMapDevToolPluginOptions];
|
|
7
|
+
affectedHooks: keyof import("..").CompilerHooks | undefined;
|
|
8
|
+
raw(compiler: import("..").Compiler): import("../binding").BuiltinPlugin;
|
|
9
|
+
apply(compiler: import("..").Compiler): void;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type BuiltinPlugin, BuiltinPluginName } from "../binding";
|
|
2
|
+
import type { Compiler } from "../Compiler";
|
|
3
|
+
import type { OptimizationSplitChunksOptions } from "../config";
|
|
4
|
+
import { RspackBuiltinPlugin } from "./base";
|
|
5
|
+
export declare class SplitChunksPlugin extends RspackBuiltinPlugin {
|
|
6
|
+
private options;
|
|
7
|
+
name: BuiltinPluginName;
|
|
8
|
+
affectedHooks: "thisCompilation";
|
|
9
|
+
constructor(options: OptimizationSplitChunksOptions);
|
|
10
|
+
raw(compiler: Compiler): BuiltinPlugin;
|
|
11
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type RawSubresourceIntegrityPluginOptions } from "../binding";
|
|
2
|
+
import type { Compiler } from "../Compiler";
|
|
3
|
+
export type SubresourceIntegrityHashFunction = "sha256" | "sha384" | "sha512";
|
|
4
|
+
export type SubresourceIntegrityPluginOptions = {
|
|
5
|
+
hashFuncNames?: [
|
|
6
|
+
SubresourceIntegrityHashFunction,
|
|
7
|
+
...SubresourceIntegrityHashFunction[]
|
|
8
|
+
];
|
|
9
|
+
htmlPlugin?: string | false;
|
|
10
|
+
enabled?: "auto" | boolean;
|
|
11
|
+
};
|
|
12
|
+
export type NativeSubresourceIntegrityPluginOptions = Omit<RawSubresourceIntegrityPluginOptions, "htmlPlugin"> & {
|
|
13
|
+
htmlPlugin: string | false;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Note: This is not a webpack public API, maybe removed in future.
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
declare const NativeSubresourceIntegrityPlugin: {
|
|
20
|
+
new (options: NativeSubresourceIntegrityPluginOptions): {
|
|
21
|
+
name: string;
|
|
22
|
+
_args: [options: NativeSubresourceIntegrityPluginOptions];
|
|
23
|
+
affectedHooks: keyof import("../Compiler").CompilerHooks | undefined;
|
|
24
|
+
raw(compiler: Compiler): import("../binding").BuiltinPlugin;
|
|
25
|
+
apply(compiler: Compiler): void;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export declare class SubresourceIntegrityPlugin extends NativeSubresourceIntegrityPlugin {
|
|
29
|
+
private integrities;
|
|
30
|
+
private options;
|
|
31
|
+
constructor(options?: SubresourceIntegrityPluginOptions);
|
|
32
|
+
private isEnabled;
|
|
33
|
+
private getIntegrityChecksumForAsset;
|
|
34
|
+
private handleHwpPluginArgs;
|
|
35
|
+
private handleHwpBodyTags;
|
|
36
|
+
private processTag;
|
|
37
|
+
apply(compiler: Compiler): void;
|
|
38
|
+
}
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import type { LiteralUnion } from "../config";
|
|
2
|
+
import type { AssetConditions } from "../util/assetCondition";
|
|
3
|
+
type ExtractCommentsCondition = boolean | RegExp;
|
|
4
|
+
type ExtractCommentsBanner = string | boolean;
|
|
5
|
+
type ExtractCommentsObject = {
|
|
6
|
+
condition?: ExtractCommentsCondition | undefined;
|
|
7
|
+
banner?: ExtractCommentsBanner | undefined;
|
|
8
|
+
};
|
|
9
|
+
type ExtractCommentsOptions = ExtractCommentsCondition | ExtractCommentsObject;
|
|
10
|
+
export type SwcJsMinimizerRspackPluginOptions = {
|
|
11
|
+
test?: AssetConditions;
|
|
12
|
+
exclude?: AssetConditions;
|
|
13
|
+
include?: AssetConditions;
|
|
14
|
+
extractComments?: ExtractCommentsOptions | undefined;
|
|
15
|
+
minimizerOptions?: {
|
|
16
|
+
minify?: boolean;
|
|
17
|
+
ecma?: TerserEcmaVersion;
|
|
18
|
+
compress?: TerserCompressOptions | boolean;
|
|
19
|
+
mangle?: TerserMangleOptions | boolean;
|
|
20
|
+
format?: JsFormatOptions & ToSnakeCaseProperties<JsFormatOptions>;
|
|
21
|
+
module?: boolean;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* @example ToSnakeCase<'indentLevel'> == 'indent_level'
|
|
26
|
+
*/
|
|
27
|
+
type ToSnakeCase<T extends string> = T extends `${infer A}${infer B}` ? `${A extends Lowercase<A> ? A : `_${Lowercase<A>}`}${ToSnakeCase<B>}` : T;
|
|
28
|
+
/**
|
|
29
|
+
* @example ToSnakeCaseProperties\<{indentLevel: 3\}\> == {indent_level: 3\}
|
|
30
|
+
*/
|
|
31
|
+
type ToSnakeCaseProperties<T> = {
|
|
32
|
+
[K in keyof T as K extends string ? ToSnakeCase<K> : K]: T[K];
|
|
33
|
+
};
|
|
34
|
+
export interface JsFormatOptions {
|
|
35
|
+
/**
|
|
36
|
+
* Currently noop.
|
|
37
|
+
* @default false
|
|
38
|
+
* @alias ascii_only
|
|
39
|
+
*/
|
|
40
|
+
asciiOnly?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Currently noop.
|
|
43
|
+
* @default false
|
|
44
|
+
*/
|
|
45
|
+
beautify?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Currently noop.
|
|
48
|
+
* @default false
|
|
49
|
+
*/
|
|
50
|
+
braces?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* - `false`: removes all comments
|
|
53
|
+
* - `'some'`: preserves some comments
|
|
54
|
+
* - `'all'`: preserves all comments
|
|
55
|
+
* @default false
|
|
56
|
+
*/
|
|
57
|
+
comments?: false | "some" | "all";
|
|
58
|
+
/**
|
|
59
|
+
* Currently noop.
|
|
60
|
+
* @default 5
|
|
61
|
+
*/
|
|
62
|
+
ecma?: TerserEcmaVersion;
|
|
63
|
+
/**
|
|
64
|
+
* Currently noop.
|
|
65
|
+
* @alias indent_level
|
|
66
|
+
*/
|
|
67
|
+
indentLevel?: number;
|
|
68
|
+
/**
|
|
69
|
+
* Currently noop.
|
|
70
|
+
* @alias indent_start
|
|
71
|
+
*/
|
|
72
|
+
indentStart?: number;
|
|
73
|
+
inlineScript?: number;
|
|
74
|
+
/**
|
|
75
|
+
* Currently noop.
|
|
76
|
+
* @alias keep_numbers
|
|
77
|
+
*/
|
|
78
|
+
keepNumbers?: number;
|
|
79
|
+
/**
|
|
80
|
+
* Currently noop.
|
|
81
|
+
* @alias keep_quoted_props
|
|
82
|
+
*/
|
|
83
|
+
keepQuotedProps?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Currently noop.
|
|
86
|
+
* @alias max_line_len
|
|
87
|
+
*/
|
|
88
|
+
maxLineLen?: number | false;
|
|
89
|
+
/**
|
|
90
|
+
* When passed it must be a string and it will be prepended to the output literally.
|
|
91
|
+
* The source map will adjust for this text. Can be used to insert a comment containing licensing information.
|
|
92
|
+
*/
|
|
93
|
+
preamble?: string;
|
|
94
|
+
/**
|
|
95
|
+
* Currently noop.
|
|
96
|
+
* @alias quote_keys
|
|
97
|
+
*/
|
|
98
|
+
quoteKeys?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Currently noop.
|
|
101
|
+
* @alias quote_style
|
|
102
|
+
*/
|
|
103
|
+
quoteStyle?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Currently noop.
|
|
106
|
+
* @alias preserve_annotations
|
|
107
|
+
*/
|
|
108
|
+
preserveAnnotations?: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Currently noop.
|
|
111
|
+
*/
|
|
112
|
+
safari10?: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Currently noop.
|
|
115
|
+
*/
|
|
116
|
+
semicolons?: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* Currently noop.
|
|
119
|
+
*/
|
|
120
|
+
shebang?: boolean;
|
|
121
|
+
/**
|
|
122
|
+
* Currently noop.
|
|
123
|
+
*/
|
|
124
|
+
webkit?: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Currently noop.
|
|
127
|
+
* @alias wrap_iife
|
|
128
|
+
*/
|
|
129
|
+
wrapIife?: boolean;
|
|
130
|
+
/**
|
|
131
|
+
* Currently noop.
|
|
132
|
+
* @alias wrap_func_args
|
|
133
|
+
*/
|
|
134
|
+
wrapFuncArgs?: boolean;
|
|
135
|
+
}
|
|
136
|
+
export type TerserEcmaVersion = LiteralUnion<5 | 2015 | 2016, number> | string;
|
|
137
|
+
export interface TerserCompressOptions {
|
|
138
|
+
arguments?: boolean;
|
|
139
|
+
arrows?: boolean;
|
|
140
|
+
booleans?: boolean;
|
|
141
|
+
booleans_as_integers?: boolean;
|
|
142
|
+
collapse_vars?: boolean;
|
|
143
|
+
comparisons?: boolean;
|
|
144
|
+
computed_props?: boolean;
|
|
145
|
+
conditionals?: boolean;
|
|
146
|
+
dead_code?: boolean;
|
|
147
|
+
defaults?: boolean;
|
|
148
|
+
directives?: boolean;
|
|
149
|
+
drop_console?: boolean;
|
|
150
|
+
drop_debugger?: boolean;
|
|
151
|
+
ecma?: TerserEcmaVersion;
|
|
152
|
+
evaluate?: boolean;
|
|
153
|
+
expression?: boolean;
|
|
154
|
+
global_defs?: any;
|
|
155
|
+
hoist_funs?: boolean;
|
|
156
|
+
hoist_props?: boolean;
|
|
157
|
+
hoist_vars?: boolean;
|
|
158
|
+
ie8?: boolean;
|
|
159
|
+
if_return?: boolean;
|
|
160
|
+
inline?: 0 | 1 | 2 | 3;
|
|
161
|
+
join_vars?: boolean;
|
|
162
|
+
keep_classnames?: boolean;
|
|
163
|
+
keep_fargs?: boolean;
|
|
164
|
+
keep_fnames?: boolean;
|
|
165
|
+
keep_infinity?: boolean;
|
|
166
|
+
loops?: boolean;
|
|
167
|
+
negate_iife?: boolean;
|
|
168
|
+
passes?: number;
|
|
169
|
+
properties?: boolean;
|
|
170
|
+
pure_getters?: any;
|
|
171
|
+
pure_funcs?: string[];
|
|
172
|
+
reduce_funcs?: boolean;
|
|
173
|
+
reduce_vars?: boolean;
|
|
174
|
+
sequences?: any;
|
|
175
|
+
side_effects?: boolean;
|
|
176
|
+
switches?: boolean;
|
|
177
|
+
top_retain?: any;
|
|
178
|
+
toplevel?: any;
|
|
179
|
+
typeofs?: boolean;
|
|
180
|
+
unsafe?: boolean;
|
|
181
|
+
unsafe_passes?: boolean;
|
|
182
|
+
unsafe_arrows?: boolean;
|
|
183
|
+
unsafe_comps?: boolean;
|
|
184
|
+
unsafe_function?: boolean;
|
|
185
|
+
unsafe_math?: boolean;
|
|
186
|
+
unsafe_symbols?: boolean;
|
|
187
|
+
unsafe_methods?: boolean;
|
|
188
|
+
unsafe_proto?: boolean;
|
|
189
|
+
unsafe_regexp?: boolean;
|
|
190
|
+
unsafe_undefined?: boolean;
|
|
191
|
+
unused?: boolean;
|
|
192
|
+
const_to_let?: boolean;
|
|
193
|
+
module?: boolean;
|
|
194
|
+
}
|
|
195
|
+
export interface TerserMangleOptions {
|
|
196
|
+
props?: TerserManglePropertiesOptions;
|
|
197
|
+
toplevel?: boolean;
|
|
198
|
+
keep_classnames?: boolean;
|
|
199
|
+
keep_fnames?: boolean;
|
|
200
|
+
keep_private_props?: boolean;
|
|
201
|
+
ie8?: boolean;
|
|
202
|
+
safari10?: boolean;
|
|
203
|
+
reserved?: string[];
|
|
204
|
+
}
|
|
205
|
+
export type TerserManglePropertiesOptions = {};
|
|
206
|
+
export declare const SwcJsMinimizerRspackPlugin: {
|
|
207
|
+
new (options?: SwcJsMinimizerRspackPluginOptions | undefined): {
|
|
208
|
+
name: string;
|
|
209
|
+
_args: [options?: SwcJsMinimizerRspackPluginOptions | undefined];
|
|
210
|
+
affectedHooks: keyof import("..").CompilerHooks | undefined;
|
|
211
|
+
raw(compiler: import("..").Compiler): import("../binding").BuiltinPlugin;
|
|
212
|
+
apply(compiler: import("..").Compiler): void;
|
|
213
|
+
};
|
|
214
|
+
};
|
|
215
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const URLPlugin: {
|
|
2
|
+
new (): {
|
|
3
|
+
name: string;
|
|
4
|
+
_args: [];
|
|
5
|
+
affectedHooks: keyof import("..").CompilerHooks | undefined;
|
|
6
|
+
raw(compiler: import("..").Compiler): import("../binding").BuiltinPlugin;
|
|
7
|
+
apply(compiler: import("..").Compiler): void;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const WarnCaseSensitiveModulesPlugin: {
|
|
2
|
+
new (): {
|
|
3
|
+
name: string;
|
|
4
|
+
_args: [];
|
|
5
|
+
affectedHooks: keyof import("..").CompilerHooks | undefined;
|
|
6
|
+
raw(compiler: import("..").Compiler): import("../binding").BuiltinPlugin;
|
|
7
|
+
apply(compiler: import("..").Compiler): void;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type BuiltinPlugin, BuiltinPluginName } from "../binding";
|
|
2
|
+
import type { Compiler } from "../Compiler";
|
|
3
|
+
import { RspackBuiltinPlugin } from "./base";
|
|
4
|
+
export declare class WebWorkerTemplatePlugin extends RspackBuiltinPlugin {
|
|
5
|
+
name: BuiltinPluginName;
|
|
6
|
+
raw(compiler: Compiler): BuiltinPlugin | undefined;
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type BuiltinPlugin, BuiltinPluginName } from "../binding";
|
|
2
|
+
import type { Compiler } from "../Compiler";
|
|
3
|
+
import type { ChunkLoading, OutputModule, WasmLoading, WorkerPublicPath } from "../config";
|
|
4
|
+
import { RspackBuiltinPlugin } from "./base";
|
|
5
|
+
export declare class WorkerPlugin extends RspackBuiltinPlugin {
|
|
6
|
+
private chunkLoading;
|
|
7
|
+
private wasmLoading;
|
|
8
|
+
private module;
|
|
9
|
+
private workerPublicPath;
|
|
10
|
+
name: BuiltinPluginName;
|
|
11
|
+
constructor(chunkLoading: ChunkLoading, wasmLoading: WasmLoading, module: OutputModule, workerPublicPath: WorkerPublicPath);
|
|
12
|
+
raw(compiler: Compiler): BuiltinPlugin;
|
|
13
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import binding from "../binding";
|
|
2
|
+
import type { Compiler, RspackPluginInstance } from "..";
|
|
3
|
+
type AffectedHooks = keyof Compiler["hooks"];
|
|
4
|
+
export declare function canInherentFromParent(affectedHooks?: AffectedHooks): boolean;
|
|
5
|
+
export declare abstract class RspackBuiltinPlugin implements RspackPluginInstance {
|
|
6
|
+
abstract raw(compiler: Compiler): binding.BuiltinPlugin | undefined;
|
|
7
|
+
abstract name: binding.BuiltinPluginName | CustomPluginName;
|
|
8
|
+
affectedHooks?: AffectedHooks;
|
|
9
|
+
apply(compiler: Compiler): void;
|
|
10
|
+
}
|
|
11
|
+
export declare function createBuiltinPlugin<R>(name: binding.BuiltinPluginName | CustomPluginName, options: R): binding.BuiltinPlugin;
|
|
12
|
+
type CustomPluginName = string;
|
|
13
|
+
export declare function create<T extends any[], R>(name: binding.BuiltinPluginName | CustomPluginName, resolve: (this: Compiler, ...args: T) => R, affectedHooks?: AffectedHooks): {
|
|
14
|
+
new (...args: T): {
|
|
15
|
+
name: string;
|
|
16
|
+
_args: T;
|
|
17
|
+
affectedHooks: keyof import("..").CompilerHooks | undefined;
|
|
18
|
+
raw(compiler: Compiler): binding.BuiltinPlugin;
|
|
19
|
+
apply(compiler: Compiler): void;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Create a wrapper class for builtin plugin.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```js
|
|
27
|
+
* const MyPlugin = createNativePlugin("MyPlugin", (options) => {
|
|
28
|
+
* return options;
|
|
29
|
+
* });
|
|
30
|
+
*
|
|
31
|
+
* new MyPlugin({
|
|
32
|
+
* foo: "bar"
|
|
33
|
+
* }).apply(compiler);
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare function createNativePlugin<T extends any[], R>(name: CustomPluginName, resolve: (this: Compiler, ...args: T) => R, affectedHooks?: AffectedHooks): {
|
|
37
|
+
new (...args: T): {
|
|
38
|
+
name: string;
|
|
39
|
+
_args: T;
|
|
40
|
+
affectedHooks: keyof import("..").CompilerHooks | undefined;
|
|
41
|
+
raw(compiler: Compiler): binding.BuiltinPlugin;
|
|
42
|
+
apply(compiler: Compiler): void;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type RawCssExtractPluginOption } from "../../binding";
|
|
2
|
+
import type { Compiler, LiteralUnion } from "../..";
|
|
3
|
+
export * from "./loader";
|
|
4
|
+
export type { CssExtractRspackLoaderOptions } from "./loader";
|
|
5
|
+
export interface CssExtractRspackPluginOptions {
|
|
6
|
+
filename?: RawCssExtractPluginOption["filename"];
|
|
7
|
+
chunkFilename?: RawCssExtractPluginOption["chunkFilename"];
|
|
8
|
+
ignoreOrder?: boolean;
|
|
9
|
+
insert?: string | ((linkTag: HTMLLinkElement) => void);
|
|
10
|
+
attributes?: Record<string, string>;
|
|
11
|
+
linkType?: LiteralUnion<"text/css", string> | false;
|
|
12
|
+
runtime?: boolean;
|
|
13
|
+
pathinfo?: boolean;
|
|
14
|
+
enforceRelative?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare class CssExtractRspackPlugin {
|
|
17
|
+
static pluginName: string;
|
|
18
|
+
static loader: string;
|
|
19
|
+
options: CssExtractRspackPluginOptions;
|
|
20
|
+
constructor(options?: CssExtractRspackPluginOptions);
|
|
21
|
+
apply(compiler: Compiler): void;
|
|
22
|
+
normalizeOptions(options: CssExtractRspackPluginOptions): RawCssExtractPluginOption;
|
|
23
|
+
}
|
|
24
|
+
export default CssExtractRspackPlugin;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { LoaderContext, LoaderDefinition } from "../..";
|
|
2
|
+
export declare const BASE_URI = "webpack://";
|
|
3
|
+
export declare const MODULE_TYPE = "css/mini-extract";
|
|
4
|
+
export declare const AUTO_PUBLIC_PATH = "__mini_css_extract_plugin_public_path_auto__";
|
|
5
|
+
export declare const ABSOLUTE_PUBLIC_PATH = "webpack:///mini-css-extract-plugin/";
|
|
6
|
+
export declare const SINGLE_DOT_PATH_SEGMENT = "__mini_css_extract_plugin_single_dot_path_segment__";
|
|
7
|
+
export interface CssExtractRspackLoaderOptions {
|
|
8
|
+
publicPath?: string | ((resourcePath: string, context: string) => string);
|
|
9
|
+
emit?: boolean;
|
|
10
|
+
esModule?: boolean;
|
|
11
|
+
layer?: string;
|
|
12
|
+
defaultExport?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function hotLoader(content: string, context: {
|
|
15
|
+
loaderContext: LoaderContext;
|
|
16
|
+
options?: CssExtractRspackLoaderOptions;
|
|
17
|
+
locals?: Record<string, string>;
|
|
18
|
+
}): string;
|
|
19
|
+
declare const loader: LoaderDefinition;
|
|
20
|
+
export declare const pitch: LoaderDefinition["pitch"];
|
|
21
|
+
export default loader;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { LoaderContext } from "../..";
|
|
2
|
+
export declare function isAbsolutePath(str: string): boolean;
|
|
3
|
+
export declare const PLUGIN_NAME = "css-extract-rspack-plugin";
|
|
4
|
+
export declare function isRelativePath(str: string): boolean;
|
|
5
|
+
export declare function stringifyRequest(loaderContext: LoaderContext, request: string): string;
|
|
6
|
+
export declare function stringifyLocal(value: any): any;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { JsAfterEmitData, JsAfterTemplateExecutionData, JsAlterAssetTagGroupsData, JsAlterAssetTagsData, JsBeforeAssetTagGenerationData, JsBeforeEmitData } from "../../binding";
|
|
2
|
+
import * as liteTapable from "@rspack/lite-tapable";
|
|
3
|
+
import { type Compilation } from "../../Compilation";
|
|
4
|
+
import type { HtmlRspackPluginOptions } from "./options";
|
|
5
|
+
type ExtraPluginHookData = {
|
|
6
|
+
plugin: {
|
|
7
|
+
options: HtmlRspackPluginOptions;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export type HtmlRspackPluginHooks = {
|
|
11
|
+
beforeAssetTagGeneration: liteTapable.AsyncSeriesWaterfallHook<[
|
|
12
|
+
JsBeforeAssetTagGenerationData & ExtraPluginHookData
|
|
13
|
+
]>;
|
|
14
|
+
alterAssetTags: liteTapable.AsyncSeriesWaterfallHook<[
|
|
15
|
+
JsAlterAssetTagsData & ExtraPluginHookData
|
|
16
|
+
]>;
|
|
17
|
+
alterAssetTagGroups: liteTapable.AsyncSeriesWaterfallHook<[
|
|
18
|
+
JsAlterAssetTagGroupsData & ExtraPluginHookData
|
|
19
|
+
]>;
|
|
20
|
+
afterTemplateExecution: liteTapable.AsyncSeriesWaterfallHook<[
|
|
21
|
+
JsAfterTemplateExecutionData & ExtraPluginHookData
|
|
22
|
+
]>;
|
|
23
|
+
beforeEmit: liteTapable.AsyncSeriesWaterfallHook<[
|
|
24
|
+
JsBeforeEmitData & ExtraPluginHookData
|
|
25
|
+
]>;
|
|
26
|
+
afterEmit: liteTapable.AsyncSeriesWaterfallHook<[
|
|
27
|
+
JsAfterEmitData & ExtraPluginHookData
|
|
28
|
+
]>;
|
|
29
|
+
};
|
|
30
|
+
export declare const getPluginHooks: (compilation: Compilation) => HtmlRspackPluginHooks;
|
|
31
|
+
export declare const cleanPluginHooks: (compilation: Compilation) => void;
|
|
32
|
+
export {};
|