@ohos-ports/rspack-core 2.2.2-beta.0
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/compiled/@rspack/lite-tapable/dist/index.d.ts +176 -0
- package/compiled/@rspack/lite-tapable/license +22 -0
- package/compiled/@rspack/lite-tapable/package.json +1 -0
- package/compiled/@swc/types/index.d.ts +2284 -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/connect-next/index.d.ts +57 -0
- package/compiled/connect-next/license +26 -0
- package/compiled/connect-next/package.json +1 -0
- package/compiled/http-proxy-middleware/index.d.ts +455 -0
- package/compiled/http-proxy-middleware/license +22 -0
- package/compiled/http-proxy-middleware/package.json +1 -0
- package/compiled/open/index.d.ts +161 -0
- package/compiled/open/package.json +1 -0
- package/compiled/tinypool/LICENSE +24 -0
- package/compiled/tinypool/README.md +214 -0
- package/compiled/tinypool/dist/common-Bo3KCGim.js +31 -0
- package/compiled/tinypool/dist/entry/process.d.ts +1 -0
- package/compiled/tinypool/dist/entry/process.js +72 -0
- package/compiled/tinypool/dist/entry/utils.d.ts +7 -0
- package/compiled/tinypool/dist/entry/utils.js +3 -0
- package/compiled/tinypool/dist/entry/worker.d.ts +1 -0
- package/compiled/tinypool/dist/entry/worker.js +76 -0
- package/compiled/tinypool/dist/index.d.ts +199 -0
- package/compiled/tinypool/dist/index.js +784 -0
- package/compiled/tinypool/dist/utils-B--2TaWv.js +38 -0
- package/compiled/tinypool/dist/utils-De75vAgL.js +10 -0
- package/compiled/tinypool/package.json +55 -0
- package/compiled/watchpack/index.d.ts +3 -0
- package/compiled/watchpack/index.js +3811 -0
- package/compiled/watchpack/license +20 -0
- package/compiled/watchpack/package.json +8 -0
- package/compiled/watchpack/types/DirectoryWatcher.d.ts +335 -0
- package/compiled/watchpack/types/LinkResolver.d.ts +10 -0
- package/compiled/watchpack/types/getWatcherManager.d.ts +62 -0
- package/compiled/watchpack/types/index.d.ts +269 -0
- package/compiled/watchpack/types/reducePlan.d.ts +34 -0
- package/compiled/watchpack/types/util/globToRegExp.d.ts +2 -0
- package/compiled/watchpack/types/watchEventSource.d.ts +53 -0
- package/compiled/watchpack/types/watchpack.d.ts +2 -0
- package/compiled/webpack-sources/index.js +5835 -0
- package/compiled/webpack-sources/license +21 -0
- package/compiled/webpack-sources/package.json +1 -0
- package/compiled/webpack-sources/types.d.ts +500 -0
- package/dist/612~0.js +32 -0
- package/dist/612~3.js +32 -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 +448 -0
- package/dist/Compiler.d.ts +229 -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 +15 -0
- package/dist/FileSystem.d.ts +54 -0
- package/dist/FileSystemInfo.d.ts +5 -0
- package/dist/Module.d.ts +41 -0
- package/dist/ModuleGraph.d.ts +22 -0
- package/dist/ModuleGraphConnection.d.ts +10 -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 +52 -0
- package/dist/NormalModule.d.ts +14 -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 +360 -0
- package/dist/RuntimeModule.d.ts +34 -0
- package/dist/RuntimeTemplate.d.ts +151 -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/builtin-loader/lightningcss/index.d.ts +114 -0
- package/dist/builtin-loader/lightningcss/target.d.ts +4 -0
- package/dist/builtin-loader/swc/collectTypeScriptInfo.d.ts +21 -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 +60 -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/CaseSensitivePlugin.d.ts +9 -0
- package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.d.ts +9 -0
- package/dist/builtin-plugin/CircularCheckRspackPlugin.d.ts +33 -0
- package/dist/builtin-plugin/CircularDependencyRspackPlugin.d.ts +60 -0
- package/dist/builtin-plugin/CircularModulesInfoPlugin.d.ts +7 -0
- package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +9 -0
- package/dist/builtin-plugin/CompactHashedChunkIdsPlugin.d.ts +12 -0
- package/dist/builtin-plugin/CompactHashedModuleIdsPlugin.d.ts +12 -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/CssHttpExternalsRspackPlugin.d.ts +9 -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 +18 -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 +16 -0
- package/dist/builtin-plugin/EsmNodeTargetPlugin.d.ts +9 -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 +13 -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/HashedModuleIdsPlugin.d.ts +10 -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 +30 -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 +28 -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 +12 -0
- package/dist/builtin-plugin/ProvidePlugin.d.ts +10 -0
- package/dist/builtin-plugin/RealContentHashPlugin.d.ts +20 -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 +46 -0
- package/dist/builtin-plugin/RslibPlugin.d.ts +10 -0
- package/dist/builtin-plugin/RstestPlugin.d.ts +10 -0
- package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +11 -0
- package/dist/builtin-plugin/RuntimePlugin.d.ts +25 -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 +12 -0
- package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +39 -0
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +216 -0
- package/dist/builtin-plugin/SyncModuleIdsPlugin.d.ts +16 -0
- package/dist/builtin-plugin/URLPlugin.d.ts +9 -0
- package/dist/builtin-plugin/WorkerPlugin.d.ts +14 -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 +10 -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 +77 -0
- package/dist/builtin-plugin/html-plugin/plugin.d.ts +20 -0
- package/dist/builtin-plugin/html-plugin/taps.d.ts +2 -0
- package/dist/builtin-plugin/index.d.ts +92 -0
- package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +10 -0
- package/dist/builtin-plugin/lazy-compilation/middleware.d.ts +12 -0
- package/dist/builtin-plugin/rsc/Coordinator.d.ts +8 -0
- package/dist/builtin-plugin/rsc/RscClientPlugin.d.ts +13 -0
- package/dist/builtin-plugin/rsc/RscServerPlugin.d.ts +47 -0
- package/dist/builtin-plugin/rsc/index.d.ts +24 -0
- package/dist/checkNodeVersion.d.ts +1 -0
- package/dist/config/adapter.d.ts +8 -0
- package/dist/config/adapterRuleUse.d.ts +424 -0
- package/dist/config/browserslistTargetHandler.d.ts +15 -0
- package/dist/config/defaults.d.ts +15 -0
- package/dist/config/devServer.d.ts +179 -0
- package/dist/config/index.d.ts +5 -0
- package/dist/config/normalization.d.ts +156 -0
- package/dist/config/target.d.ts +100 -0
- package/dist/config/types.d.ts +2728 -0
- package/dist/container/ContainerPlugin.d.ts +41 -0
- package/dist/container/ContainerReferencePlugin.d.ts +34 -0
- package/dist/container/ModuleFederationManifestPlugin.d.ts +44 -0
- package/dist/container/ModuleFederationPlugin.d.ts +34 -0
- package/dist/container/ModuleFederationPluginV1.d.ts +22 -0
- package/dist/container/ModuleFederationRuntimePlugin.d.ts +16 -0
- package/dist/container/options.d.ts +3 -0
- package/dist/cssExtractHmr.js +99 -0
- package/dist/cssExtractLoader.js +117 -0
- package/dist/error/ConcurrentCompilationError.d.ts +14 -0
- package/dist/exports.d.ts +192 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +14552 -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 +39 -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 +16 -0
- package/dist/loader-runner/LoaderLoadingError.d.ts +13 -0
- package/dist/loader-runner/ModuleError.d.ts +13 -0
- package/dist/loader-runner/cache.d.ts +18 -0
- package/dist/loader-runner/dependencies.d.ts +22 -0
- package/dist/loader-runner/index.d.ts +35 -0
- package/dist/loader-runner/loadLoader.d.ts +12 -0
- package/dist/loader-runner/service.d.ts +77 -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/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 +30 -0
- package/dist/node/nodeConsole.d.ts +15 -0
- package/dist/rspack.d.ts +24 -0
- package/dist/rspackOptionsApply.d.ts +4 -0
- package/dist/runtime/cssExtractHmr.d.ts +4 -0
- package/dist/runtime/moduleFederationDefaultRuntime.d.ts +1 -0
- package/dist/sharing/CollectSharedEntryPlugin.d.ts +22 -0
- package/dist/sharing/ConsumeSharedPlugin.d.ts +54 -0
- package/dist/sharing/IndependentSharedPlugin.d.ts +37 -0
- package/dist/sharing/ProvideSharedPlugin.d.ts +54 -0
- package/dist/sharing/SharePlugin.d.ts +89 -0
- package/dist/sharing/ShareRuntimePlugin.d.ts +9 -0
- package/dist/sharing/SharedContainerPlugin.d.ts +23 -0
- package/dist/sharing/SharedUsedExportsOptimizerPlugin.d.ts +14 -0
- package/dist/sharing/TreeShakingSharedPlugin.d.ts +19 -0
- package/dist/sharing/utils.d.ts +2 -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 +338 -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/externalModule.d.ts +2 -0
- package/dist/taps/index.d.ts +7 -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 +47 -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 +11 -0
- package/dist/util/fs.d.ts +376 -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 +57 -0
- package/dist/util/index.d.ts +9 -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/supportsColor.d.ts +6 -0
- package/dist/util/targetsVersion.d.ts +2 -0
- package/dist/util/validateConfig.d.ts +5 -0
- package/dist/web/JsonpTemplatePlugin.d.ts +13 -0
- package/dist/webworker/WebWorkerTemplatePlugin.d.ts +13 -0
- package/dist/worker.js +971 -0
- package/hot/dev-server.js +76 -0
- package/hot/emitter.js +23 -0
- package/hot/lazy-compilation-node.js +109 -0
- package/hot/lazy-compilation-web.js +97 -0
- package/hot/log-apply-result.js +52 -0
- package/hot/log.js +87 -0
- package/hot/only-dev-server.js +104 -0
- package/hot/poll.js +41 -0
- package/hot/signal.js +68 -0
- package/module.d.ts +310 -0
- package/package.json +79 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/cache/getLazyHashedEtag.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 Hash from '../../util/hash/index.js';
|
|
11
|
+
export type HashConstructor = typeof Hash;
|
|
12
|
+
export interface HashableObject {
|
|
13
|
+
updateHash(hash: Hash): void;
|
|
14
|
+
}
|
|
15
|
+
declare class LazyHashedEtag {
|
|
16
|
+
_obj: HashableObject;
|
|
17
|
+
_hash?: string;
|
|
18
|
+
_hashFunction: string | HashConstructor;
|
|
19
|
+
/**
|
|
20
|
+
* @param obj object with updateHash method
|
|
21
|
+
* @param hashFunction the hash function to use
|
|
22
|
+
*/
|
|
23
|
+
constructor(obj: HashableObject, hashFunction?: string | HashConstructor);
|
|
24
|
+
/**
|
|
25
|
+
* @returns hash of object
|
|
26
|
+
*/
|
|
27
|
+
toString(): string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @param obj object with updateHash method
|
|
31
|
+
* @param ashFunction the hash function to use
|
|
32
|
+
* @returns etag
|
|
33
|
+
*/
|
|
34
|
+
export declare const getter: (obj: HashableObject, hashFunction?: string | HashConstructor) => LazyHashedEtag;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/cache/mergeEtags.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 { Etag } from '../Cache.js';
|
|
11
|
+
/**
|
|
12
|
+
* @param first first
|
|
13
|
+
* @param second second
|
|
14
|
+
* @returns result
|
|
15
|
+
*/
|
|
16
|
+
export declare const mergeEtags: (first: Etag, second: Etag) => Etag;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following code is from
|
|
3
|
+
* https://github.com/webpack/loader-runner
|
|
4
|
+
*
|
|
5
|
+
* MIT Licensed
|
|
6
|
+
* Author Tobias Koppers @sokra
|
|
7
|
+
* Copyright (c) JS Foundation and other contributors
|
|
8
|
+
* https://github.com/webpack/loader-runner/blob/main/LICENSE
|
|
9
|
+
*/
|
|
10
|
+
declare class LoadingLoaderError extends Error {
|
|
11
|
+
constructor(message: string);
|
|
12
|
+
}
|
|
13
|
+
export default LoadingLoaderError;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import WebpackError from '../lib/WebpackError.js';
|
|
2
|
+
export declare class ModuleError extends WebpackError {
|
|
3
|
+
error?: Error;
|
|
4
|
+
constructor(err: Error, { from }?: {
|
|
5
|
+
from?: string;
|
|
6
|
+
});
|
|
7
|
+
}
|
|
8
|
+
export declare class ModuleWarning extends WebpackError {
|
|
9
|
+
error?: Error;
|
|
10
|
+
constructor(err: Error, { from }?: {
|
|
11
|
+
from?: string;
|
|
12
|
+
});
|
|
13
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { JsLoaderContext } from '@ohos-ports/rspack-binding';
|
|
2
|
+
import { type LoaderDependencies, LoaderDependenciesState } from './dependencies.js';
|
|
3
|
+
type LoaderCacheContent = string | Uint8Array;
|
|
4
|
+
export type LoaderCacheEntry = {
|
|
5
|
+
content: LoaderCacheContent | null;
|
|
6
|
+
sourceMap?: Uint8Array;
|
|
7
|
+
addedDependencies: LoaderDependencies;
|
|
8
|
+
removedDependencies: LoaderDependencies;
|
|
9
|
+
};
|
|
10
|
+
export declare class LoaderCache {
|
|
11
|
+
#private;
|
|
12
|
+
constructor(context: JsLoaderContext, dependencies: LoaderDependenciesState);
|
|
13
|
+
get(loaderIndex: number, content: LoaderCacheContent | null | undefined, additionalData: unknown): Promise<LoaderCacheEntry | null | undefined>;
|
|
14
|
+
store(loaderIndex: number, content: LoaderCacheContent | null | undefined, sourceMap: Uint8Array | undefined, additionalData: unknown): Promise<void>;
|
|
15
|
+
workerGet(loaderIndex: number, content: LoaderCacheContent | null | undefined, additionalData: unknown): Promise<LoaderCacheEntry | undefined>;
|
|
16
|
+
workerStore(loaderIndex: number, content: LoaderCacheContent | null | undefined, sourceMap: Uint8Array | undefined, additionalData: unknown): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { JsLoaderContext } from '@ohos-ports/rspack-binding';
|
|
2
|
+
export type LoaderDependencies = JsLoaderContext['dependencies'];
|
|
3
|
+
export declare class LoaderDependenciesState {
|
|
4
|
+
readonly existing: LoaderDependencies;
|
|
5
|
+
readonly added: import("@ohos-ports/rspack-binding").JsLoaderDependencies;
|
|
6
|
+
readonly removed: import("@ohos-ports/rspack-binding").JsLoaderDependencies;
|
|
7
|
+
constructor(existing: LoaderDependencies);
|
|
8
|
+
resetChanges(): void;
|
|
9
|
+
mergeChanges(): void;
|
|
10
|
+
addDependencies(dependencies: LoaderDependencies): void;
|
|
11
|
+
addFile(dependency: string): void;
|
|
12
|
+
addContext(dependency: string): void;
|
|
13
|
+
addMissing(dependency: string): void;
|
|
14
|
+
addBuild(dependency: string): void;
|
|
15
|
+
fileDependencies(): string[];
|
|
16
|
+
contextDependencies(): string[];
|
|
17
|
+
missingDependencies(): string[];
|
|
18
|
+
clearDependencies(): void;
|
|
19
|
+
private add;
|
|
20
|
+
private get;
|
|
21
|
+
private clear;
|
|
22
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type JsLoaderContext, type JsLoaderItem } from '@ohos-ports/rspack-binding';
|
|
2
|
+
import type { Compiler } from '../Compiler.js';
|
|
3
|
+
type LoaderObjectOptions = string | (object & {
|
|
4
|
+
ident?: unknown;
|
|
5
|
+
}) | null;
|
|
6
|
+
export declare class LoaderObject {
|
|
7
|
+
request: string;
|
|
8
|
+
path: string;
|
|
9
|
+
query: string;
|
|
10
|
+
fragment: string;
|
|
11
|
+
options?: LoaderObjectOptions;
|
|
12
|
+
ident: string | null;
|
|
13
|
+
normal?: Function | null;
|
|
14
|
+
pitch?: Function | null;
|
|
15
|
+
raw?: boolean | null;
|
|
16
|
+
type?: 'module' | 'commonjs';
|
|
17
|
+
parallel?: boolean | {
|
|
18
|
+
maxWorkers?: number;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* @internal This field is rspack internal. Do not edit.
|
|
22
|
+
*/
|
|
23
|
+
loaderItem: JsLoaderItem;
|
|
24
|
+
constructor(loaderItem: JsLoaderItem, compiler: Compiler);
|
|
25
|
+
get pitchExecuted(): boolean;
|
|
26
|
+
set pitchExecuted(value: boolean);
|
|
27
|
+
get normalExecuted(): boolean;
|
|
28
|
+
set normalExecuted(value: boolean);
|
|
29
|
+
set noPitch(value: boolean);
|
|
30
|
+
shouldYield(): boolean;
|
|
31
|
+
static __from_binding(loaderItem: JsLoaderItem, compiler: Compiler): LoaderObject;
|
|
32
|
+
static __to_binding(loader: LoaderObject): JsLoaderItem;
|
|
33
|
+
}
|
|
34
|
+
export declare function runLoaders(compiler: Compiler, context: JsLoaderContext): Promise<JsLoaderContext>;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following code is from
|
|
3
|
+
* https://github.com/webpack/loader-runner
|
|
4
|
+
*
|
|
5
|
+
* MIT Licensed
|
|
6
|
+
* Author Tobias Koppers @sokra
|
|
7
|
+
* Copyright (c) JS Foundation and other contributors
|
|
8
|
+
* https://github.com/webpack/loader-runner/blob/main/LICENSE
|
|
9
|
+
*/
|
|
10
|
+
import type { Compiler } from '../exports.js';
|
|
11
|
+
import type { LoaderObject } from './index.js';
|
|
12
|
+
export default function loadLoader(loader: LoaderObject, compiler: Compiler, callback: (err: unknown) => void): void;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { Tinypool } from 'tinypool' with { 'resolution-mode': 'import' };
|
|
2
|
+
type RunOptions = Parameters<Tinypool['run']>[1];
|
|
3
|
+
export interface WorkerResponseMessage {
|
|
4
|
+
type: 'response';
|
|
5
|
+
id: number;
|
|
6
|
+
data: any;
|
|
7
|
+
}
|
|
8
|
+
export interface WorkerResponseErrorMessage {
|
|
9
|
+
type: 'response-error';
|
|
10
|
+
id: number;
|
|
11
|
+
error: WorkerError;
|
|
12
|
+
}
|
|
13
|
+
interface WorkerDoneMessage {
|
|
14
|
+
type: 'done';
|
|
15
|
+
data: WorkerArgs;
|
|
16
|
+
}
|
|
17
|
+
interface WorkerDoneErrorMessage {
|
|
18
|
+
type: 'done-error';
|
|
19
|
+
error: WorkerError;
|
|
20
|
+
}
|
|
21
|
+
export interface WorkerRequestMessage {
|
|
22
|
+
type: 'request';
|
|
23
|
+
id: number;
|
|
24
|
+
requestType: RequestType;
|
|
25
|
+
data: WorkerArgs;
|
|
26
|
+
}
|
|
27
|
+
export interface WorkerRequestSyncMessage {
|
|
28
|
+
type: 'request-sync';
|
|
29
|
+
id: number;
|
|
30
|
+
requestType: RequestSyncType;
|
|
31
|
+
data: WorkerArgs;
|
|
32
|
+
sharedBuffer: SharedArrayBuffer;
|
|
33
|
+
}
|
|
34
|
+
export type WorkerMessage = WorkerResponseMessage | WorkerDoneMessage | WorkerRequestMessage | WorkerResponseErrorMessage | WorkerDoneErrorMessage | WorkerRequestSyncMessage;
|
|
35
|
+
export declare function isWorkerResponseMessage(message: WorkerMessage): message is WorkerResponseMessage;
|
|
36
|
+
export declare function isWorkerResponseErrorMessage(message: WorkerMessage): message is WorkerResponseErrorMessage;
|
|
37
|
+
export declare enum RequestType {
|
|
38
|
+
AddDependency = "AddDependency",
|
|
39
|
+
AddContextDependency = "AddContextDependency",
|
|
40
|
+
AddMissingDependency = "AddMissingDependency",
|
|
41
|
+
AddBuildDependency = "AddBuildDependency",
|
|
42
|
+
GetDependencies = "GetDependencies",
|
|
43
|
+
GetContextDependencies = "GetContextDependencies",
|
|
44
|
+
GetMissingDependencies = "GetMissingDependencies",
|
|
45
|
+
ClearDependencies = "ClearDependencies",
|
|
46
|
+
BeginDependencyChanges = "BeginDependencyChanges",
|
|
47
|
+
MergeDependencyChanges = "MergeDependencyChanges",
|
|
48
|
+
Resolve = "Resolve",
|
|
49
|
+
GetResolve = "GetResolve",
|
|
50
|
+
GetLogger = "GetLogger",
|
|
51
|
+
EmitError = "EmitError",
|
|
52
|
+
EmitWarning = "EmitWarning",
|
|
53
|
+
EmitFile = "EmitFile",
|
|
54
|
+
EmitDiagnostic = "EmitDiagnostic",
|
|
55
|
+
SetCacheable = "SetCacheable",
|
|
56
|
+
ImportModule = "ImportModule",
|
|
57
|
+
UpdateLoaderObjects = "UpdateLoaderObjects",
|
|
58
|
+
LoaderCacheGet = "LoaderCacheGet",
|
|
59
|
+
LoaderCacheStore = "LoaderCacheStore",
|
|
60
|
+
CompilationGetPath = "CompilationGetPath",
|
|
61
|
+
CompilationGetPathWithInfo = "CompilationGetPathWithInfo",
|
|
62
|
+
CompilationGetAssetPath = "CompilationGetAssetPath",
|
|
63
|
+
CompilationGetAssetPathWithInfo = "CompilationGetAssetPathWithInfo"
|
|
64
|
+
}
|
|
65
|
+
export declare enum RequestSyncType {
|
|
66
|
+
WaitForPendingRequest = "WaitForPendingRequest"
|
|
67
|
+
}
|
|
68
|
+
export type HandleIncomingRequest = (requestType: RequestType, ...args: any[]) => any;
|
|
69
|
+
type WorkerArgs = any[];
|
|
70
|
+
export type WorkerError = Error;
|
|
71
|
+
export declare function serializeError(error: unknown): WorkerError;
|
|
72
|
+
export declare const run: (loaderName: string, task: any, options: RunOptions & {
|
|
73
|
+
handleIncomingRequest: HandleIncomingRequest;
|
|
74
|
+
}, workerOptions?: {
|
|
75
|
+
maxWorkers?: number;
|
|
76
|
+
}) => Promise<WorkerArgs>;
|
|
77
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { LoaderContext } from '../config/adapterRuleUse.js';
|
|
2
|
+
import type { Compiler } from '../exports.js';
|
|
3
|
+
import type { LoaderObject } from './index.js';
|
|
4
|
+
export declare function convertArgs(args: any[], raw: boolean): void;
|
|
5
|
+
export declare const loadLoader: (loaderObject: LoaderObject, compiler: Compiler) => Promise<void>;
|
|
6
|
+
export declare const runSyncOrAsync: (arg1: Function, arg2: LoaderContext<{}>, arg3: any[]) => Promise<any[]>;
|
|
7
|
+
export declare function extractLoaderName(loaderPath: string, cwd?: string): string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type MessagePort } from 'node:worker_threads';
|
|
2
|
+
import { JsLoaderState } from '@ohos-ports/rspack-binding';
|
|
3
|
+
import type { LoaderContext } from '../config/index.js';
|
|
4
|
+
interface WorkerOptions {
|
|
5
|
+
loaderContext: LoaderContext;
|
|
6
|
+
loaderState: JsLoaderState;
|
|
7
|
+
args: any[];
|
|
8
|
+
workerData?: {
|
|
9
|
+
workerPort: MessagePort;
|
|
10
|
+
workerSyncPort: MessagePort;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
declare function worker(workerOptions: WorkerOptions): void;
|
|
14
|
+
export default worker;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/logging/Logger.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 LogType: Readonly<{
|
|
11
|
+
error: "error";
|
|
12
|
+
warn: "warn";
|
|
13
|
+
info: "info";
|
|
14
|
+
log: "log";
|
|
15
|
+
debug: "debug";
|
|
16
|
+
trace: "trace";
|
|
17
|
+
group: "group";
|
|
18
|
+
groupCollapsed: "groupCollapsed";
|
|
19
|
+
groupEnd: "groupEnd";
|
|
20
|
+
profile: "profile";
|
|
21
|
+
profileEnd: "profileEnd";
|
|
22
|
+
time: "time";
|
|
23
|
+
clear: "clear";
|
|
24
|
+
status: "status";
|
|
25
|
+
cache: "cache";
|
|
26
|
+
}>;
|
|
27
|
+
export declare function getLogTypeBitFlag(type: LogTypeEnum): number;
|
|
28
|
+
export declare function getLogTypesBitFlag(types: LogTypeEnum[]): number;
|
|
29
|
+
export type LogTypeEnum = (typeof LogType)[keyof typeof LogType];
|
|
30
|
+
declare const LOG_SYMBOL: unique symbol;
|
|
31
|
+
declare const TIMERS_SYMBOL: unique symbol;
|
|
32
|
+
declare const TIMERS_AGGREGATES_SYMBOL: unique symbol;
|
|
33
|
+
export type LogFunction = (type: LogTypeEnum, args: any[]) => void;
|
|
34
|
+
export type GetChildLogger = (name: string | (() => string)) => Logger;
|
|
35
|
+
export declare class Logger {
|
|
36
|
+
getChildLogger: GetChildLogger;
|
|
37
|
+
[LOG_SYMBOL]: any;
|
|
38
|
+
[TIMERS_SYMBOL]: any;
|
|
39
|
+
[TIMERS_AGGREGATES_SYMBOL]: any;
|
|
40
|
+
constructor(log: LogFunction, getChildLogger: GetChildLogger);
|
|
41
|
+
error(...args: any[]): void;
|
|
42
|
+
warn(...args: any[]): void;
|
|
43
|
+
info(...args: any[]): void;
|
|
44
|
+
log(...args: any[]): void;
|
|
45
|
+
debug(...args: string[]): void;
|
|
46
|
+
assert(assertion: any, ...args: any[]): void;
|
|
47
|
+
trace(): void;
|
|
48
|
+
clear(): void;
|
|
49
|
+
status(...args: any[]): void;
|
|
50
|
+
group(...args: any[]): void;
|
|
51
|
+
groupCollapsed(...args: any[]): void;
|
|
52
|
+
groupEnd(...args: any[]): void;
|
|
53
|
+
profile(label: any): void;
|
|
54
|
+
profileEnd(label: any): void;
|
|
55
|
+
time(label: any): void;
|
|
56
|
+
timeLog(label: any): void;
|
|
57
|
+
timeEnd(label: any): void;
|
|
58
|
+
timeAggregate(label: any): void;
|
|
59
|
+
timeAggregateEnd(label: any): void;
|
|
60
|
+
}
|
|
61
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/logging/createConsoleLogger.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 { FilterTypes } from '../config/index.js';
|
|
11
|
+
import { type LogTypeEnum } from './Logger.js';
|
|
12
|
+
export type FilterFunction = (ident: string) => boolean;
|
|
13
|
+
export type LoggerConsole = {
|
|
14
|
+
clear: () => void;
|
|
15
|
+
trace: () => void;
|
|
16
|
+
info: (...args: any[]) => void;
|
|
17
|
+
log: (...args: any[]) => void;
|
|
18
|
+
warn: (...args: any[]) => void;
|
|
19
|
+
error: (...args: any[]) => void;
|
|
20
|
+
debug?: (...args: any[]) => void;
|
|
21
|
+
group?: (...args: any[]) => void;
|
|
22
|
+
groupCollapsed?: (...args: any[]) => void;
|
|
23
|
+
groupEnd?: (...args: any[]) => void;
|
|
24
|
+
status?: (...args: any[]) => void;
|
|
25
|
+
profile?: (...args: any[]) => void;
|
|
26
|
+
profileEnd?: (...args: any[]) => void;
|
|
27
|
+
logTime?: (...args: any[]) => void;
|
|
28
|
+
};
|
|
29
|
+
export type LoggerOptions = {
|
|
30
|
+
level: 'none' | 'error' | 'warn' | 'info' | 'log' | 'verbose' | boolean;
|
|
31
|
+
debug: FilterTypes | boolean;
|
|
32
|
+
console: LoggerConsole;
|
|
33
|
+
};
|
|
34
|
+
declare const createConsoleLogger: ({ level, debug, console, }: LoggerOptions) => (name: string, type: LogTypeEnum, args: any[]) => void;
|
|
35
|
+
export { createConsoleLogger };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/logging/truncateArgs.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
|
+
/**
|
|
11
|
+
* @param args items to be truncated
|
|
12
|
+
* @param maxLength maximum length of args including spaces between
|
|
13
|
+
* @returns truncated args
|
|
14
|
+
*/
|
|
15
|
+
declare const truncateArgs: (args: any[], maxLength: number) => string[];
|
|
16
|
+
export { truncateArgs };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var __module_federation_bundler_runtime__,__module_federation_runtime_plugins__,__module_federation_remote_infos__,__module_federation_container_name__,__module_federation_share_strategy__,__module_federation_share_fallbacks__,__module_federation_library_type__;export default function(){const runtimeRequire=__module_federation_runtime_require__;if((runtimeRequire.initializeSharingData||runtimeRequire.initializeExposesData)&&runtimeRequire.federation){var _ref,_ref1,_ref2,_ref3,_ref4;var _runtimeRequire_remotesLoadingData,_runtimeRequire_remotesLoadingData1,_runtimeRequire_initializeSharingData,_runtimeRequire_consumesLoadingData,_runtimeRequire_consumesLoadingData1,_runtimeRequire_initializeExposesData,_runtimeRequire_consumesLoadingData2;const override=(obj,key,value)=>{if(!obj)return;if(obj[key])obj[key]=value};const merge=(obj,key,fn)=>{const value=fn();if(Array.isArray(value)){var _obj,_key,_;(_=(_obj=obj)[_key=key])!==null&&_!==void 0?_:_obj[_key]=[];obj[key].push(...value)}else if(typeof value==="object"&&value!==null){var _obj1,_key1,_1;(_1=(_obj1=obj)[_key1=key])!==null&&_1!==void 0?_1:_obj1[_key1]={};Object.assign(obj[key],value)}};const early=(obj,key,initial)=>{var _obj,_key,_;(_=(_obj=obj)[_key=key])!==null&&_!==void 0?_:_obj[_key]=initial()};const remotesLoadingChunkMapping=(_ref=(_runtimeRequire_remotesLoadingData=runtimeRequire.remotesLoadingData)===null||_runtimeRequire_remotesLoadingData===void 0?void 0:_runtimeRequire_remotesLoadingData.chunkMapping)!==null&&_ref!==void 0?_ref:{};const remotesLoadingModuleIdToRemoteDataMapping=(_ref1=(_runtimeRequire_remotesLoadingData1=runtimeRequire.remotesLoadingData)===null||_runtimeRequire_remotesLoadingData1===void 0?void 0:_runtimeRequire_remotesLoadingData1.moduleIdToRemoteDataMapping)!==null&&_ref1!==void 0?_ref1:{};const initializeSharingScopeToInitDataMapping=(_ref2=(_runtimeRequire_initializeSharingData=runtimeRequire.initializeSharingData)===null||_runtimeRequire_initializeSharingData===void 0?void 0:_runtimeRequire_initializeSharingData.scopeToSharingDataMapping)!==null&&_ref2!==void 0?_ref2:{};const consumesLoadingChunkMapping=(_ref3=(_runtimeRequire_consumesLoadingData=runtimeRequire.consumesLoadingData)===null||_runtimeRequire_consumesLoadingData===void 0?void 0:_runtimeRequire_consumesLoadingData.chunkMapping)!==null&&_ref3!==void 0?_ref3:{};const consumesLoadingModuleToConsumeDataMapping=(_ref4=(_runtimeRequire_consumesLoadingData1=runtimeRequire.consumesLoadingData)===null||_runtimeRequire_consumesLoadingData1===void 0?void 0:_runtimeRequire_consumesLoadingData1.moduleIdToConsumeDataMapping)!==null&&_ref4!==void 0?_ref4:{};const consumesLoadinginstalledModules={};const initializeSharingInitPromises=[];const initializeSharingInitTokens={};const containerShareScope=(_runtimeRequire_initializeExposesData=runtimeRequire.initializeExposesData)===null||_runtimeRequire_initializeExposesData===void 0?void 0:_runtimeRequire_initializeExposesData.shareScope;for(const key in __module_federation_bundler_runtime__){runtimeRequire.federation[key]=__module_federation_bundler_runtime__[key]}early(runtimeRequire.federation,"libraryType",()=>__module_federation_library_type__);early(runtimeRequire.federation,"sharedFallback",()=>__module_federation_share_fallbacks__);const sharedFallback=runtimeRequire.federation.sharedFallback;early(runtimeRequire.federation,"consumesLoadingModuleToHandlerMapping",()=>{const consumesLoadingModuleToHandlerMapping={};for(let[moduleId,data]of Object.entries(consumesLoadingModuleToConsumeDataMapping)){var _runtimeRequire_federation_bundlerRuntime;consumesLoadingModuleToHandlerMapping[moduleId]={getter:sharedFallback?(_runtimeRequire_federation_bundlerRuntime=runtimeRequire.federation.bundlerRuntime)===null||_runtimeRequire_federation_bundlerRuntime===void 0?void 0:_runtimeRequire_federation_bundlerRuntime.getSharedFallbackGetter({shareKey:data.shareKey,factory:data.fallback,webpackRequire:runtimeRequire,libraryType:runtimeRequire.federation.libraryType}):data.fallback,treeShakingGetter:sharedFallback?data.fallback:undefined,shareInfo:{shareConfig:{fixedDependencies:false,requiredVersion:data.requiredVersion,strictVersion:data.strictVersion,singleton:data.singleton,eager:data.eager},scope:[data.shareScope]},shareKey:data.shareKey,treeShaking:runtimeRequire.federation.sharedFallback?{get:data.fallback,mode:data.treeShakingMode}:undefined}}return consumesLoadingModuleToHandlerMapping});early(runtimeRequire.federation,"initOptions",()=>({}));early(runtimeRequire.federation.initOptions,"name",()=>__module_federation_container_name__);early(runtimeRequire.federation.initOptions,"shareStrategy",()=>__module_federation_share_strategy__);early(runtimeRequire.federation.initOptions,"shared",()=>{const shared={};for(let[scope,stages]of Object.entries(initializeSharingScopeToInitDataMapping)){for(let stage of stages){if(typeof stage==="object"&&stage!==null){const{name,version,factory,eager,singleton,requiredVersion,strictVersion,treeShakingMode}=stage;const shareConfig={};const isValidValue=function(val){return typeof val!=="undefined"};if(isValidValue(singleton)){shareConfig.singleton=singleton}if(isValidValue(requiredVersion)){shareConfig.requiredVersion=requiredVersion}if(isValidValue(eager)){shareConfig.eager=eager}if(isValidValue(strictVersion)){shareConfig.strictVersion=strictVersion}const options={version,scope:[scope],shareConfig,get:factory,treeShaking:treeShakingMode?{mode:treeShakingMode}:undefined};if(shared[name]){shared[name].push(options)}else{shared[name]=[options]}}}}return shared});merge(runtimeRequire.federation.initOptions,"remotes",()=>Object.values(__module_federation_remote_infos__).flat().filter(remote=>remote.externalType==="script"));merge(runtimeRequire.federation.initOptions,"plugins",()=>__module_federation_runtime_plugins__);early(runtimeRequire.federation,"bundlerRuntimeOptions",()=>({}));early(runtimeRequire.federation.bundlerRuntimeOptions,"remotes",()=>({}));early(runtimeRequire.federation.bundlerRuntimeOptions.remotes,"chunkMapping",()=>remotesLoadingChunkMapping);early(runtimeRequire.federation.bundlerRuntimeOptions.remotes,"remoteInfos",()=>__module_federation_remote_infos__);early(runtimeRequire.federation.bundlerRuntimeOptions.remotes,"idToExternalAndNameMapping",()=>{const remotesLoadingIdToExternalAndNameMappingMapping={};for(let[moduleId,data]of Object.entries(remotesLoadingModuleIdToRemoteDataMapping)){remotesLoadingIdToExternalAndNameMappingMapping[moduleId]=[data.shareScope,data.name,data.externalModuleId,data.remoteName]}return remotesLoadingIdToExternalAndNameMappingMapping});early(runtimeRequire.federation.bundlerRuntimeOptions.remotes,"webpackRequire",()=>runtimeRequire);merge(runtimeRequire.federation.bundlerRuntimeOptions.remotes,"idToRemoteMap",()=>{const idToRemoteMap={};for(let[id,remoteData]of Object.entries(remotesLoadingModuleIdToRemoteDataMapping)){const info=__module_federation_remote_infos__[remoteData.remoteName];if(info)idToRemoteMap[id]=info}return idToRemoteMap});override(runtimeRequire,"S",runtimeRequire.federation.bundlerRuntime.S);if(runtimeRequire.federation.attachShareScopeMap){runtimeRequire.federation.attachShareScopeMap(runtimeRequire)}override(runtimeRequire.f,"remotes",(chunkId,promises)=>runtimeRequire.federation.bundlerRuntime.remotes({chunkId,promises,chunkMapping:remotesLoadingChunkMapping,idToExternalAndNameMapping:runtimeRequire.federation.bundlerRuntimeOptions.remotes.idToExternalAndNameMapping,idToRemoteMap:runtimeRequire.federation.bundlerRuntimeOptions.remotes.idToRemoteMap,webpackRequire:runtimeRequire}));override(runtimeRequire.f,"consumes",(chunkId,promises)=>runtimeRequire.federation.bundlerRuntime.consumes({chunkId,promises,chunkMapping:consumesLoadingChunkMapping,moduleToHandlerMapping:runtimeRequire.federation.consumesLoadingModuleToHandlerMapping,installedModules:consumesLoadinginstalledModules,webpackRequire:runtimeRequire}));override(runtimeRequire,"I",(name,initScope)=>runtimeRequire.federation.bundlerRuntime.I({shareScopeName:name,initScope,initPromises:initializeSharingInitPromises,initTokens:initializeSharingInitTokens,webpackRequire:runtimeRequire}));override(runtimeRequire,"initContainer",(shareScope,initScope,remoteEntryInitOptions)=>runtimeRequire.federation.bundlerRuntime.initContainerEntry({shareScope,initScope,remoteEntryInitOptions,shareScopeKey:containerShareScope,webpackRequire:runtimeRequire}));override(runtimeRequire,"getContainer",(module,getScope)=>{var moduleMap=runtimeRequire.initializeExposesData.moduleMap;runtimeRequire.R=getScope;getScope=Object.prototype.hasOwnProperty.call(moduleMap,module)?moduleMap[module]():Promise.resolve().then(()=>{throw new Error('Module "'+module+'" does not exist in container.')});runtimeRequire.R=undefined;return getScope});runtimeRequire.federation.instance=runtimeRequire.federation.bundlerRuntime.init({webpackRequire:runtimeRequire});if((_runtimeRequire_consumesLoadingData2=runtimeRequire.consumesLoadingData)===null||_runtimeRequire_consumesLoadingData2===void 0?void 0:_runtimeRequire_consumesLoadingData2.initialConsumes){runtimeRequire.federation.bundlerRuntime.installInitialConsumes({webpackRequire:runtimeRequire,installedModules:consumesLoadinginstalledModules,initialConsumes:runtimeRequire.consumesLoadingData.initialConsumes,moduleToHandlerMapping:runtimeRequire.federation.consumesLoadingModuleToHandlerMapping})}}}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Compiler } from '../index.js';
|
|
2
|
+
import type { InfrastructureLogging } from '../config/index.js';
|
|
3
|
+
export interface NodeEnvironmentPluginOptions {
|
|
4
|
+
infrastructureLogging: InfrastructureLogging;
|
|
5
|
+
}
|
|
6
|
+
export default class NodeEnvironmentPlugin {
|
|
7
|
+
options: NodeEnvironmentPluginOptions;
|
|
8
|
+
constructor(options: NodeEnvironmentPluginOptions);
|
|
9
|
+
apply(compiler: Compiler): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/node/NodeTemplatePlugin.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 { Compiler } from '../Compiler.js';
|
|
11
|
+
export type NodeTemplatePluginOptions = {
|
|
12
|
+
asyncChunkLoading?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export default class NodeTemplatePlugin {
|
|
15
|
+
private _options;
|
|
16
|
+
constructor(_options?: NodeTemplatePluginOptions);
|
|
17
|
+
apply(compiler: Compiler): void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/node/NodeWatchFileSystem.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 Watchpack from '../../compiled/watchpack/index.js';
|
|
11
|
+
import type { FileSystemInfoEntry, InputFileSystem, Watcher, WatchFileSystem } from '../util/fs.js';
|
|
12
|
+
type WatchpackInstance = InstanceType<typeof Watchpack>;
|
|
13
|
+
export default class NodeWatchFileSystem implements WatchFileSystem {
|
|
14
|
+
#private;
|
|
15
|
+
inputFileSystem: InputFileSystem;
|
|
16
|
+
watcherOptions: Watchpack.WatchOptions;
|
|
17
|
+
watcher?: WatchpackInstance;
|
|
18
|
+
constructor(inputFileSystem: InputFileSystem);
|
|
19
|
+
watch(files: Iterable<string>, directories: Iterable<string>, missing: Iterable<string>, startTime: number, options: Watchpack.WatchOptions, callback: (error: Error | null, fileTimeInfoEntries: Map<string, FileSystemInfoEntry | 'ignore'>, contextTimeInfoEntries: Map<string, FileSystemInfoEntry | 'ignore'>, changedFiles: Set<string>, removedFiles: Set<string>) => void, callbackUndelayed: (fileName: string, changeTime: number) => void): Watcher;
|
|
20
|
+
on(event: 'change', listener: (filename: string, mtime: number) => void): this;
|
|
21
|
+
on(event: 'remove', listener: (filename: string) => void): this;
|
|
22
|
+
on(event: 'aggregated', listener: (changes: Set<string>, removals: Set<string>) => void): this;
|
|
23
|
+
once(event: 'change', listener: (filename: string, mtime: number) => void): this;
|
|
24
|
+
once(event: 'remove', listener: (filename: string) => void): this;
|
|
25
|
+
once(event: 'aggregated', listener: (changes: Set<string>, removals: Set<string>) => void): this;
|
|
26
|
+
emit(event: 'change', filename: string, mtime: number): boolean;
|
|
27
|
+
emit(event: 'remove', filename: string): boolean;
|
|
28
|
+
emit(event: 'aggregated', changes: Set<string>, removals: Set<string>): boolean;
|
|
29
|
+
}
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/node/nodeConsole.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 { LoggerConsole } from '../logging/createConsoleLogger.js';
|
|
11
|
+
export default function ({ colors, appendOnly, stream, }: {
|
|
12
|
+
colors?: boolean;
|
|
13
|
+
appendOnly?: boolean;
|
|
14
|
+
stream: NodeJS.WritableStream;
|
|
15
|
+
}): LoggerConsole;
|
package/dist/rspack.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/blob/4b4ca3b/lib
|
|
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 '../compiled/@rspack/lite-tapable/dist/index.js';
|
|
11
|
+
import { Compiler } from './Compiler.js';
|
|
12
|
+
import { type RspackOptions } from './config/index.js';
|
|
13
|
+
import { MultiCompiler, type MultiRspackOptions } from './MultiCompiler.js';
|
|
14
|
+
import MultiStats from './MultiStats.js';
|
|
15
|
+
import { Stats } from './Stats.js';
|
|
16
|
+
declare function createMultiCompiler(options: MultiRspackOptions): MultiCompiler;
|
|
17
|
+
declare function createCompiler(userOptions: RspackOptions, compilerIndex?: number): Compiler;
|
|
18
|
+
declare function rspack(options: MultiRspackOptions): MultiCompiler;
|
|
19
|
+
declare function rspack(options: RspackOptions): Compiler;
|
|
20
|
+
declare function rspack(options: MultiRspackOptions | RspackOptions): MultiCompiler | Compiler;
|
|
21
|
+
declare function rspack(options: MultiRspackOptions, callback?: Callback<Error, MultiStats>): null | MultiCompiler;
|
|
22
|
+
declare function rspack(options: RspackOptions, callback?: Callback<Error, Stats>): null | Compiler;
|
|
23
|
+
declare function rspack(options: MultiRspackOptions | RspackOptions, callback?: Callback<Error, MultiStats | Stats>): null | MultiCompiler | Compiler;
|
|
24
|
+
export { createCompiler, createMultiCompiler, MultiStats, rspack, Stats };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function normalizeUrl(url: string): string;
|
|
2
|
+
type DebouncedFunction<T extends (...args: any[]) => any> = (...args: Parameters<T>) => void;
|
|
3
|
+
declare function cssReload(moduleId: string, options: Record<string, any>): DebouncedFunction<() => void>;
|
|
4
|
+
export { cssReload };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function (): void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type BuiltinPlugin, BuiltinPluginName } from '@ohos-ports/rspack-binding';
|
|
2
|
+
import { RspackBuiltinPlugin } from '../builtin-plugin/base.js';
|
|
3
|
+
import type { Compiler } from '../Compiler.js';
|
|
4
|
+
import { type NormalizedSharedOptions, type ShareScope } from './SharePlugin.js';
|
|
5
|
+
export type CollectSharedEntryPluginOptions = {
|
|
6
|
+
sharedOptions: NormalizedSharedOptions;
|
|
7
|
+
shareScope?: ShareScope;
|
|
8
|
+
};
|
|
9
|
+
export type ShareRequestsMap = Record<string, {
|
|
10
|
+
shareScope: string;
|
|
11
|
+
requests: [string, string][];
|
|
12
|
+
}>;
|
|
13
|
+
export declare class CollectSharedEntryPlugin extends RspackBuiltinPlugin {
|
|
14
|
+
name: BuiltinPluginName;
|
|
15
|
+
sharedOptions: NormalizedSharedOptions;
|
|
16
|
+
private _collectedEntries;
|
|
17
|
+
constructor(options: CollectSharedEntryPluginOptions);
|
|
18
|
+
getData(): ShareRequestsMap;
|
|
19
|
+
getFilename(): string;
|
|
20
|
+
apply(compiler: Compiler): void;
|
|
21
|
+
raw(): BuiltinPlugin;
|
|
22
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type BuiltinPlugin, BuiltinPluginName } from '@ohos-ports/rspack-binding';
|
|
2
|
+
import { RspackBuiltinPlugin } from '../builtin-plugin/base.js';
|
|
3
|
+
import type { Compiler } from '../Compiler.js';
|
|
4
|
+
export type ConsumeSharedPluginOptions = {
|
|
5
|
+
consumes: Consumes;
|
|
6
|
+
shareScope?: string | string[];
|
|
7
|
+
enhanced?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export type Consumes = (ConsumesItem | ConsumesObject)[] | ConsumesObject;
|
|
10
|
+
export type ConsumesItem = string;
|
|
11
|
+
export type ConsumesObject = {
|
|
12
|
+
[k: string]: ConsumesConfig | ConsumesItem;
|
|
13
|
+
};
|
|
14
|
+
export type ConsumesConfig = {
|
|
15
|
+
eager?: boolean;
|
|
16
|
+
import?: false | ConsumesItem;
|
|
17
|
+
packageName?: string;
|
|
18
|
+
requiredVersion?: false | string;
|
|
19
|
+
shareKey?: string;
|
|
20
|
+
shareScope?: string | string[];
|
|
21
|
+
singleton?: boolean;
|
|
22
|
+
strictVersion?: boolean;
|
|
23
|
+
treeShakingMode?: 'server-calc' | 'runtime-infer';
|
|
24
|
+
};
|
|
25
|
+
export declare function normalizeConsumeShareOptions(consumes: Consumes, shareScope?: string | string[]): [string, {
|
|
26
|
+
import: string | undefined;
|
|
27
|
+
shareScope: string | string[];
|
|
28
|
+
shareKey: string;
|
|
29
|
+
requiredVersion: string | false | undefined;
|
|
30
|
+
strictVersion: boolean;
|
|
31
|
+
packageName: string | undefined;
|
|
32
|
+
singleton: boolean;
|
|
33
|
+
eager: boolean;
|
|
34
|
+
treeShakingMode: "runtime-infer" | "server-calc" | undefined;
|
|
35
|
+
}][];
|
|
36
|
+
export declare class ConsumeSharedPlugin extends RspackBuiltinPlugin {
|
|
37
|
+
name: BuiltinPluginName;
|
|
38
|
+
_options: {
|
|
39
|
+
consumes: [string, {
|
|
40
|
+
import: string | undefined;
|
|
41
|
+
shareScope: string | string[];
|
|
42
|
+
shareKey: string;
|
|
43
|
+
requiredVersion: string | false | undefined;
|
|
44
|
+
strictVersion: boolean;
|
|
45
|
+
packageName: string | undefined;
|
|
46
|
+
singleton: boolean;
|
|
47
|
+
eager: boolean;
|
|
48
|
+
treeShakingMode: "runtime-infer" | "server-calc" | undefined;
|
|
49
|
+
}][];
|
|
50
|
+
enhanced: boolean;
|
|
51
|
+
};
|
|
52
|
+
constructor(options: ConsumeSharedPluginOptions);
|
|
53
|
+
raw(compiler: Compiler): BuiltinPlugin;
|
|
54
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Compiler } from '../Compiler.js';
|
|
2
|
+
import type { LibraryOptions, Plugins } from '../config/index.js';
|
|
3
|
+
import { type ModuleFederationManifestPluginOptions } from '../container/ModuleFederationManifestPlugin.js';
|
|
4
|
+
import type { Shared, SharedConfig } from './SharePlugin.js';
|
|
5
|
+
export interface IndependentSharePluginOptions {
|
|
6
|
+
name: string;
|
|
7
|
+
shared: Shared;
|
|
8
|
+
library?: LibraryOptions;
|
|
9
|
+
outputDir?: string;
|
|
10
|
+
plugins?: Plugins;
|
|
11
|
+
treeShaking?: boolean;
|
|
12
|
+
manifest?: ModuleFederationManifestPluginOptions;
|
|
13
|
+
injectTreeShakingUsedExports?: boolean;
|
|
14
|
+
treeShakingSharedExcludePlugins?: string[];
|
|
15
|
+
onBuildAssets?: (buildAssets: ShareFallback) => void;
|
|
16
|
+
}
|
|
17
|
+
export type ShareFallback = Record<string, [string, string, string][]>;
|
|
18
|
+
export declare class IndependentSharedPlugin {
|
|
19
|
+
mfName: string;
|
|
20
|
+
shared: Shared;
|
|
21
|
+
library?: LibraryOptions;
|
|
22
|
+
sharedOptions: [string, SharedConfig][];
|
|
23
|
+
outputDir: string;
|
|
24
|
+
plugins: Plugins;
|
|
25
|
+
treeShaking?: boolean;
|
|
26
|
+
manifest?: ModuleFederationManifestPluginOptions;
|
|
27
|
+
buildAssets: ShareFallback;
|
|
28
|
+
injectTreeShakingUsedExports?: boolean;
|
|
29
|
+
treeShakingSharedExcludePlugins?: string[];
|
|
30
|
+
onBuildAssets?: (buildAssets: ShareFallback) => void;
|
|
31
|
+
name: string;
|
|
32
|
+
constructor(options: IndependentSharePluginOptions);
|
|
33
|
+
apply(compiler: Compiler): void;
|
|
34
|
+
private prepareBuildAssets;
|
|
35
|
+
private createIndependentCompilers;
|
|
36
|
+
private createIndependentCompiler;
|
|
37
|
+
}
|