@ohos-ports/rspack-core 1.1.8-beta.1
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 +25 -0
- package/compiled/@swc/types/index.d.ts +1962 -0
- package/compiled/@swc/types/index.js +19 -0
- package/compiled/@swc/types/license +201 -0
- package/compiled/@swc/types/package.json +1 -0
- package/compiled/browserslist/index.d.ts +1 -0
- package/compiled/browserslist/index.js +2053 -0
- package/compiled/browserslist/license +20 -0
- package/compiled/browserslist/package.json +1 -0
- package/compiled/enhanced-resolve/CachedInputFileSystem.js +664 -0
- package/compiled/enhanced-resolve/index.d.ts +1123 -0
- package/compiled/enhanced-resolve/license +20 -0
- package/compiled/enhanced-resolve/package.json +1 -0
- package/compiled/graceful-fs/index.d.ts +13 -0
- package/compiled/graceful-fs/index.js +1063 -0
- package/compiled/graceful-fs/license +15 -0
- package/compiled/graceful-fs/package.json +1 -0
- package/compiled/watchpack/index.d.ts +216 -0
- package/compiled/watchpack/index.js +2075 -0
- package/compiled/watchpack/license +20 -0
- package/compiled/watchpack/package.json +1 -0
- package/compiled/webpack-sources/index.d.ts +130 -0
- package/compiled/webpack-sources/index.js +3520 -0
- package/compiled/webpack-sources/license +21 -0
- package/compiled/webpack-sources/package.json +1 -0
- package/compiled/zod/index.d.ts +1733 -0
- package/compiled/zod/index.js +4405 -0
- package/compiled/zod/license +21 -0
- package/compiled/zod/package.json +1 -0
- package/dist/Chunk.d.ts +40 -0
- package/dist/ChunkGraph.d.ts +12 -0
- package/dist/ChunkGroup.d.ts +26 -0
- package/dist/Compilation.d.ts +421 -0
- package/dist/Compiler.d.ts +154 -0
- package/dist/ContextModuleFactory.d.ts +13 -0
- package/dist/DependenciesBlock.d.ts +10 -0
- package/dist/Dependency.d.ts +11 -0
- package/dist/Entrypoint.d.ts +8 -0
- package/dist/ErrorHelpers.d.ts +16 -0
- package/dist/ExecuteModulePlugin.d.ts +4 -0
- package/dist/FileSystem.d.ts +29 -0
- package/dist/FileSystemInfo.d.ts +5 -0
- package/dist/Module.d.ts +93 -0
- package/dist/ModuleGraph.d.ts +10 -0
- package/dist/ModuleTypeConstants.d.ts +93 -0
- package/dist/MultiCompiler.d.ts +68 -0
- package/dist/MultiStats.d.ts +22 -0
- package/dist/MultiWatching.d.ts +26 -0
- package/dist/NormalModule.d.ts +12 -0
- package/dist/NormalModuleFactory.d.ts +20 -0
- package/dist/Resolver.d.ts +16 -0
- package/dist/ResolverFactory.d.ts +14 -0
- package/dist/RspackError.d.ts +8 -0
- package/dist/RuleSetCompiler.d.ts +9 -0
- package/dist/RuntimeGlobals.d.ts +324 -0
- package/dist/RuntimeModule.d.ts +32 -0
- package/dist/Stats.d.ts +17 -0
- package/dist/Template.d.ts +77 -0
- package/dist/Watching.d.ts +35 -0
- package/dist/builtin-loader/index.d.ts +1 -0
- package/dist/builtin-loader/lightningcss/index.d.ts +95 -0
- package/dist/builtin-loader/swc/index.d.ts +3 -0
- package/dist/builtin-loader/swc/pluginImport.d.ts +33 -0
- package/dist/builtin-loader/swc/types.d.ts +19 -0
- package/dist/builtin-plugin/APIPlugin.d.ts +10 -0
- package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.d.ts +10 -0
- package/dist/builtin-plugin/AssetModulesPlugin.d.ts +10 -0
- package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.d.ts +10 -0
- package/dist/builtin-plugin/BannerPlugin.d.ts +40 -0
- package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +15 -0
- package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.d.ts +10 -0
- package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +10 -0
- package/dist/builtin-plugin/ContextReplacementPlugin.d.ts +10 -0
- package/dist/builtin-plugin/CopyRspackPlugin.d.ts +15 -0
- package/dist/builtin-plugin/CssModulesPlugin.d.ts +10 -0
- package/dist/builtin-plugin/DataUriPlugin.d.ts +10 -0
- package/dist/builtin-plugin/DefinePlugin.d.ts +17 -0
- package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +10 -0
- package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +8 -0
- package/dist/builtin-plugin/DllEntryPlugin.d.ts +13 -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 +10 -0
- package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +10 -0
- package/dist/builtin-plugin/EnableLibraryPlugin.d.ts +11 -0
- package/dist/builtin-plugin/EnableWasmLoadingPlugin.d.ts +10 -0
- package/dist/builtin-plugin/EnsureChunkConditionsPlugin.d.ts +10 -0
- package/dist/builtin-plugin/EntryPlugin.d.ts +27 -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 +10 -0
- package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.d.ts +10 -0
- package/dist/builtin-plugin/FileUriPlugin.d.ts +10 -0
- package/dist/builtin-plugin/FlagAllModulesAsUsedPlugin.d.ts +10 -0
- package/dist/builtin-plugin/FlagDependencyExportsPlugin.d.ts +10 -0
- package/dist/builtin-plugin/FlagDependencyUsagePlugin.d.ts +10 -0
- package/dist/builtin-plugin/HotModuleReplacementPlugin.d.ts +7 -0
- package/dist/builtin-plugin/HtmlRspackPlugin.d.ts +112 -0
- package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +10 -0
- package/dist/builtin-plugin/IgnorePlugin.d.ts +19 -0
- package/dist/builtin-plugin/InferAsyncModulesPlugin.d.ts +10 -0
- package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +15 -0
- package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +11 -0
- package/dist/builtin-plugin/JsonModulesPlugin.d.ts +10 -0
- package/dist/builtin-plugin/LibManifestPlugin.d.ts +18 -0
- package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +33 -0
- package/dist/builtin-plugin/LimitChunkCountPlugin.d.ts +15 -0
- package/dist/builtin-plugin/MangleExportsPlugin.d.ts +10 -0
- package/dist/builtin-plugin/MergeDuplicateChunksPlugin.d.ts +10 -0
- package/dist/builtin-plugin/ModuleChunkFormatPlugin.d.ts +10 -0
- package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +8 -0
- package/dist/builtin-plugin/NamedChunkIdsPlugin.d.ts +10 -0
- package/dist/builtin-plugin/NamedModuleIdsPlugin.d.ts +10 -0
- package/dist/builtin-plugin/NaturalChunkIdsPlugin.d.ts +10 -0
- package/dist/builtin-plugin/NaturalModuleIdsPlugin.d.ts +8 -0
- package/dist/builtin-plugin/NoEmitOnErrorsPlugin.d.ts +10 -0
- package/dist/builtin-plugin/NodeTargetPlugin.d.ts +10 -0
- package/dist/builtin-plugin/ProgressPlugin.d.ts +11 -0
- package/dist/builtin-plugin/ProvidePlugin.d.ts +11 -0
- package/dist/builtin-plugin/RealContentHashPlugin.d.ts +10 -0
- package/dist/builtin-plugin/RemoveDuplicateModulesPlugin.d.ts +10 -0
- package/dist/builtin-plugin/RemoveEmptyChunksPlugin.d.ts +10 -0
- package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +11 -0
- package/dist/builtin-plugin/RuntimePlugin.d.ts +10 -0
- package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +10 -0
- package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +20 -0
- package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +11 -0
- package/dist/builtin-plugin/SplitChunksPlugin.d.ts +11 -0
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +213 -0
- package/dist/builtin-plugin/WarnCaseSensitiveModulesPlugin.d.ts +10 -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 +22 -0
- package/dist/builtin-plugin/css-extract/index.d.ts +23 -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/index.d.ts +71 -0
- package/dist/builtin-plugin/lazy-compilation/backend.d.ts +46 -0
- package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +24 -0
- package/dist/builtin-plugin/lazy-compilation/plugin.d.ts +13 -0
- package/dist/config/adapter.d.ts +10 -0
- package/dist/config/adapterRuleUse.d.ts +157 -0
- package/dist/config/browserslistTargetHandler.d.ts +21 -0
- package/dist/config/defaults.d.ts +12 -0
- package/dist/config/index.d.ts +5 -0
- package/dist/config/normalization.d.ts +128 -0
- package/dist/config/target.d.ts +89 -0
- package/dist/config/types.d.ts +2136 -0
- package/dist/config/utils.d.ts +16 -0
- package/dist/config/zod.d.ts +4090 -0
- package/dist/container/ContainerPlugin.d.ts +40 -0
- package/dist/container/ContainerReferencePlugin.d.ts +33 -0
- package/dist/container/ModuleFederationPlugin.d.ts +13 -0
- package/dist/container/ModuleFederationPluginV1.d.ts +22 -0
- package/dist/container/ModuleFederationRuntimePlugin.d.ts +10 -0
- package/dist/container/options.d.ts +3 -0
- package/dist/cssExtractHmr.js +224 -0
- package/dist/cssExtractLoader.js +278 -0
- package/dist/error/ConcurrentCompilationError.d.ts +14 -0
- package/dist/exports.d.ts +167 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +20251 -0
- package/dist/lib/AbstractMethodError.d.ts +24 -0
- package/dist/lib/Cache.d.ts +65 -0
- package/dist/lib/CacheFacade.d.ts +167 -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/NormalModuleReplacementPlugin.d.ts +29 -0
- package/dist/lib/WebpackError.d.ts +23 -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/index.d.ts +40 -0
- package/dist/loader-runner/loadLoader.d.ts +11 -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/moduleFederationDefaultRuntime.js +1 -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/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 +4 -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 +295 -0
- package/dist/util/ArrayQueue.d.ts +45 -0
- package/dist/util/AssetInfo.d.ts +7 -0
- package/dist/util/MergeCaller.d.ts +9 -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 +54 -0
- package/dist/util/comparators.d.ts +20 -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 +342 -0
- package/dist/util/hash/BatchedHash.d.ts +29 -0
- package/dist/util/hash/index.d.ts +17 -0
- package/dist/util/hash/md4.d.ts +11 -0
- package/dist/util/hash/wasm-hash.d.ts +52 -0
- package/dist/util/hash/xxhash64.d.ts +11 -0
- package/dist/util/identifier.d.ts +79 -0
- package/dist/util/index.d.ts +19 -0
- package/dist/util/memoize.d.ts +3 -0
- package/dist/util/smartGrouping.d.ts +21 -0
- package/dist/util/source.d.ts +7 -0
- package/dist/util/validate.d.ts +6 -0
- package/hot/dev-server.js +75 -0
- package/hot/emitter.js +21 -0
- package/hot/lazy-compilation-node.js +50 -0
- package/hot/lazy-compilation-web.js +83 -0
- package/hot/log-apply-result.js +49 -0
- package/hot/log.js +79 -0
- package/hot/only-dev-server.js +103 -0
- package/hot/poll.js +40 -0
- package/hot/signal.js +66 -0
- package/module.d.ts +244 -0
- package/package.json +55 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 Colin McDonnell
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"zod","author":"Colin McDonnell <colin@colinhacks.com>","version":"3.23.8","funding":"https://github.com/sponsors/colinhacks","license":"MIT","types":"index.d.ts","type":"commonjs"}
|
package/dist/Chunk.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type JsChunk, type JsCompilation } from "@rspack/binding";
|
|
2
|
+
import { Compilation } from ".";
|
|
3
|
+
import { ChunkGroup } from "./ChunkGroup";
|
|
4
|
+
export declare class Chunk {
|
|
5
|
+
#private;
|
|
6
|
+
name?: Readonly<string>;
|
|
7
|
+
id?: Readonly<string>;
|
|
8
|
+
ids: ReadonlyArray<string>;
|
|
9
|
+
idNameHints: ReadonlyArray<string>;
|
|
10
|
+
filenameTemplate?: Readonly<string>;
|
|
11
|
+
cssFilenameTemplate?: Readonly<string>;
|
|
12
|
+
files: ReadonlySet<string>;
|
|
13
|
+
runtime: ReadonlySet<string>;
|
|
14
|
+
hash?: Readonly<string>;
|
|
15
|
+
contentHash: Readonly<Record<string, string>>;
|
|
16
|
+
renderedHash?: Readonly<string>;
|
|
17
|
+
chunkReason?: Readonly<string>;
|
|
18
|
+
auxiliaryFiles: ReadonlySet<string>;
|
|
19
|
+
static __from_binding(chunk: JsChunk, compilation: Compilation): Chunk;
|
|
20
|
+
static __from_binding(chunk: JsChunk, compilation: JsCompilation): Chunk;
|
|
21
|
+
constructor(chunk: JsChunk, compilation: JsCompilation);
|
|
22
|
+
isOnlyInitial(): boolean;
|
|
23
|
+
canBeInitial(): boolean;
|
|
24
|
+
hasRuntime(): boolean;
|
|
25
|
+
get groupsIterable(): Iterable<ChunkGroup>;
|
|
26
|
+
getChunkMaps(realHash: boolean): {
|
|
27
|
+
hash: Record<string | number, string>;
|
|
28
|
+
contentHash: Record<string | number, Record<string, string>>;
|
|
29
|
+
name: Record<string | number, string>;
|
|
30
|
+
};
|
|
31
|
+
getAllAsyncChunks(): Iterable<Chunk>;
|
|
32
|
+
getAllInitialChunks(): Iterable<Chunk>;
|
|
33
|
+
getAllReferencedChunks(): Iterable<Chunk>;
|
|
34
|
+
/**
|
|
35
|
+
* Note: This is not a webpack public API, maybe removed in future.
|
|
36
|
+
*
|
|
37
|
+
* @internal
|
|
38
|
+
*/
|
|
39
|
+
__internal__innerUkey(): number;
|
|
40
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Chunk } from "./Chunk";
|
|
2
|
+
import type { Compilation } from "./Compilation";
|
|
3
|
+
import { Module } from "./Module";
|
|
4
|
+
export declare class ChunkGraph {
|
|
5
|
+
private compilation;
|
|
6
|
+
constructor(compilation: Compilation);
|
|
7
|
+
getChunkModules(chunk: Chunk): Readonly<Module[]>;
|
|
8
|
+
getChunkModulesIterable(chunk: Chunk): Iterable<Module>;
|
|
9
|
+
getChunkEntryModulesIterable(chunk: Chunk): Iterable<Module>;
|
|
10
|
+
getChunkEntryDependentChunksIterable(chunk: Chunk): Iterable<Chunk>;
|
|
11
|
+
getChunkModulesIterableBySourceType(chunk: Chunk, sourceType: string): Iterable<Module>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type JsChunkGroup, type JsChunkGroupOrigin, type JsCompilation } from "@rspack/binding";
|
|
2
|
+
import { Chunk } from "./Chunk";
|
|
3
|
+
export declare class ChunkGroup {
|
|
4
|
+
#private;
|
|
5
|
+
static __from_binding(chunk: JsChunkGroup, compilation: JsCompilation): ChunkGroup;
|
|
6
|
+
protected constructor(inner: JsChunkGroup, compilation: JsCompilation);
|
|
7
|
+
getFiles(): ReadonlyArray<string>;
|
|
8
|
+
getParents(): ReadonlyArray<ChunkGroup>;
|
|
9
|
+
isInitial(): boolean;
|
|
10
|
+
get chunks(): ReadonlyArray<Chunk>;
|
|
11
|
+
get index(): Readonly<number | undefined>;
|
|
12
|
+
get name(): Readonly<string | undefined>;
|
|
13
|
+
get origins(): ReadonlyArray<JsChunkGroupOrigin>;
|
|
14
|
+
/**
|
|
15
|
+
* Note: This is not a webpack public API, maybe removed in future.
|
|
16
|
+
*
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
__internal__innerUkey(): number;
|
|
20
|
+
/**
|
|
21
|
+
* Note: This is not a webpack public API, maybe removed in future.
|
|
22
|
+
*
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
__internal__innerCompilation(): JsCompilation;
|
|
26
|
+
}
|
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/blob/4b4ca3bb53f36a5b8fc6bc1bd976ed7af161bd80/lib/Compilation.js
|
|
4
|
+
*
|
|
5
|
+
* MIT Licensed
|
|
6
|
+
* Author Tobias Koppers @sokra
|
|
7
|
+
* Copyright (c) JS Foundation and other contributors
|
|
8
|
+
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
|
+
*/
|
|
10
|
+
import type * as binding from "@rspack/binding";
|
|
11
|
+
import { type ExternalObject, type JsCompilation, type JsRuntimeModule } from "@rspack/binding";
|
|
12
|
+
import * as liteTapable from "@rspack/lite-tapable";
|
|
13
|
+
import type { Source } from "../compiled/webpack-sources";
|
|
14
|
+
import { Chunk } from "./Chunk";
|
|
15
|
+
import { ChunkGraph } from "./ChunkGraph";
|
|
16
|
+
import { ChunkGroup } from "./ChunkGroup";
|
|
17
|
+
import type { Compiler } from "./Compiler";
|
|
18
|
+
import type { ContextModuleFactory } from "./ContextModuleFactory";
|
|
19
|
+
import { Dependency } from "./Dependency";
|
|
20
|
+
import { Entrypoint } from "./Entrypoint";
|
|
21
|
+
import { type CodeGenerationResult, Module } from "./Module";
|
|
22
|
+
import ModuleGraph from "./ModuleGraph";
|
|
23
|
+
import type { NormalModuleFactory } from "./NormalModuleFactory";
|
|
24
|
+
import type { ResolverFactory } from "./ResolverFactory";
|
|
25
|
+
import { type RspackError } from "./RspackError";
|
|
26
|
+
import { RuntimeModule } from "./RuntimeModule";
|
|
27
|
+
import { Stats, type StatsAsset, type StatsError, type StatsModule } from "./Stats";
|
|
28
|
+
import type { Filename, OutputNormalized, RspackOptionsNormalized, RspackPluginInstance, StatsOptions, StatsValue } from "./config";
|
|
29
|
+
import { Logger } from "./logging/Logger";
|
|
30
|
+
import { StatsFactory } from "./stats/StatsFactory";
|
|
31
|
+
import { StatsPrinter } from "./stats/StatsPrinter";
|
|
32
|
+
import { type AssetInfo } from "./util/AssetInfo";
|
|
33
|
+
import type { InputFileSystem } from "./util/fs";
|
|
34
|
+
import type Hash from "./util/hash";
|
|
35
|
+
export type { AssetInfo } from "./util/AssetInfo";
|
|
36
|
+
export type Assets = Record<string, Source>;
|
|
37
|
+
export interface Asset {
|
|
38
|
+
name: string;
|
|
39
|
+
source: Source;
|
|
40
|
+
info: AssetInfo;
|
|
41
|
+
}
|
|
42
|
+
export type PathDataChunkLike = {
|
|
43
|
+
id?: string;
|
|
44
|
+
name?: string;
|
|
45
|
+
hash?: string;
|
|
46
|
+
contentHash?: Record<string, string>;
|
|
47
|
+
};
|
|
48
|
+
export type PathData = {
|
|
49
|
+
filename?: string;
|
|
50
|
+
hash?: string;
|
|
51
|
+
contentHash?: string;
|
|
52
|
+
runtime?: string;
|
|
53
|
+
url?: string;
|
|
54
|
+
id?: string;
|
|
55
|
+
chunk?: Chunk | PathDataChunkLike;
|
|
56
|
+
contentHashType?: string;
|
|
57
|
+
};
|
|
58
|
+
export interface LogEntry {
|
|
59
|
+
type: string;
|
|
60
|
+
args: any[];
|
|
61
|
+
time?: number;
|
|
62
|
+
trace?: string[];
|
|
63
|
+
}
|
|
64
|
+
export interface CompilationParams {
|
|
65
|
+
normalModuleFactory: NormalModuleFactory;
|
|
66
|
+
contextModuleFactory: ContextModuleFactory;
|
|
67
|
+
}
|
|
68
|
+
export interface KnownCreateStatsOptionsContext {
|
|
69
|
+
forToString?: boolean;
|
|
70
|
+
}
|
|
71
|
+
export interface ExecuteModuleArgument {
|
|
72
|
+
codeGenerationResult: CodeGenerationResult;
|
|
73
|
+
moduleObject: {
|
|
74
|
+
id: string;
|
|
75
|
+
exports: any;
|
|
76
|
+
loaded: boolean;
|
|
77
|
+
error?: Error;
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
export interface ExecuteModuleContext {
|
|
81
|
+
__webpack_require__: (id: string) => any;
|
|
82
|
+
}
|
|
83
|
+
export interface KnownNormalizedStatsOptions {
|
|
84
|
+
context: string;
|
|
85
|
+
chunksSort: string;
|
|
86
|
+
modulesSort: string;
|
|
87
|
+
chunkModulesSort: string;
|
|
88
|
+
nestedModulesSort: string;
|
|
89
|
+
assetsSort: string;
|
|
90
|
+
ids: boolean;
|
|
91
|
+
cachedAssets: boolean;
|
|
92
|
+
groupAssetsByEmitStatus: boolean;
|
|
93
|
+
groupAssetsByPath: boolean;
|
|
94
|
+
groupAssetsByExtension: boolean;
|
|
95
|
+
assetsSpace: number;
|
|
96
|
+
excludeAssets: ((value: string, asset: StatsAsset) => boolean)[];
|
|
97
|
+
excludeModules: ((name: string, module: StatsModule, type: "module" | "chunk" | "root-of-chunk" | "nested") => boolean)[];
|
|
98
|
+
warningsFilter: ((warning: StatsError, textValue: string) => boolean)[];
|
|
99
|
+
cachedModules: boolean;
|
|
100
|
+
orphanModules: boolean;
|
|
101
|
+
dependentModules: boolean;
|
|
102
|
+
runtimeModules: boolean;
|
|
103
|
+
groupModulesByCacheStatus: boolean;
|
|
104
|
+
groupModulesByLayer: boolean;
|
|
105
|
+
groupModulesByAttributes: boolean;
|
|
106
|
+
groupModulesByPath: boolean;
|
|
107
|
+
groupModulesByExtension: boolean;
|
|
108
|
+
groupModulesByType: boolean;
|
|
109
|
+
entrypoints: boolean | "auto";
|
|
110
|
+
chunkGroups: boolean;
|
|
111
|
+
chunkGroupAuxiliary: boolean;
|
|
112
|
+
chunkGroupChildren: boolean;
|
|
113
|
+
chunkGroupMaxAssets: number;
|
|
114
|
+
modulesSpace: number;
|
|
115
|
+
chunkModulesSpace: number;
|
|
116
|
+
nestedModulesSpace: number;
|
|
117
|
+
logging: false | "none" | "error" | "warn" | "info" | "log" | "verbose";
|
|
118
|
+
loggingDebug: ((value: string) => boolean)[];
|
|
119
|
+
loggingTrace: boolean;
|
|
120
|
+
chunkModules: boolean;
|
|
121
|
+
chunkRelations: boolean;
|
|
122
|
+
reasons: boolean;
|
|
123
|
+
moduleAssets: boolean;
|
|
124
|
+
nestedModules: boolean;
|
|
125
|
+
source: boolean;
|
|
126
|
+
usedExports: boolean;
|
|
127
|
+
providedExports: boolean;
|
|
128
|
+
optimizationBailout: boolean;
|
|
129
|
+
depth: boolean;
|
|
130
|
+
assets: boolean;
|
|
131
|
+
chunks: boolean;
|
|
132
|
+
errors: boolean;
|
|
133
|
+
errorsCount: boolean;
|
|
134
|
+
hash: boolean;
|
|
135
|
+
modules: boolean;
|
|
136
|
+
warnings: boolean;
|
|
137
|
+
warningsCount: boolean;
|
|
138
|
+
}
|
|
139
|
+
export type CreateStatsOptionsContext = KnownCreateStatsOptionsContext & Record<string, any>;
|
|
140
|
+
export type NormalizedStatsOptions = KnownNormalizedStatsOptions & Omit<StatsOptions, keyof KnownNormalizedStatsOptions> & Record<string, any>;
|
|
141
|
+
export declare class Compilation {
|
|
142
|
+
#private;
|
|
143
|
+
hooks: Readonly<{
|
|
144
|
+
processAssets: liteTapable.AsyncSeriesHook<Assets>;
|
|
145
|
+
afterProcessAssets: liteTapable.SyncHook<Assets>;
|
|
146
|
+
childCompiler: liteTapable.SyncHook<[Compiler, string, number]>;
|
|
147
|
+
log: liteTapable.SyncBailHook<[string, LogEntry], true>;
|
|
148
|
+
additionalAssets: any;
|
|
149
|
+
optimizeModules: liteTapable.SyncBailHook<Iterable<Module>, void>;
|
|
150
|
+
afterOptimizeModules: liteTapable.SyncHook<Iterable<Module>, void>;
|
|
151
|
+
optimizeTree: liteTapable.AsyncSeriesHook<[
|
|
152
|
+
Iterable<Chunk>,
|
|
153
|
+
Iterable<Module>
|
|
154
|
+
]>;
|
|
155
|
+
optimizeChunkModules: liteTapable.AsyncSeriesBailHook<[
|
|
156
|
+
Iterable<Chunk>,
|
|
157
|
+
Iterable<Module>
|
|
158
|
+
], void>;
|
|
159
|
+
finishModules: liteTapable.AsyncSeriesHook<[Iterable<Module>], void>;
|
|
160
|
+
chunkHash: liteTapable.SyncHook<[Chunk, Hash], void>;
|
|
161
|
+
chunkAsset: liteTapable.SyncHook<[Chunk, string], void>;
|
|
162
|
+
processWarnings: liteTapable.SyncWaterfallHook<[Error[]]>;
|
|
163
|
+
succeedModule: liteTapable.SyncHook<[Module], void>;
|
|
164
|
+
stillValidModule: liteTapable.SyncHook<[Module], void>;
|
|
165
|
+
statsPreset: liteTapable.HookMap<liteTapable.SyncHook<[
|
|
166
|
+
Partial<StatsOptions>,
|
|
167
|
+
CreateStatsOptionsContext
|
|
168
|
+
], void>>;
|
|
169
|
+
statsNormalize: liteTapable.SyncHook<[
|
|
170
|
+
Partial<StatsOptions>,
|
|
171
|
+
CreateStatsOptionsContext
|
|
172
|
+
], void>;
|
|
173
|
+
statsFactory: liteTapable.SyncHook<[StatsFactory, StatsOptions], void>;
|
|
174
|
+
statsPrinter: liteTapable.SyncHook<[StatsPrinter, StatsOptions], void>;
|
|
175
|
+
buildModule: liteTapable.SyncHook<[Module]>;
|
|
176
|
+
executeModule: liteTapable.SyncHook<[
|
|
177
|
+
ExecuteModuleArgument,
|
|
178
|
+
ExecuteModuleContext
|
|
179
|
+
]>;
|
|
180
|
+
additionalTreeRuntimeRequirements: liteTapable.SyncHook<[
|
|
181
|
+
Chunk,
|
|
182
|
+
Set<string>
|
|
183
|
+
], void>;
|
|
184
|
+
runtimeRequirementInTree: liteTapable.HookMap<liteTapable.SyncBailHook<[Chunk, Set<string>], void>>;
|
|
185
|
+
runtimeModule: liteTapable.SyncHook<[JsRuntimeModule, Chunk], void>;
|
|
186
|
+
seal: liteTapable.SyncHook<[], void>;
|
|
187
|
+
afterSeal: liteTapable.AsyncSeriesHook<[], void>;
|
|
188
|
+
}>;
|
|
189
|
+
name?: string;
|
|
190
|
+
startTime?: number;
|
|
191
|
+
endTime?: number;
|
|
192
|
+
compiler: Compiler;
|
|
193
|
+
resolverFactory: ResolverFactory;
|
|
194
|
+
inputFileSystem: InputFileSystem | null;
|
|
195
|
+
options: RspackOptionsNormalized;
|
|
196
|
+
outputOptions: OutputNormalized;
|
|
197
|
+
logging: Map<string, LogEntry[]>;
|
|
198
|
+
childrenCounters: Record<string, number>;
|
|
199
|
+
children: Compilation[];
|
|
200
|
+
chunkGraph: ChunkGraph;
|
|
201
|
+
moduleGraph: ModuleGraph;
|
|
202
|
+
fileSystemInfo: {
|
|
203
|
+
createSnapshot(): null;
|
|
204
|
+
};
|
|
205
|
+
constructor(compiler: Compiler, inner: JsCompilation);
|
|
206
|
+
get hash(): Readonly<string | null>;
|
|
207
|
+
get fullHash(): Readonly<string | null>;
|
|
208
|
+
/**
|
|
209
|
+
* Get a map of all assets.
|
|
210
|
+
*/
|
|
211
|
+
get assets(): Record<string, Source>;
|
|
212
|
+
/**
|
|
213
|
+
* Get a map of all entrypoints.
|
|
214
|
+
*/
|
|
215
|
+
get entrypoints(): ReadonlyMap<string, Entrypoint>;
|
|
216
|
+
get chunkGroups(): ReadonlyArray<ChunkGroup>;
|
|
217
|
+
/**
|
|
218
|
+
* Get the named chunk groups.
|
|
219
|
+
*
|
|
220
|
+
* Note: This is a proxy for webpack internal API, only method `get`, `keys`, `values` and `entries` are supported now.
|
|
221
|
+
*/
|
|
222
|
+
get namedChunkGroups(): ReadonlyMap<string, Readonly<ChunkGroup>>;
|
|
223
|
+
get modules(): ReadonlySet<Module>;
|
|
224
|
+
get builtModules(): ReadonlySet<Module>;
|
|
225
|
+
get chunks(): ReadonlySet<Chunk>;
|
|
226
|
+
/**
|
|
227
|
+
* Get the named chunks.
|
|
228
|
+
*
|
|
229
|
+
* Note: This is a proxy for webpack internal API, only method `get`, `keys`, `values` and `entries` are supported now.
|
|
230
|
+
*/
|
|
231
|
+
get namedChunks(): ReadonlyMap<string, Readonly<Chunk>>;
|
|
232
|
+
get entries(): Map<string, EntryData>;
|
|
233
|
+
/**
|
|
234
|
+
* Note: This is not a webpack public API, maybe removed in future.
|
|
235
|
+
*
|
|
236
|
+
* @internal
|
|
237
|
+
*/
|
|
238
|
+
__internal__getCustomModule(moduleIdentifier: string): {
|
|
239
|
+
buildInfo: Record<string, unknown>;
|
|
240
|
+
buildMeta: Record<string, unknown>;
|
|
241
|
+
};
|
|
242
|
+
getCache(name: string): import("./lib/CacheFacade").CacheFacade;
|
|
243
|
+
createStatsOptions(statsValue: StatsValue | undefined, context?: CreateStatsOptionsContext): NormalizedStatsOptions;
|
|
244
|
+
createStatsFactory(options: StatsOptions): StatsFactory;
|
|
245
|
+
createStatsPrinter(options: StatsOptions): StatsPrinter;
|
|
246
|
+
/**
|
|
247
|
+
* Update an existing asset. Trying to update an asset that doesn't exist will throw an error.
|
|
248
|
+
*/
|
|
249
|
+
updateAsset(filename: string, newSourceOrFunction: Source | ((source: Source) => Source), assetInfoUpdateOrFunction?: AssetInfo | ((assetInfo: AssetInfo) => AssetInfo)): void;
|
|
250
|
+
/**
|
|
251
|
+
* Emit an not existing asset. Trying to emit an asset that already exists will throw an error.
|
|
252
|
+
*
|
|
253
|
+
* @param file - file name
|
|
254
|
+
* @param source - asset source
|
|
255
|
+
* @param assetInfo - extra asset information
|
|
256
|
+
*/
|
|
257
|
+
emitAsset(filename: string, source: Source, assetInfo?: AssetInfo): void;
|
|
258
|
+
/**
|
|
259
|
+
* Note: This is not a webpack public API, maybe removed in future.
|
|
260
|
+
*
|
|
261
|
+
* @internal
|
|
262
|
+
*/
|
|
263
|
+
__internal__emit_asset_from_loader(filename: string, source: Source, assetInfo: AssetInfo, module: string): void;
|
|
264
|
+
deleteAsset(filename: string): void;
|
|
265
|
+
renameAsset(filename: string, newFilename: string): void;
|
|
266
|
+
/**
|
|
267
|
+
* Get an array of Asset
|
|
268
|
+
*/
|
|
269
|
+
getAssets(): ReadonlyArray<Asset>;
|
|
270
|
+
getAsset(name: string): Readonly<Asset> | void;
|
|
271
|
+
/**
|
|
272
|
+
* Note: This is not a webpack public API, maybe removed in future.
|
|
273
|
+
*
|
|
274
|
+
* @internal
|
|
275
|
+
*/
|
|
276
|
+
__internal__pushRspackDiagnostic(diagnostic: binding.JsRspackDiagnostic): void;
|
|
277
|
+
/**
|
|
278
|
+
* Note: This is not a webpack public API, maybe removed in future.
|
|
279
|
+
*
|
|
280
|
+
* @internal
|
|
281
|
+
*/
|
|
282
|
+
__internal__pushDiagnostic(diagnostic: ExternalObject<"Diagnostic">): void;
|
|
283
|
+
/**
|
|
284
|
+
* Note: This is not a webpack public API, maybe removed in future.
|
|
285
|
+
*
|
|
286
|
+
* @internal
|
|
287
|
+
*/
|
|
288
|
+
__internal__pushDiagnostics(diagnostics: ExternalObject<"Diagnostic[]">): void;
|
|
289
|
+
get errors(): RspackError[];
|
|
290
|
+
set errors(errors: RspackError[]);
|
|
291
|
+
get warnings(): RspackError[];
|
|
292
|
+
set warnings(warnings: RspackError[]);
|
|
293
|
+
getPath(filename: Filename, data?: PathData): string;
|
|
294
|
+
getPathWithInfo(filename: Filename, data?: PathData): binding.PathWithInfo;
|
|
295
|
+
getAssetPath(filename: Filename, data?: PathData): string;
|
|
296
|
+
getAssetPathWithInfo(filename: Filename, data?: PathData): binding.PathWithInfo;
|
|
297
|
+
getLogger(name: string | (() => string)): Logger;
|
|
298
|
+
fileDependencies: {
|
|
299
|
+
[Symbol.iterator](): Generator<string, void, unknown>;
|
|
300
|
+
has(dep: string): boolean;
|
|
301
|
+
add: (dep: string) => void;
|
|
302
|
+
addAll: (deps: Iterable<string>) => void;
|
|
303
|
+
};
|
|
304
|
+
contextDependencies: {
|
|
305
|
+
[Symbol.iterator](): Generator<string, void, unknown>;
|
|
306
|
+
has(dep: string): boolean;
|
|
307
|
+
add: (dep: string) => void;
|
|
308
|
+
addAll: (deps: Iterable<string>) => void;
|
|
309
|
+
};
|
|
310
|
+
missingDependencies: {
|
|
311
|
+
[Symbol.iterator](): Generator<string, void, unknown>;
|
|
312
|
+
has(dep: string): boolean;
|
|
313
|
+
add: (dep: string) => void;
|
|
314
|
+
addAll: (deps: Iterable<string>) => void;
|
|
315
|
+
};
|
|
316
|
+
buildDependencies: {
|
|
317
|
+
[Symbol.iterator](): Generator<string, void, unknown>;
|
|
318
|
+
has(dep: string): boolean;
|
|
319
|
+
add: (dep: string) => void;
|
|
320
|
+
addAll: (deps: Iterable<string>) => void;
|
|
321
|
+
};
|
|
322
|
+
getStats(): Stats;
|
|
323
|
+
createChildCompiler(name: string, outputOptions: OutputNormalized, plugins: RspackPluginInstance[]): Compiler;
|
|
324
|
+
rebuildModule(m: Module, f: (err: Error, m: Module) => void): void;
|
|
325
|
+
addRuntimeModule(chunk: Chunk, runtimeModule: RuntimeModule): void;
|
|
326
|
+
/**
|
|
327
|
+
* Get the `Source` of a given asset filename.
|
|
328
|
+
*
|
|
329
|
+
* Note: This is not a webpack public API, maybe removed in the future.
|
|
330
|
+
*
|
|
331
|
+
* @internal
|
|
332
|
+
*/
|
|
333
|
+
__internal__getAssetSource(filename: string): Source | void;
|
|
334
|
+
/**
|
|
335
|
+
* Set the `Source` of an given asset filename.
|
|
336
|
+
*
|
|
337
|
+
* Note: This is not a webpack public API, maybe removed in future.
|
|
338
|
+
*
|
|
339
|
+
* @internal
|
|
340
|
+
*/
|
|
341
|
+
__internal__setAssetSource(filename: string, source: Source): void;
|
|
342
|
+
/**
|
|
343
|
+
* Delete the `Source` of an given asset filename.
|
|
344
|
+
*
|
|
345
|
+
* Note: This is not a webpack public API, maybe removed in future.
|
|
346
|
+
*
|
|
347
|
+
* @internal
|
|
348
|
+
*/
|
|
349
|
+
__internal__deleteAssetSource(filename: string): void;
|
|
350
|
+
/**
|
|
351
|
+
* Get a list of asset filenames.
|
|
352
|
+
*
|
|
353
|
+
* Note: This is not a webpack public API, maybe removed in future.
|
|
354
|
+
*
|
|
355
|
+
* @internal
|
|
356
|
+
*/
|
|
357
|
+
__internal__getAssetFilenames(): string[];
|
|
358
|
+
/**
|
|
359
|
+
* Test if an asset exists.
|
|
360
|
+
*
|
|
361
|
+
* Note: This is not a webpack public API, maybe removed in future.
|
|
362
|
+
*
|
|
363
|
+
* @internal
|
|
364
|
+
*/
|
|
365
|
+
__internal__hasAsset(name: string): boolean;
|
|
366
|
+
/**
|
|
367
|
+
* Note: This is not a webpack public API, maybe removed in future.
|
|
368
|
+
*
|
|
369
|
+
* @internal
|
|
370
|
+
*/
|
|
371
|
+
__internal__getChunks(): Chunk[];
|
|
372
|
+
/**
|
|
373
|
+
* Note: This is not a webpack public API, maybe removed in future.
|
|
374
|
+
*
|
|
375
|
+
* @internal
|
|
376
|
+
*/
|
|
377
|
+
__internal_getInner(): binding.JsCompilation;
|
|
378
|
+
get __internal__shutdown(): boolean;
|
|
379
|
+
set __internal__shutdown(shutdown: boolean);
|
|
380
|
+
seal(): void;
|
|
381
|
+
unseal(): void;
|
|
382
|
+
static PROCESS_ASSETS_STAGE_ADDITIONAL: number;
|
|
383
|
+
static PROCESS_ASSETS_STAGE_PRE_PROCESS: number;
|
|
384
|
+
static PROCESS_ASSETS_STAGE_DERIVED: number;
|
|
385
|
+
static PROCESS_ASSETS_STAGE_ADDITIONS: number;
|
|
386
|
+
static PROCESS_ASSETS_STAGE_NONE: number;
|
|
387
|
+
static PROCESS_ASSETS_STAGE_OPTIMIZE: number;
|
|
388
|
+
static PROCESS_ASSETS_STAGE_OPTIMIZE_COUNT: number;
|
|
389
|
+
static PROCESS_ASSETS_STAGE_OPTIMIZE_COMPATIBILITY: number;
|
|
390
|
+
static PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE: number;
|
|
391
|
+
static PROCESS_ASSETS_STAGE_DEV_TOOLING: number;
|
|
392
|
+
static PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE: number;
|
|
393
|
+
static PROCESS_ASSETS_STAGE_SUMMARIZE: number;
|
|
394
|
+
static PROCESS_ASSETS_STAGE_OPTIMIZE_HASH: number;
|
|
395
|
+
static PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER: number;
|
|
396
|
+
static PROCESS_ASSETS_STAGE_ANALYSE: number;
|
|
397
|
+
static PROCESS_ASSETS_STAGE_REPORT: number;
|
|
398
|
+
}
|
|
399
|
+
export declare class EntryData {
|
|
400
|
+
dependencies: Dependency[];
|
|
401
|
+
includeDependencies: Dependency[];
|
|
402
|
+
options: binding.JsEntryOptions;
|
|
403
|
+
static __from_binding(binding: binding.JsEntryData): EntryData;
|
|
404
|
+
private constructor();
|
|
405
|
+
}
|
|
406
|
+
export declare class Entries implements Map<string, EntryData> {
|
|
407
|
+
#private;
|
|
408
|
+
constructor(data: binding.JsEntries);
|
|
409
|
+
clear(): void;
|
|
410
|
+
forEach(callback: (value: EntryData, key: string, map: Map<string, EntryData>) => void, thisArg?: any): void;
|
|
411
|
+
get size(): number;
|
|
412
|
+
entries(): ReturnType<Map<string, EntryData>["entries"]>;
|
|
413
|
+
values(): ReturnType<Map<string, EntryData>["values"]>;
|
|
414
|
+
[Symbol.iterator](): ReturnType<Map<string, EntryData>["entries"]>;
|
|
415
|
+
get [Symbol.toStringTag](): string;
|
|
416
|
+
has(key: string): boolean;
|
|
417
|
+
set(key: string, value: EntryData): this;
|
|
418
|
+
delete(key: string): boolean;
|
|
419
|
+
get(key: string): EntryData | undefined;
|
|
420
|
+
keys(): ReturnType<Map<string, EntryData>["keys"]>;
|
|
421
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/blob/4b4ca3bb53f36a5b8fc6bc1bd976ed7af161bd80/lib/Compiler.js
|
|
4
|
+
*
|
|
5
|
+
* MIT Licensed
|
|
6
|
+
* Author Tobias Koppers @sokra
|
|
7
|
+
* Copyright (c) JS Foundation and other contributors
|
|
8
|
+
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
|
+
*/
|
|
10
|
+
import * as binding from "@rspack/binding";
|
|
11
|
+
import * as liteTapable from "@rspack/lite-tapable";
|
|
12
|
+
import Cache from "./lib/Cache";
|
|
13
|
+
import CacheFacade from "./lib/CacheFacade";
|
|
14
|
+
import { Chunk } from "./Chunk";
|
|
15
|
+
import { Compilation } from "./Compilation";
|
|
16
|
+
import { ContextModuleFactory } from "./ContextModuleFactory";
|
|
17
|
+
import { NormalModuleFactory } from "./NormalModuleFactory";
|
|
18
|
+
import { ResolverFactory } from "./ResolverFactory";
|
|
19
|
+
import { RuleSetCompiler } from "./RuleSetCompiler";
|
|
20
|
+
import { Stats } from "./Stats";
|
|
21
|
+
import { Watching } from "./Watching";
|
|
22
|
+
import { rspack } from "./index";
|
|
23
|
+
import { Logger } from "./logging/Logger";
|
|
24
|
+
import type Watchpack from "../compiled/watchpack";
|
|
25
|
+
import type { Source } from "../compiled/webpack-sources";
|
|
26
|
+
import type { CompilationParams } from "./Compilation";
|
|
27
|
+
import type { FileSystemInfoEntry } from "./FileSystemInfo";
|
|
28
|
+
import type { EntryNormalized, OutputNormalized, RspackOptionsNormalized, RspackPluginInstance } from "./config";
|
|
29
|
+
import type { InputFileSystem, IntermediateFileSystem, OutputFileSystem, WatchFileSystem } from "./util/fs";
|
|
30
|
+
export interface AssetEmittedInfo {
|
|
31
|
+
content: Buffer;
|
|
32
|
+
source: Source;
|
|
33
|
+
outputPath: string;
|
|
34
|
+
targetPath: string;
|
|
35
|
+
compilation: Compilation;
|
|
36
|
+
}
|
|
37
|
+
declare class Compiler {
|
|
38
|
+
#private;
|
|
39
|
+
hooks: {
|
|
40
|
+
done: liteTapable.AsyncSeriesHook<Stats>;
|
|
41
|
+
afterDone: liteTapable.SyncHook<Stats>;
|
|
42
|
+
thisCompilation: liteTapable.SyncHook<[Compilation, CompilationParams]>;
|
|
43
|
+
compilation: liteTapable.SyncHook<[Compilation, CompilationParams]>;
|
|
44
|
+
invalid: liteTapable.SyncHook<[string | null, number]>;
|
|
45
|
+
compile: liteTapable.SyncHook<[CompilationParams]>;
|
|
46
|
+
normalModuleFactory: liteTapable.SyncHook<NormalModuleFactory>;
|
|
47
|
+
contextModuleFactory: liteTapable.SyncHook<ContextModuleFactory>;
|
|
48
|
+
initialize: liteTapable.SyncHook<[]>;
|
|
49
|
+
shouldEmit: liteTapable.SyncBailHook<[Compilation], boolean>;
|
|
50
|
+
infrastructureLog: liteTapable.SyncBailHook<[string, string, any[]], true>;
|
|
51
|
+
beforeRun: liteTapable.AsyncSeriesHook<[Compiler]>;
|
|
52
|
+
run: liteTapable.AsyncSeriesHook<[Compiler]>;
|
|
53
|
+
emit: liteTapable.AsyncSeriesHook<[Compilation]>;
|
|
54
|
+
assetEmitted: liteTapable.AsyncSeriesHook<[string, AssetEmittedInfo]>;
|
|
55
|
+
afterEmit: liteTapable.AsyncSeriesHook<[Compilation]>;
|
|
56
|
+
failed: liteTapable.SyncHook<[Error]>;
|
|
57
|
+
shutdown: liteTapable.AsyncSeriesHook<[]>;
|
|
58
|
+
watchRun: liteTapable.AsyncSeriesHook<[Compiler]>;
|
|
59
|
+
watchClose: liteTapable.SyncHook<[]>;
|
|
60
|
+
environment: liteTapable.SyncHook<[]>;
|
|
61
|
+
afterEnvironment: liteTapable.SyncHook<[]>;
|
|
62
|
+
afterPlugins: liteTapable.SyncHook<[Compiler]>;
|
|
63
|
+
afterResolvers: liteTapable.SyncHook<[Compiler]>;
|
|
64
|
+
make: liteTapable.AsyncParallelHook<[Compilation]>;
|
|
65
|
+
beforeCompile: liteTapable.AsyncSeriesHook<[CompilationParams]>;
|
|
66
|
+
afterCompile: liteTapable.AsyncSeriesHook<[Compilation]>;
|
|
67
|
+
finishMake: liteTapable.AsyncSeriesHook<[Compilation]>;
|
|
68
|
+
entryOption: liteTapable.SyncBailHook<[string, EntryNormalized], any>;
|
|
69
|
+
};
|
|
70
|
+
webpack: typeof rspack;
|
|
71
|
+
rspack: typeof rspack;
|
|
72
|
+
name?: string;
|
|
73
|
+
parentCompilation?: Compilation;
|
|
74
|
+
root: Compiler;
|
|
75
|
+
outputPath: string;
|
|
76
|
+
running: boolean;
|
|
77
|
+
idle: boolean;
|
|
78
|
+
resolverFactory: ResolverFactory;
|
|
79
|
+
infrastructureLogger: any;
|
|
80
|
+
watching?: Watching;
|
|
81
|
+
inputFileSystem: InputFileSystem | null;
|
|
82
|
+
intermediateFileSystem: IntermediateFileSystem | null;
|
|
83
|
+
outputFileSystem: OutputFileSystem | null;
|
|
84
|
+
watchFileSystem: WatchFileSystem | null;
|
|
85
|
+
records: Record<string, any[]>;
|
|
86
|
+
modifiedFiles?: ReadonlySet<string>;
|
|
87
|
+
removedFiles?: ReadonlySet<string>;
|
|
88
|
+
fileTimestamps?: ReadonlyMap<string, FileSystemInfoEntry | "ignore" | null>;
|
|
89
|
+
contextTimestamps?: ReadonlyMap<string, FileSystemInfoEntry | "ignore" | null>;
|
|
90
|
+
fsStartTime?: number;
|
|
91
|
+
watchMode: boolean;
|
|
92
|
+
context: string;
|
|
93
|
+
cache: Cache;
|
|
94
|
+
compilerPath: string;
|
|
95
|
+
options: RspackOptionsNormalized;
|
|
96
|
+
constructor(context: string, options: RspackOptionsNormalized);
|
|
97
|
+
get recordsInputPath(): never;
|
|
98
|
+
get recordsOutputPath(): never;
|
|
99
|
+
get managedPaths(): never;
|
|
100
|
+
get immutablePaths(): never;
|
|
101
|
+
get _lastCompilation(): Compilation | undefined;
|
|
102
|
+
/**
|
|
103
|
+
* Note: This is not a webpack public API, maybe removed in future.
|
|
104
|
+
* @internal
|
|
105
|
+
*/
|
|
106
|
+
get __internal__builtinPlugins(): binding.BuiltinPlugin[];
|
|
107
|
+
/**
|
|
108
|
+
* Note: This is not a webpack public API, maybe removed in future.
|
|
109
|
+
* @internal
|
|
110
|
+
*/
|
|
111
|
+
get __internal__ruleSet(): RuleSetCompiler;
|
|
112
|
+
/**
|
|
113
|
+
* @param name - cache name
|
|
114
|
+
* @returns the cache facade instance
|
|
115
|
+
*/
|
|
116
|
+
getCache(name: string): CacheFacade;
|
|
117
|
+
/**
|
|
118
|
+
* @param name - name of the logger, or function called once to get the logger name
|
|
119
|
+
* @returns a logger with that name
|
|
120
|
+
*/
|
|
121
|
+
getInfrastructureLogger(name: string | (() => string)): Logger;
|
|
122
|
+
/**
|
|
123
|
+
* @param watchOptions - the watcher's options
|
|
124
|
+
* @param handler - signals when the call finishes
|
|
125
|
+
* @returns a compiler watcher
|
|
126
|
+
*/
|
|
127
|
+
watch(watchOptions: Watchpack.WatchOptions, handler: liteTapable.Callback<Error, Stats>): Watching;
|
|
128
|
+
/**
|
|
129
|
+
* @param callback - signals when the call finishes
|
|
130
|
+
*/
|
|
131
|
+
run(callback: liteTapable.Callback<Error, Stats>): void;
|
|
132
|
+
runAsChild(callback: (err?: null | Error, entries?: Chunk[], compilation?: Compilation) => any): void;
|
|
133
|
+
purgeInputFileSystem(): void;
|
|
134
|
+
/**
|
|
135
|
+
* @param compilation - the compilation
|
|
136
|
+
* @param compilerName - the compiler's name
|
|
137
|
+
* @param compilerIndex - the compiler's index
|
|
138
|
+
* @param outputOptions - the output options
|
|
139
|
+
* @param plugins - the plugins to apply
|
|
140
|
+
* @returns a child compiler
|
|
141
|
+
*/
|
|
142
|
+
createChildCompiler(compilation: Compilation, compilerName: string, compilerIndex: number, outputOptions: OutputNormalized, plugins: RspackPluginInstance[]): Compiler;
|
|
143
|
+
isChild(): boolean;
|
|
144
|
+
compile(callback: liteTapable.Callback<Error, Compilation>): void;
|
|
145
|
+
close(callback: (error?: Error | null) => void): void;
|
|
146
|
+
/**
|
|
147
|
+
* Note: This is not a webpack public API, maybe removed in future.
|
|
148
|
+
* @internal
|
|
149
|
+
*/
|
|
150
|
+
__internal__rebuild(modifiedFiles?: ReadonlySet<string>, removedFiles?: ReadonlySet<string>, callback?: (error: Error | null) => void): void;
|
|
151
|
+
__internal__registerBuiltinPlugin(plugin: binding.BuiltinPlugin): void;
|
|
152
|
+
__internal__getModuleExecutionResult(id: number): any;
|
|
153
|
+
}
|
|
154
|
+
export { Compiler };
|