@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,13 @@
|
|
|
1
|
+
import * as liteTapable from "@rspack/lite-tapable";
|
|
2
|
+
import type { ContextModuleFactoryAfterResolveResult, ContextModuleFactoryBeforeResolveResult } from "./Module";
|
|
3
|
+
export declare class ContextModuleFactory {
|
|
4
|
+
hooks: {
|
|
5
|
+
beforeResolve: liteTapable.AsyncSeriesWaterfallHook<[
|
|
6
|
+
ContextModuleFactoryBeforeResolveResult
|
|
7
|
+
], ContextModuleFactoryBeforeResolveResult | void>;
|
|
8
|
+
afterResolve: liteTapable.AsyncSeriesWaterfallHook<[
|
|
9
|
+
ContextModuleFactoryAfterResolveResult
|
|
10
|
+
], ContextModuleFactoryAfterResolveResult | void>;
|
|
11
|
+
};
|
|
12
|
+
constructor();
|
|
13
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { JsDependenciesBlock } from "@rspack/binding";
|
|
2
|
+
import { Dependency } from "./Dependency";
|
|
3
|
+
export declare class DependenciesBlock {
|
|
4
|
+
#private;
|
|
5
|
+
readonly dependencies: Dependency[];
|
|
6
|
+
readonly blocks: DependenciesBlock[];
|
|
7
|
+
static __from_binding(binding: JsDependenciesBlock): DependenciesBlock;
|
|
8
|
+
static __to_binding(block: DependenciesBlock): JsDependenciesBlock;
|
|
9
|
+
private constructor();
|
|
10
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { JsDependency } from "@rspack/binding";
|
|
2
|
+
export declare class Dependency {
|
|
3
|
+
#private;
|
|
4
|
+
readonly type: string;
|
|
5
|
+
readonly category: string;
|
|
6
|
+
readonly request: string | undefined;
|
|
7
|
+
critical: boolean;
|
|
8
|
+
static __from_binding(binding: JsDependency): Dependency;
|
|
9
|
+
static __to_binding(data: Dependency): JsDependency;
|
|
10
|
+
private constructor();
|
|
11
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type JsChunkGroup, type JsCompilation } from "@rspack/binding";
|
|
2
|
+
import { Chunk } from "./Chunk";
|
|
3
|
+
import { ChunkGroup } from "./ChunkGroup";
|
|
4
|
+
export declare class Entrypoint extends ChunkGroup {
|
|
5
|
+
static __from_binding(chunk: JsChunkGroup, compilation: JsCompilation): Entrypoint;
|
|
6
|
+
protected constructor(inner: JsChunkGroup, compilation: JsCompilation);
|
|
7
|
+
getRuntimeChunk(): Readonly<Chunk | null>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/ErrorHelpers.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
|
+
export declare const cutOffByFlag: (stack: string, flag: string) => string;
|
|
11
|
+
export declare const cutOffLoaderExecution: (stack: string) => string;
|
|
12
|
+
export declare const cutOffWebpackOptions: (stack: string) => string;
|
|
13
|
+
export declare const cutOffMultilineMessage: (stack: string, message: string) => string;
|
|
14
|
+
export declare const cutOffMessage: (stack: string, message: string) => string;
|
|
15
|
+
export declare const cleanUp: (stack: string, message: string) => string;
|
|
16
|
+
export declare const cleanUpWebpackOptions: (stack: string, message: string) => string;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { NodeFsStats, ThreadsafeNodeFS } from "@rspack/binding";
|
|
2
|
+
import { type IStats, type IntermediateFileSystem, type OutputFileSystem } from "./util/fs";
|
|
3
|
+
declare class ThreadsafeOutputNodeFS implements ThreadsafeNodeFS {
|
|
4
|
+
writeFile: (name: string, content: Buffer) => Promise<void> | void;
|
|
5
|
+
removeFile: (name: string) => Promise<void> | void;
|
|
6
|
+
mkdir: (name: string) => Promise<void> | void;
|
|
7
|
+
mkdirp: (name: string) => Promise<string | void> | string | void;
|
|
8
|
+
removeDirAll: (name: string) => Promise<string | void> | string | void;
|
|
9
|
+
readDir: (name: string) => Promise<string[] | void> | string[] | void;
|
|
10
|
+
readFile: (name: string) => Promise<Buffer | string | void> | Buffer | string | void;
|
|
11
|
+
stat: (name: string) => Promise<NodeFsStats | void> | NodeFsStats | void;
|
|
12
|
+
lstat: (name: string) => Promise<NodeFsStats | void> | NodeFsStats | void;
|
|
13
|
+
open: (name: string, flags: string) => Promise<number | void> | number | void;
|
|
14
|
+
rename: (from: string, to: string) => Promise<void> | void;
|
|
15
|
+
close: (fd: number) => Promise<void> | void;
|
|
16
|
+
write: (fd: number, content: Buffer, position: number) => Promise<number | void> | number | void;
|
|
17
|
+
writeAll: (fd: number, content: Buffer) => Promise<number | void> | number | void;
|
|
18
|
+
read: (fd: number, length: number, position: number) => Promise<Buffer | void> | Buffer | void;
|
|
19
|
+
readUntil: (fd: number, code: number, position: number) => Promise<Buffer | void> | Buffer | void;
|
|
20
|
+
readToEnd: (fd: number, position: number) => Promise<Buffer | void> | Buffer | void;
|
|
21
|
+
constructor(fs?: OutputFileSystem);
|
|
22
|
+
static __to_binding(fs?: OutputFileSystem): ThreadsafeOutputNodeFS;
|
|
23
|
+
static __to_binding_stat(stat: IStats): NodeFsStats;
|
|
24
|
+
}
|
|
25
|
+
declare class ThreadsafeIntermediateNodeFS extends ThreadsafeOutputNodeFS {
|
|
26
|
+
constructor(fs?: IntermediateFileSystem);
|
|
27
|
+
static __to_binding(fs?: IntermediateFileSystem): ThreadsafeIntermediateNodeFS;
|
|
28
|
+
}
|
|
29
|
+
export { ThreadsafeOutputNodeFS, ThreadsafeIntermediateNodeFS };
|
package/dist/Module.d.ts
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { JsCodegenerationResult, JsContextModuleFactoryAfterResolveData, JsContextModuleFactoryBeforeResolveData, JsCreateData, JsFactoryMeta } from "@rspack/binding";
|
|
2
|
+
import { JsModule } from "@rspack/binding";
|
|
3
|
+
import type { Source } from "../compiled/webpack-sources";
|
|
4
|
+
import type { Compilation } from "./Compilation";
|
|
5
|
+
import { DependenciesBlock } from "./DependenciesBlock";
|
|
6
|
+
import { Dependency } from "./Dependency";
|
|
7
|
+
export type ResourceData = {
|
|
8
|
+
resource: string;
|
|
9
|
+
path: string;
|
|
10
|
+
query?: string;
|
|
11
|
+
fragment?: string;
|
|
12
|
+
};
|
|
13
|
+
export type ResourceDataWithData = ResourceData & {
|
|
14
|
+
data?: Record<string, any>;
|
|
15
|
+
};
|
|
16
|
+
export type CreateData = Partial<JsCreateData>;
|
|
17
|
+
export type ContextInfo = {
|
|
18
|
+
issuer: string;
|
|
19
|
+
};
|
|
20
|
+
export type ResolveData = {
|
|
21
|
+
contextInfo: ContextInfo;
|
|
22
|
+
context: string;
|
|
23
|
+
request: string;
|
|
24
|
+
fileDependencies: string[];
|
|
25
|
+
missingDependencies: string[];
|
|
26
|
+
contextDependencies: string[];
|
|
27
|
+
createData?: CreateData;
|
|
28
|
+
};
|
|
29
|
+
export declare class ContextModuleFactoryBeforeResolveData {
|
|
30
|
+
#private;
|
|
31
|
+
context: string;
|
|
32
|
+
request: string;
|
|
33
|
+
regExp: RegExp | undefined;
|
|
34
|
+
recursive: boolean;
|
|
35
|
+
static __from_binding(binding: JsContextModuleFactoryBeforeResolveData): ContextModuleFactoryBeforeResolveData;
|
|
36
|
+
static __to_binding(data: ContextModuleFactoryBeforeResolveData): JsContextModuleFactoryBeforeResolveData;
|
|
37
|
+
private constructor();
|
|
38
|
+
}
|
|
39
|
+
export type ContextModuleFactoryBeforeResolveResult = false | ContextModuleFactoryBeforeResolveData;
|
|
40
|
+
export declare class ContextModuleFactoryAfterResolveData {
|
|
41
|
+
#private;
|
|
42
|
+
resource: number;
|
|
43
|
+
context: string;
|
|
44
|
+
request: string;
|
|
45
|
+
regExp: RegExp | undefined;
|
|
46
|
+
recursive: boolean;
|
|
47
|
+
readonly dependencies: Dependency[];
|
|
48
|
+
static __from_binding(binding: JsContextModuleFactoryAfterResolveData): ContextModuleFactoryAfterResolveData;
|
|
49
|
+
static __to_binding(data: ContextModuleFactoryAfterResolveData): JsContextModuleFactoryAfterResolveData;
|
|
50
|
+
private constructor();
|
|
51
|
+
}
|
|
52
|
+
export type ContextModuleFactoryAfterResolveResult = false | ContextModuleFactoryAfterResolveData;
|
|
53
|
+
export declare class Module {
|
|
54
|
+
#private;
|
|
55
|
+
readonly context?: string;
|
|
56
|
+
readonly resource?: string;
|
|
57
|
+
readonly request?: string;
|
|
58
|
+
userRequest?: string;
|
|
59
|
+
readonly rawRequest?: string;
|
|
60
|
+
readonly type: string;
|
|
61
|
+
readonly layer: null | string;
|
|
62
|
+
readonly factoryMeta?: JsFactoryMeta;
|
|
63
|
+
/**
|
|
64
|
+
* Records the dynamically added fields for Module on the JavaScript side.
|
|
65
|
+
* These fields are generally used within a plugin, so they do not need to be passed back to the Rust side.
|
|
66
|
+
* @see {@link Compilation#customModules}
|
|
67
|
+
*/
|
|
68
|
+
readonly buildInfo: Record<string, any>;
|
|
69
|
+
/**
|
|
70
|
+
* Records the dynamically added fields for Module on the JavaScript side.
|
|
71
|
+
* These fields are generally used within a plugin, so they do not need to be passed back to the Rust side.
|
|
72
|
+
* @see {@link Compilation#customModules}
|
|
73
|
+
*/
|
|
74
|
+
readonly buildMeta: Record<string, any>;
|
|
75
|
+
readonly modules: Module[] | undefined;
|
|
76
|
+
readonly blocks: DependenciesBlock[];
|
|
77
|
+
readonly dependencies: Dependency[];
|
|
78
|
+
readonly useSourceMap: boolean;
|
|
79
|
+
static __from_binding(binding: JsModule, compilation?: Compilation): Module;
|
|
80
|
+
static __to_binding(module: Module): JsModule;
|
|
81
|
+
constructor(module: JsModule, compilation?: Compilation);
|
|
82
|
+
originalSource(): Source | null;
|
|
83
|
+
identifier(): string;
|
|
84
|
+
nameForCondition(): string | null;
|
|
85
|
+
size(type?: string): number;
|
|
86
|
+
}
|
|
87
|
+
export declare class CodeGenerationResult {
|
|
88
|
+
#private;
|
|
89
|
+
constructor(result: JsCodegenerationResult);
|
|
90
|
+
get(sourceType: string): string;
|
|
91
|
+
}
|
|
92
|
+
export declare class CodeGenerationResults {
|
|
93
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { JsModuleGraph } from "@rspack/binding";
|
|
2
|
+
import { Dependency } from "./Dependency";
|
|
3
|
+
import { Module } from "./Module";
|
|
4
|
+
export default class ModuleGraph {
|
|
5
|
+
#private;
|
|
6
|
+
static __from_binding(binding: JsModuleGraph): ModuleGraph;
|
|
7
|
+
private constructor();
|
|
8
|
+
getModule(dependency: Dependency): Module | null;
|
|
9
|
+
getIssuer(module: Module): Module | null;
|
|
10
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
export declare const JAVASCRIPT_MODULE_TYPE_AUTO = "javascript/auto";
|
|
2
|
+
export declare const JAVASCRIPT_MODULE_TYPE_DYNAMIC = "javascript/dynamic";
|
|
3
|
+
/**
|
|
4
|
+
* This is the module type used for _strict_ ES Module syntax. This means that all legacy formats
|
|
5
|
+
* that webpack supports (CommonJS, AMD, SystemJS) are not supported.
|
|
6
|
+
*/
|
|
7
|
+
export declare const JAVASCRIPT_MODULE_TYPE_ESM = "javascript/esm";
|
|
8
|
+
/**
|
|
9
|
+
* This is the module type used for JSON files. JSON files are always parsed as ES Module.
|
|
10
|
+
*/
|
|
11
|
+
export declare const JSON_MODULE_TYPE = "json";
|
|
12
|
+
/**
|
|
13
|
+
* This is the module type used for WebAssembly modules. In webpack 5 they are always treated as async modules.
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
export declare const WEBASSEMBLY_MODULE_TYPE_ASYNC = "webassembly/async";
|
|
17
|
+
/**
|
|
18
|
+
* This is the module type used for WebAssembly modules. In webpack 4 they are always treated as sync modules.
|
|
19
|
+
* There is a legacy option to support this usage in webpack 5 and up.
|
|
20
|
+
*/
|
|
21
|
+
export declare const WEBASSEMBLY_MODULE_TYPE_SYNC = "webassembly/sync";
|
|
22
|
+
/**
|
|
23
|
+
* This is the module type used for CSS files.
|
|
24
|
+
*/
|
|
25
|
+
export declare const CSS_MODULE_TYPE = "css";
|
|
26
|
+
/**
|
|
27
|
+
* This is the module type used for CSS modules files where you need to use `:local` in selector list to hash classes.
|
|
28
|
+
*/
|
|
29
|
+
export declare const CSS_MODULE_TYPE_GLOBAL = "css/global";
|
|
30
|
+
/**
|
|
31
|
+
* This is the module type used for CSS modules files, by default all classes are hashed.
|
|
32
|
+
*/
|
|
33
|
+
export declare const CSS_MODULE_TYPE_MODULE = "css/module";
|
|
34
|
+
/**
|
|
35
|
+
* This is the module type used for CSS files, the module will be parsed as CSS modules if it's filename contains `.module.` or `.modules.`.
|
|
36
|
+
*/
|
|
37
|
+
export declare const CSS_MODULE_TYPE_AUTO = "css/auto";
|
|
38
|
+
/**
|
|
39
|
+
* This is the module type used for automatically choosing between `asset/inline`, `asset/resource` based on asset size limit (8096).
|
|
40
|
+
*/
|
|
41
|
+
export declare const ASSET_MODULE_TYPE = "asset";
|
|
42
|
+
/**
|
|
43
|
+
* This is the module type used for assets that are inlined as a data URI. This is the equivalent of `url-loader`.
|
|
44
|
+
*/
|
|
45
|
+
export declare const ASSET_MODULE_TYPE_INLINE = "asset/inline";
|
|
46
|
+
/**
|
|
47
|
+
* This is the module type used for assets that are copied to the output directory. This is the equivalent of `file-loader`.
|
|
48
|
+
*/
|
|
49
|
+
export declare const ASSET_MODULE_TYPE_RESOURCE = "asset/resource";
|
|
50
|
+
/**
|
|
51
|
+
* @type {Readonly<"asset/source">}
|
|
52
|
+
* This is the module type used for assets that are imported as source code. This is the equivalent of `raw-loader`.
|
|
53
|
+
*/
|
|
54
|
+
export declare const ASSET_MODULE_TYPE_SOURCE = "asset/source";
|
|
55
|
+
/**
|
|
56
|
+
* TODO: Document what this asset type is for. See css-loader tests for its usage.
|
|
57
|
+
*/
|
|
58
|
+
export declare const ASSET_MODULE_TYPE_RAW_DATA_URL = "asset/raw-data-url";
|
|
59
|
+
/**
|
|
60
|
+
* This is the module type used for the webpack runtime abstractions.
|
|
61
|
+
*/
|
|
62
|
+
export declare const WEBPACK_MODULE_TYPE_RUNTIME = "runtime";
|
|
63
|
+
/**
|
|
64
|
+
* This is the module type used for the ModuleFederation feature's FallbackModule class.
|
|
65
|
+
* TODO: Document this better.
|
|
66
|
+
*/
|
|
67
|
+
export declare const WEBPACK_MODULE_TYPE_FALLBACK = "fallback-module";
|
|
68
|
+
/**
|
|
69
|
+
* This is the module type used for the ModuleFederation feature's RemoteModule class.
|
|
70
|
+
* TODO: Document this better.
|
|
71
|
+
*/
|
|
72
|
+
export declare const WEBPACK_MODULE_TYPE_REMOTE = "remote-module";
|
|
73
|
+
/**
|
|
74
|
+
* This is the module type used for the ModuleFederation feature's ProvideModule class.
|
|
75
|
+
* TODO: Document this better.
|
|
76
|
+
*/
|
|
77
|
+
export declare const WEBPACK_MODULE_TYPE_PROVIDE = "provide-module";
|
|
78
|
+
/**
|
|
79
|
+
* This is the module type used for the ModuleFederation feature's ConsumeSharedModule class.
|
|
80
|
+
*/
|
|
81
|
+
export declare const WEBPACK_MODULE_TYPE_CONSUME_SHARED_MODULE = "consume-shared-module";
|
|
82
|
+
/**
|
|
83
|
+
* Module type used for `experiments.lazyCompilation` feature. See `LazyCompilationPlugin` for more information.
|
|
84
|
+
*/
|
|
85
|
+
export declare const WEBPACK_MODULE_TYPE_LAZY_COMPILATION_PROXY = "lazy-compilation-proxy";
|
|
86
|
+
export type JavaScriptModuleTypes = "javascript/auto" | "javascript/dynamic" | "javascript/esm";
|
|
87
|
+
export type JSONModuleType = "json";
|
|
88
|
+
export type WebAssemblyModuleTypes = "webassembly/async" | "webassembly/sync";
|
|
89
|
+
export type CSSModuleTypes = "css" | "css/global" | "css/module";
|
|
90
|
+
export type AssetModuleTypes = "asset" | "asset/inline" | "asset/resource" | "asset/source" | "asset/raw-data-url";
|
|
91
|
+
export type WebpackModuleTypes = "runtime" | "fallback-module" | "remote-module" | "provide-module" | "consume-shared-module" | "lazy-compilation-proxy";
|
|
92
|
+
export type UnknownModuleTypes = string;
|
|
93
|
+
export type ModuleTypes = JavaScriptModuleTypes | JSONModuleType | WebAssemblyModuleTypes | CSSModuleTypes | AssetModuleTypes | WebpackModuleTypes | UnknownModuleTypes;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/MultiCompiler.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 liteTapable from "@rspack/lite-tapable";
|
|
11
|
+
import type { Compiler, RspackOptions } from ".";
|
|
12
|
+
import MultiStats from "./MultiStats";
|
|
13
|
+
import MultiWatching from "./MultiWatching";
|
|
14
|
+
import type { WatchOptions } from "./config";
|
|
15
|
+
import type { InputFileSystem, IntermediateFileSystem, WatchFileSystem } from "./util/fs";
|
|
16
|
+
export interface MultiCompilerOptions {
|
|
17
|
+
/**
|
|
18
|
+
* how many Compilers are allows to run at the same time in parallel
|
|
19
|
+
*/
|
|
20
|
+
parallelism?: number;
|
|
21
|
+
}
|
|
22
|
+
export type MultiRspackOptions = ReadonlyArray<RspackOptions> & MultiCompilerOptions;
|
|
23
|
+
export declare class MultiCompiler {
|
|
24
|
+
#private;
|
|
25
|
+
compilers: Compiler[];
|
|
26
|
+
dependencies: WeakMap<Compiler, string[]>;
|
|
27
|
+
hooks: {
|
|
28
|
+
done: liteTapable.SyncHook<MultiStats>;
|
|
29
|
+
invalid: liteTapable.MultiHook<liteTapable.SyncHook<[string | null, number]>>;
|
|
30
|
+
run: liteTapable.MultiHook<liteTapable.AsyncSeriesHook<[Compiler]>>;
|
|
31
|
+
watchClose: liteTapable.SyncHook<[]>;
|
|
32
|
+
watchRun: liteTapable.MultiHook<liteTapable.AsyncSeriesHook<[Compiler]>>;
|
|
33
|
+
infrastructureLog: liteTapable.MultiHook<liteTapable.SyncBailHook<[string, string, any[]], true>>;
|
|
34
|
+
};
|
|
35
|
+
_options: MultiCompilerOptions;
|
|
36
|
+
running: boolean;
|
|
37
|
+
constructor(compilers: Compiler[] | Record<string, Compiler>, options?: MultiCompilerOptions);
|
|
38
|
+
get options(): import(".").RspackOptionsNormalized[] & MultiCompilerOptions;
|
|
39
|
+
get outputPath(): string;
|
|
40
|
+
get inputFileSystem(): InputFileSystem;
|
|
41
|
+
get outputFileSystem(): typeof import("fs");
|
|
42
|
+
get watchFileSystem(): WatchFileSystem;
|
|
43
|
+
get intermediateFileSystem(): IntermediateFileSystem;
|
|
44
|
+
set inputFileSystem(value: InputFileSystem);
|
|
45
|
+
set outputFileSystem(value: typeof import("fs"));
|
|
46
|
+
set watchFileSystem(value: WatchFileSystem);
|
|
47
|
+
set intermediateFileSystem(value: IntermediateFileSystem);
|
|
48
|
+
getInfrastructureLogger(name: string): import("./logging/Logger").Logger;
|
|
49
|
+
/**
|
|
50
|
+
* @param compiler - the child compiler
|
|
51
|
+
* @param dependencies - its dependencies
|
|
52
|
+
*/
|
|
53
|
+
setDependencies(compiler: Compiler, dependencies: string[]): void;
|
|
54
|
+
/**
|
|
55
|
+
* @param callback - signals when the validation is complete
|
|
56
|
+
* @returns true if the dependencies are valid
|
|
57
|
+
*/
|
|
58
|
+
validateDependencies(callback: liteTapable.Callback<Error, MultiStats>): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* @param watchOptions - the watcher's options
|
|
61
|
+
* @param handler - signals when the call finishes
|
|
62
|
+
* @returns a compiler watcher
|
|
63
|
+
*/
|
|
64
|
+
watch(watchOptions: WatchOptions, handler: liteTapable.Callback<Error, MultiStats>): MultiWatching;
|
|
65
|
+
run(callback: liteTapable.Callback<Error, MultiStats>): void;
|
|
66
|
+
purgeInputFileSystem(): void;
|
|
67
|
+
close(callback: liteTapable.Callback<Error, void>): void;
|
|
68
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/MultiStats.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 { Stats } from "./Stats";
|
|
11
|
+
import type { StatsCompilation } from "./stats/statsFactoryUtils";
|
|
12
|
+
export default class MultiStats {
|
|
13
|
+
#private;
|
|
14
|
+
stats: Stats[];
|
|
15
|
+
constructor(stats: Stats[]);
|
|
16
|
+
get hash(): string;
|
|
17
|
+
hasErrors(): boolean;
|
|
18
|
+
hasWarnings(): boolean;
|
|
19
|
+
toJson(options: any): StatsCompilation;
|
|
20
|
+
toString(options: any): string;
|
|
21
|
+
}
|
|
22
|
+
export { MultiStats };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/MultiWatching.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 { Callback } from "@rspack/lite-tapable";
|
|
11
|
+
import type { MultiCompiler } from "./MultiCompiler";
|
|
12
|
+
import type { Watching } from "./Watching";
|
|
13
|
+
declare class MultiWatching {
|
|
14
|
+
watchings: Watching[];
|
|
15
|
+
compiler: MultiCompiler;
|
|
16
|
+
/**
|
|
17
|
+
* @param watchings - child compilers' watchers
|
|
18
|
+
* @param compiler - the compiler
|
|
19
|
+
*/
|
|
20
|
+
constructor(watchings: Watching[], compiler: MultiCompiler);
|
|
21
|
+
invalidate(callback: Callback<Error, void>): void;
|
|
22
|
+
close(callback: Callback<Error, void>): void;
|
|
23
|
+
suspend(): void;
|
|
24
|
+
resume(): void;
|
|
25
|
+
}
|
|
26
|
+
export default MultiWatching;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as liteTapable from "@rspack/lite-tapable";
|
|
2
|
+
import { Compilation } from "./Compilation";
|
|
3
|
+
import type { Module } from "./Module";
|
|
4
|
+
import type { LoaderContext } from "./config";
|
|
5
|
+
export declare class NormalModule {
|
|
6
|
+
static getCompilationHooks(compilation: Compilation): {
|
|
7
|
+
loader: liteTapable.SyncHook<[LoaderContext, Module]>;
|
|
8
|
+
readResourceForScheme: any;
|
|
9
|
+
readResource: liteTapable.HookMap<liteTapable.AsyncSeriesBailHook<[LoaderContext], string | Buffer>>;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export default NormalModule;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type * as binding from "@rspack/binding";
|
|
2
|
+
import * as liteTapable from "@rspack/lite-tapable";
|
|
3
|
+
import type { ResolveData, ResourceDataWithData } from "./Module";
|
|
4
|
+
export type NormalModuleCreateData = binding.JsNormalModuleFactoryCreateModuleArgs & {
|
|
5
|
+
settings: {};
|
|
6
|
+
};
|
|
7
|
+
export declare class NormalModuleFactory {
|
|
8
|
+
hooks: {
|
|
9
|
+
resolveForScheme: liteTapable.HookMap<liteTapable.AsyncSeriesBailHook<[ResourceDataWithData], true | void>>;
|
|
10
|
+
beforeResolve: liteTapable.AsyncSeriesBailHook<[ResolveData], false | void>;
|
|
11
|
+
factorize: liteTapable.AsyncSeriesBailHook<[ResolveData], void>;
|
|
12
|
+
resolve: liteTapable.AsyncSeriesBailHook<[ResolveData], void>;
|
|
13
|
+
afterResolve: liteTapable.AsyncSeriesBailHook<[ResolveData], false | void>;
|
|
14
|
+
createModule: liteTapable.AsyncSeriesBailHook<[
|
|
15
|
+
NormalModuleCreateData,
|
|
16
|
+
{}
|
|
17
|
+
], void>;
|
|
18
|
+
};
|
|
19
|
+
constructor();
|
|
20
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type * as binding from "@rspack/binding";
|
|
2
|
+
import { type Resolve } from "./config";
|
|
3
|
+
import type { ResolveCallback } from "./config/adapterRuleUse";
|
|
4
|
+
type ResolveContext = {};
|
|
5
|
+
type ResolveOptionsWithDependencyType = Resolve & {
|
|
6
|
+
dependencyCategory?: string;
|
|
7
|
+
resolveToContext?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare class Resolver {
|
|
10
|
+
binding: binding.JsResolver;
|
|
11
|
+
constructor(binding: binding.JsResolver);
|
|
12
|
+
resolveSync(context: object, path: string, request: string): string | false;
|
|
13
|
+
resolve(context: object, path: string, request: string, resolveContext: ResolveContext, callback: ResolveCallback): void;
|
|
14
|
+
withOptions({ dependencyCategory, resolveToContext, ...resolve }: ResolveOptionsWithDependencyType): Resolver;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as binding from "@rspack/binding";
|
|
2
|
+
import { Resolver } from "./Resolver";
|
|
3
|
+
import { type Resolve } from "./config";
|
|
4
|
+
type ResolveOptionsWithDependencyType = Resolve & {
|
|
5
|
+
dependencyCategory?: string;
|
|
6
|
+
resolveToContext?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare class ResolverFactory {
|
|
9
|
+
#private;
|
|
10
|
+
static __to_binding(resolver_factory: ResolverFactory): binding.JsResolverFactory;
|
|
11
|
+
constructor();
|
|
12
|
+
get(type: string, resolveOptions?: ResolveOptionsWithDependencyType): Resolver;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type * as binding from "@rspack/binding";
|
|
2
|
+
export type RspackError = binding.JsRspackError;
|
|
3
|
+
export declare class JsRspackDiagnostic {
|
|
4
|
+
static __to_binding(error: Error | RspackError, severity: binding.JsRspackSeverity): binding.JsRspackDiagnostic;
|
|
5
|
+
}
|
|
6
|
+
export declare class NonErrorEmittedError extends Error {
|
|
7
|
+
constructor(error: Error);
|
|
8
|
+
}
|