@ohos-ports/rspack-core 1.7.11-beta.1 → 2.2.9-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/README.md +11 -1
- package/compiled/@rspack/lite-tapable/dist/index.d.ts +190 -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 +161 -11
- package/compiled/@swc/types/package.json +1 -1
- 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/{browserslist-load-config → http-proxy-middleware}/license +3 -2
- 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/README.md +196 -2
- package/compiled/tinypool/dist/{common-Qw-RoVFD.js → common-Bo3KCGim.js} +4 -1
- package/compiled/tinypool/dist/entry/worker.js +1 -1
- package/compiled/tinypool/dist/index.d.ts +9 -4
- package/compiled/tinypool/dist/index.js +17 -53
- package/compiled/tinypool/package.json +22 -6
- package/compiled/watchpack/index.d.ts +3 -217
- package/compiled/watchpack/index.js +1778 -1091
- package/compiled/watchpack/package.json +8 -1
- 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.d.ts +61 -0
- package/compiled/webpack-sources/index.js +2370 -576
- package/compiled/webpack-sources/package.json +8 -1
- package/compiled/webpack-sources/types/CachedSource.d.ts +192 -0
- package/compiled/webpack-sources/types/CompatSource.d.ts +87 -0
- package/compiled/webpack-sources/types/ConcatSource.d.ts +75 -0
- package/compiled/webpack-sources/types/OriginalSource.d.ts +87 -0
- package/compiled/webpack-sources/types/PrefixSource.d.ts +59 -0
- package/compiled/webpack-sources/types/RawSource.d.ts +75 -0
- package/compiled/webpack-sources/types/ReplaceSource.d.ts +107 -0
- package/compiled/webpack-sources/types/SizeOnlySource.d.ts +24 -0
- package/compiled/webpack-sources/types/Source.d.ts +189 -0
- package/compiled/webpack-sources/types/SourceMapSource.d.ts +136 -0
- package/compiled/webpack-sources/types/helpers/createMappingsSerializer.d.ts +60 -0
- package/compiled/webpack-sources/types/helpers/getFromStreamChunks.d.ts +16 -0
- package/compiled/webpack-sources/types/helpers/getGeneratedSourceInfo.d.ts +31 -0
- package/compiled/webpack-sources/types/helpers/getName.d.ts +15 -0
- package/compiled/webpack-sources/types/helpers/getSource.d.ts +15 -0
- package/compiled/webpack-sources/types/helpers/readMappings.d.ts +19 -0
- package/compiled/webpack-sources/types/helpers/scopes.d.ts +119 -0
- package/compiled/webpack-sources/types/helpers/splitIntoLines.d.ts +6 -0
- package/compiled/webpack-sources/types/helpers/splitIntoPotentialTokens.d.ts +37 -0
- package/compiled/webpack-sources/types/helpers/streamAndGetSourceAndMap.d.ts +39 -0
- package/compiled/webpack-sources/types/helpers/streamChunks.d.ts +56 -0
- package/compiled/webpack-sources/types/helpers/streamChunksOfCombinedSourceMap.d.ts +42 -0
- package/compiled/webpack-sources/types/helpers/streamChunksOfRawSource.d.ts +16 -0
- package/compiled/webpack-sources/types/helpers/streamChunksOfSourceMap.d.ts +19 -0
- package/compiled/webpack-sources/types/helpers/stringBufferUtils.d.ts +55 -0
- package/compiled/webpack-sources/types/index.d.ts +50 -0
- package/dist/BuildInfo.d.ts +3 -1
- package/dist/ChunkGraph.d.ts +1 -1
- package/dist/CodeGenerationResults.d.ts +6 -1
- package/dist/Compilation.d.ts +60 -89
- package/dist/Compiler.d.ts +25 -22
- package/dist/ContextModuleFactory.d.ts +2 -2
- package/dist/Diagnostics.d.ts +2 -6
- package/dist/ExecuteModulePlugin.d.ts +1 -1
- package/dist/ExportsInfo.d.ts +1 -1
- package/dist/ExternalModule.d.ts +15 -1
- package/dist/FileSystem.d.ts +4 -2
- package/dist/FileSystemDependencies.d.ts +15 -0
- package/dist/Module.d.ts +9 -6
- package/dist/ModuleGraph.d.ts +11 -8
- package/dist/ModuleGraphConnection.d.ts +10 -0
- package/dist/Modules.d.ts +3 -0
- package/dist/MultiCompiler.d.ts +9 -9
- package/dist/MultiStats.d.ts +3 -3
- package/dist/MultiWatching.d.ts +3 -3
- package/dist/NativeWatchFileSystem.d.ts +31 -2
- package/dist/NormalModule.d.ts +4 -5
- package/dist/NormalModuleFactory.d.ts +5 -4
- package/dist/Resolver.d.ts +10 -2
- package/dist/ResolverFactory.d.ts +2 -2
- package/dist/RuntimeGlobals.d.ts +61 -56
- package/dist/RuntimeModule.d.ts +3 -3
- package/dist/RuntimeTemplate.d.ts +151 -0
- package/dist/Stats.d.ts +4 -4
- package/dist/VirtualModulesPlugin.d.ts +1 -1
- package/dist/Watching.d.ts +5 -5
- package/dist/builtin-loader/lightningcss/index.d.ts +11 -14
- package/dist/builtin-loader/lightningcss/target.d.ts +4 -0
- package/dist/builtin-loader/swc/index.d.ts +3 -5
- package/dist/builtin-loader/swc/pluginImport.d.ts +1 -1
- package/dist/builtin-loader/swc/types.d.ts +36 -65
- package/dist/builtin-plugin/APIPlugin.d.ts +3 -3
- package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.d.ts +3 -3
- package/dist/builtin-plugin/AssetModulesPlugin.d.ts +3 -3
- package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.d.ts +3 -3
- package/dist/builtin-plugin/BannerPlugin.d.ts +3 -3
- package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +3 -3
- package/dist/builtin-plugin/CaseSensitivePlugin.d.ts +3 -3
- package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.d.ts +3 -3
- package/dist/builtin-plugin/CircularCheckRspackPlugin.d.ts +33 -0
- package/dist/builtin-plugin/CircularDependencyRspackPlugin.d.ts +10 -4
- package/dist/builtin-plugin/CircularModulesInfoPlugin.d.ts +7 -0
- package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +3 -3
- 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 +3 -3
- package/dist/builtin-plugin/CopyRspackPlugin.d.ts +3 -3
- package/dist/builtin-plugin/CssChunkingPlugin.d.ts +3 -3
- package/dist/builtin-plugin/CssHttpExternalsRspackPlugin.d.ts +9 -0
- package/dist/builtin-plugin/CssModulesPlugin.d.ts +3 -3
- package/dist/builtin-plugin/DataUriPlugin.d.ts +3 -3
- package/dist/builtin-plugin/DefinePlugin.d.ts +3 -3
- package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +13 -2
- package/dist/builtin-plugin/DllEntryPlugin.d.ts +3 -3
- package/dist/builtin-plugin/DllReferenceAgencyPlugin.d.ts +3 -3
- package/dist/builtin-plugin/DynamicEntryPlugin.d.ts +4 -4
- package/dist/builtin-plugin/ElectronTargetPlugin.d.ts +3 -3
- package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +2 -2
- package/dist/builtin-plugin/EnableLibraryPlugin.d.ts +2 -2
- package/dist/builtin-plugin/EnableWasmLoadingPlugin.d.ts +3 -3
- package/dist/builtin-plugin/EnsureChunkConditionsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/EntryPlugin.d.ts +4 -4
- package/dist/builtin-plugin/EsmLibraryPlugin.d.ts +7 -2
- package/dist/builtin-plugin/EsmNodeTargetPlugin.d.ts +9 -0
- package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +3 -3
- package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +3 -3
- package/dist/builtin-plugin/ExternalsPlugin.d.ts +4 -3
- package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.d.ts +3 -3
- package/dist/builtin-plugin/FileUriPlugin.d.ts +3 -3
- package/dist/builtin-plugin/FlagAllModulesAsUsedPlugin.d.ts +3 -3
- package/dist/builtin-plugin/FlagDependencyExportsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/FlagDependencyUsagePlugin.d.ts +2 -2
- package/dist/builtin-plugin/HashedModuleIdsPlugin.d.ts +10 -0
- package/dist/builtin-plugin/HotModuleReplacementPlugin.d.ts +2 -2
- package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +5 -5
- package/dist/builtin-plugin/HttpUriPlugin.d.ts +7 -3
- package/dist/builtin-plugin/IgnorePlugin.d.ts +3 -3
- package/dist/builtin-plugin/InferAsyncModulesPlugin.d.ts +3 -3
- package/dist/builtin-plugin/InlineExportsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +21 -6
- package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +2 -2
- package/dist/builtin-plugin/JsonModulesPlugin.d.ts +3 -3
- package/dist/builtin-plugin/LibManifestPlugin.d.ts +3 -3
- package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +7 -11
- package/dist/builtin-plugin/LimitChunkCountPlugin.d.ts +3 -3
- package/dist/builtin-plugin/MangleExportsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/MergeDuplicateChunksPlugin.d.ts +3 -3
- package/dist/builtin-plugin/ModuleChunkFormatPlugin.d.ts +3 -3
- package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +2 -2
- package/dist/builtin-plugin/ModuleInfoHeaderPlugin.d.ts +3 -3
- package/dist/builtin-plugin/NamedChunkIdsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/NamedModuleIdsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/NaturalChunkIdsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/NaturalModuleIdsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/NoEmitOnErrorsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/NodeTargetPlugin.d.ts +3 -3
- package/dist/builtin-plugin/NormalModuleReplacementPlugin.d.ts +4 -4
- package/dist/builtin-plugin/OccurrenceChunkIdsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/ProgressPlugin.d.ts +8 -7
- package/dist/builtin-plugin/ProvidePlugin.d.ts +3 -3
- package/dist/builtin-plugin/RealContentHashPlugin.d.ts +15 -4
- package/dist/builtin-plugin/RemoveDuplicateModulesPlugin.d.ts +3 -3
- package/dist/builtin-plugin/RemoveEmptyChunksPlugin.d.ts +3 -3
- package/dist/builtin-plugin/RsdoctorPlugin.d.ts +8 -11
- package/dist/builtin-plugin/RslibPlugin.d.ts +5 -6
- package/dist/builtin-plugin/RstestPlugin.d.ts +3 -4
- package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +3 -3
- package/dist/builtin-plugin/RuntimePlugin.d.ts +7 -11
- package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +9 -9
- package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +5 -5
- package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +3 -3
- package/dist/builtin-plugin/SplitChunksPlugin.d.ts +6 -5
- package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +2 -2
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +7 -6
- package/dist/builtin-plugin/SyncModuleIdsPlugin.d.ts +16 -0
- package/dist/builtin-plugin/URLPlugin.d.ts +3 -3
- package/dist/builtin-plugin/WorkerPlugin.d.ts +4 -4
- package/dist/builtin-plugin/base.d.ts +3 -3
- package/dist/builtin-plugin/css-extract/index.d.ts +3 -3
- package/dist/builtin-plugin/css-extract/loader.d.ts +1 -1
- package/dist/builtin-plugin/css-extract/utils.d.ts +8 -1
- package/dist/builtin-plugin/html-plugin/hooks.d.ts +3 -3
- package/dist/builtin-plugin/html-plugin/index.d.ts +2 -2
- package/dist/builtin-plugin/html-plugin/options.d.ts +2 -7
- package/dist/builtin-plugin/html-plugin/plugin.d.ts +5 -9
- package/dist/builtin-plugin/html-plugin/taps.d.ts +1 -1
- package/dist/builtin-plugin/index.d.ts +92 -84
- package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +6 -6
- package/dist/builtin-plugin/lazy-compilation/middleware.d.ts +4 -4
- 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 +4 -4
- package/dist/config/adapterRuleUse.d.ts +89 -55
- package/dist/config/browserslistTargetHandler.d.ts +1 -1
- package/dist/config/defaults.d.ts +5 -3
- package/dist/config/devServer.d.ts +103 -238
- package/dist/config/index.d.ts +5 -5
- package/dist/config/normalization.d.ts +26 -47
- package/dist/config/target.d.ts +19 -12
- package/dist/config/types.d.ts +615 -256
- package/dist/container/ContainerPlugin.d.ts +4 -4
- package/dist/container/ContainerReferencePlugin.d.ts +4 -4
- package/dist/container/ModuleFederationManifestPlugin.d.ts +12 -5
- package/dist/container/ModuleFederationPlugin.d.ts +22 -5
- package/dist/container/ModuleFederationPluginV1.d.ts +10 -6
- package/dist/container/ModuleFederationRuntimePlugin.d.ts +3 -3
- package/dist/cssExtractHmr.js +2 -27
- package/dist/cssExtractLoader.js +24 -65
- package/dist/exports.d.ts +98 -84
- package/dist/index.d.ts +4 -3
- package/dist/index.js +14201 -11810
- package/dist/lib/AbstractMethodError.d.ts +1 -1
- package/dist/lib/Cache.d.ts +5 -2
- package/dist/lib/CacheFacade.d.ts +4 -4
- package/dist/lib/DllPlugin.d.ts +2 -2
- package/dist/lib/DllReferencePlugin.d.ts +3 -3
- package/dist/lib/EntryOptionPlugin.d.ts +2 -2
- package/dist/lib/EnvironmentPlugin.d.ts +3 -3
- package/dist/lib/HookWebpackError.d.ts +2 -3
- package/dist/lib/IgnoreWarningsPlugin.d.ts +1 -1
- package/dist/lib/LoaderOptionsPlugin.d.ts +2 -2
- package/dist/lib/LoaderTargetPlugin.d.ts +2 -2
- package/dist/lib/WebpackError.d.ts +2 -2
- package/dist/lib/cache/MemoryCachePlugin.d.ts +1 -1
- package/dist/lib/cache/getLazyHashedEtag.d.ts +2 -2
- package/dist/lib/cache/mergeEtags.d.ts +1 -2
- package/dist/loader-runner/ModuleError.d.ts +1 -1
- package/dist/loader-runner/cache.d.ts +27 -0
- package/dist/loader-runner/dependencies.d.ts +23 -0
- package/dist/loader-runner/index.d.ts +10 -11
- package/dist/loader-runner/loadLoader.d.ts +2 -2
- package/dist/loader-runner/service.d.ts +10 -1
- package/dist/loader-runner/utils.d.ts +3 -3
- package/dist/loader-runner/worker.d.ts +1 -1
- package/dist/logging/createConsoleLogger.d.ts +2 -2
- package/dist/l~0.js +34 -0
- package/dist/l~3.js +34 -0
- package/dist/moduleFederationDefaultRuntime.js +1 -1
- package/dist/node/NodeEnvironmentPlugin.d.ts +2 -2
- package/dist/node/NodeTemplatePlugin.d.ts +1 -1
- package/dist/node/NodeWatchFileSystem.d.ts +15 -3
- package/dist/node/nodeConsole.d.ts +1 -1
- package/dist/rspack.d.ts +7 -8
- package/dist/rspackOptionsApply.d.ts +1 -1
- package/dist/runtime/cssExtractHmr.d.ts +2 -2
- package/dist/runtime/moduleFederationDefaultRuntime.d.ts +1 -2
- package/dist/sharing/CollectSharedEntryPlugin.d.ts +22 -0
- package/dist/sharing/ConsumeSharedPlugin.d.ts +18 -6
- package/dist/sharing/IndependentSharedPlugin.d.ts +37 -0
- package/dist/sharing/ProvideSharedPlugin.d.ts +22 -3
- package/dist/sharing/SharePlugin.d.ts +51 -3
- package/dist/sharing/ShareRuntimePlugin.d.ts +2 -2
- 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 +1 -0
- package/dist/stats/DefaultStatsFactoryPlugin.d.ts +1 -1
- package/dist/stats/DefaultStatsPresetPlugin.d.ts +1 -1
- package/dist/stats/DefaultStatsPrinterPlugin.d.ts +1 -1
- package/dist/stats/StatsFactory.d.ts +7 -5
- package/dist/stats/StatsPrinter.d.ts +7 -7
- package/dist/stats/statsFactoryUtils.d.ts +15 -19
- package/dist/swc.d.ts +2 -2
- package/dist/taps/compilation.d.ts +1 -1
- package/dist/taps/compiler.d.ts +1 -1
- package/dist/taps/contextModuleFactory.d.ts +1 -1
- package/dist/taps/externalModule.d.ts +2 -0
- package/dist/taps/index.d.ts +7 -6
- package/dist/taps/javascriptModules.d.ts +1 -1
- package/dist/taps/normalModuleFactory.d.ts +1 -1
- package/dist/taps/types.d.ts +2 -2
- package/dist/trace/index.d.ts +1 -0
- package/dist/trace/traceHookPlugin.d.ts +1 -1
- package/dist/util/bindingHelpers.d.ts +7 -0
- package/dist/util/comparators.d.ts +1 -1
- package/dist/util/createHash.d.ts +2 -2
- package/dist/util/fs.d.ts +19 -18
- package/dist/util/hash/md4.d.ts +1 -1
- package/dist/util/hash/xxhash64.d.ts +1 -1
- package/dist/util/identifier.d.ts +35 -9
- package/dist/util/index.d.ts +2 -2
- package/dist/util/source.d.ts +3 -3
- package/dist/util/supportsColor.d.ts +6 -0
- package/dist/util/targetsVersion.d.ts +2 -0
- package/dist/util/validateConfig.d.ts +1 -1
- package/dist/util/watchTimeInfo.d.ts +7 -0
- package/dist/web/JsonpTemplatePlugin.d.ts +13 -0
- package/dist/webworker/WebWorkerTemplatePlugin.d.ts +13 -0
- package/dist/worker.js +935 -907
- package/hot/dev-server.js +12 -11
- package/hot/emitter.js +3 -1
- package/hot/lazy-compilation-node.js +4 -1
- package/hot/lazy-compilation-web.js +2 -3
- package/hot/log-apply-result.js +8 -5
- package/hot/log.js +18 -10
- package/hot/only-dev-server.js +13 -12
- package/hot/poll.js +10 -9
- package/hot/signal.js +12 -10
- package/module.d.ts +39 -2
- package/package.json +15 -39
- package/compiled/browserslist-load-config/index.d.ts +0 -21
- package/compiled/browserslist-load-config/index.js +0 -252
- package/compiled/browserslist-load-config/package.json +0 -1
- package/compiled/webpack-sources/types.d.ts +0 -458
- package/dist/builtin-loader/index.d.ts +0 -1
- package/dist/builtin-plugin/WebWorkerTemplatePlugin.d.ts +0 -7
- package/dist/container/index.d.ts +0 -4
- package/dist/util/MergeCaller.d.ts +0 -10
- package/dist/util/fake.d.ts +0 -14
package/dist/lib/Cache.d.ts
CHANGED
|
@@ -7,14 +7,16 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import
|
|
11
|
-
import
|
|
10
|
+
import type binding from '@rspack/binding';
|
|
11
|
+
import { AsyncParallelHook, AsyncSeriesBailHook, SyncHook } from '../../compiled/@rspack/lite-tapable/dist/index.js';
|
|
12
|
+
import type { WebpackError } from './WebpackError.js';
|
|
12
13
|
export interface Etag {
|
|
13
14
|
toString(): string;
|
|
14
15
|
}
|
|
15
16
|
export type CallbackCache<T> = (err?: WebpackError | null, result?: T) => void;
|
|
16
17
|
type GotHandler<T = any> = (result: T | null, callback: (error: Error | null) => void) => void;
|
|
17
18
|
export declare class Cache {
|
|
19
|
+
#private;
|
|
18
20
|
static STAGE_DISK: number;
|
|
19
21
|
static STAGE_MEMORY: number;
|
|
20
22
|
static STAGE_DEFAULT: number;
|
|
@@ -28,6 +30,7 @@ export declare class Cache {
|
|
|
28
30
|
shutdown: AsyncParallelHook<[]>;
|
|
29
31
|
};
|
|
30
32
|
constructor();
|
|
33
|
+
static __to_binding(cache: Cache): binding.JsCache;
|
|
31
34
|
/**
|
|
32
35
|
* @param identifier the cache identifier
|
|
33
36
|
* @param etag the etag
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import type { Cache, CallbackCache, Etag } from './Cache';
|
|
11
|
-
import type { HashableObject, HashConstructor } from './cache/getLazyHashedEtag';
|
|
12
|
-
import type WebpackError from './WebpackError';
|
|
10
|
+
import type { Cache, CallbackCache, Etag } from './Cache.js';
|
|
11
|
+
import type { HashableObject, HashConstructor } from './cache/getLazyHashedEtag.js';
|
|
12
|
+
import type WebpackError from './WebpackError.js';
|
|
13
13
|
type CallbackNormalErrorCache<T> = (err?: WebpackError | null, result?: T) => void;
|
|
14
14
|
declare abstract class BaseCache {
|
|
15
15
|
abstract get<T>(callback: CallbackCache<T>): void;
|
|
@@ -134,6 +134,6 @@ export declare class CacheFacade {
|
|
|
134
134
|
* @param computer function to compute the value if not cached
|
|
135
135
|
* @returns promise with the data
|
|
136
136
|
*/
|
|
137
|
-
providePromise<T>(identifier: string, etag: Etag | null, computer: () => Promise<T> | T): Promise<
|
|
137
|
+
providePromise<T>(identifier: string, etag: Etag | null, computer: () => Promise<T> | T): Promise<T>;
|
|
138
138
|
}
|
|
139
139
|
export default CacheFacade;
|
package/dist/lib/DllPlugin.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import type { Compiler } from '../Compiler';
|
|
10
|
+
import type { Compiler } from '../Compiler.js';
|
|
11
11
|
export type DllPluginOptions = {
|
|
12
12
|
/**
|
|
13
13
|
* Context of requests in the manifest file (defaults to the webpack context).
|
|
@@ -31,7 +31,7 @@ export type DllPluginOptions = {
|
|
|
31
31
|
*/
|
|
32
32
|
path: string;
|
|
33
33
|
/**
|
|
34
|
-
* Type of the dll bundle (external type, use value of 'output.
|
|
34
|
+
* Type of the dll bundle (external type, use value of 'output.library.type').
|
|
35
35
|
*/
|
|
36
36
|
type?: string;
|
|
37
37
|
};
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
10
|
import type { JsBuildMeta } from '@rspack/binding';
|
|
11
|
-
import type { Compiler } from '../Compiler';
|
|
11
|
+
import type { Compiler } from '../Compiler.js';
|
|
12
12
|
export type DllReferencePluginOptions = {
|
|
13
13
|
/**
|
|
14
14
|
* Context of requests in the manifest (or content property) as absolute path.
|
|
@@ -31,7 +31,7 @@ export type DllReferencePluginOptions = {
|
|
|
31
31
|
*/
|
|
32
32
|
scope?: string;
|
|
33
33
|
/**
|
|
34
|
-
* How the dll is exposed (
|
|
34
|
+
* How the dll is exposed (library.type, defaults to manifest.type).
|
|
35
35
|
*/
|
|
36
36
|
sourceType?: DllReferencePluginOptionsSourceType;
|
|
37
37
|
/**
|
|
@@ -60,7 +60,7 @@ export type DllReferencePluginOptions = {
|
|
|
60
60
|
*/
|
|
61
61
|
scope?: string;
|
|
62
62
|
/**
|
|
63
|
-
* How the dll is exposed (
|
|
63
|
+
* How the dll is exposed (library.type).
|
|
64
64
|
*/
|
|
65
65
|
sourceType?: DllReferencePluginOptionsSourceType;
|
|
66
66
|
/**
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import type { Compiler, EntryDescriptionNormalized, EntryNormalized } from '
|
|
11
|
-
import type { EntryOptions } from '../builtin-plugin';
|
|
10
|
+
import type { Compiler, EntryDescriptionNormalized, EntryNormalized } from '../index.js';
|
|
11
|
+
import type { EntryOptions } from '../builtin-plugin/index.js';
|
|
12
12
|
export declare class EntryOptionPlugin {
|
|
13
13
|
/**
|
|
14
14
|
* @param compiler the compiler instance one is tapping into
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import type { Compiler } from '../Compiler';
|
|
10
|
+
import type { Compiler } from '../Compiler.js';
|
|
11
11
|
declare class EnvironmentPlugin {
|
|
12
12
|
keys: string[];
|
|
13
|
-
defaultValues: Record<string,
|
|
14
|
-
constructor(...keys: string[] | [Record<string,
|
|
13
|
+
defaultValues: Record<string, any>;
|
|
14
|
+
constructor(...keys: string[] | [Record<string, any> | string | string[]]);
|
|
15
15
|
/**
|
|
16
16
|
* Apply the plugin
|
|
17
17
|
* @param compiler the compiler instance
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import type { Callback } from '
|
|
11
|
-
import WebpackError from './WebpackError';
|
|
10
|
+
import type { Callback } from '../../compiled/@rspack/lite-tapable/dist/index.js';
|
|
11
|
+
import WebpackError from './WebpackError.js';
|
|
12
12
|
export declare class HookWebpackError extends WebpackError {
|
|
13
13
|
hook: string;
|
|
14
14
|
error: Error;
|
|
@@ -19,7 +19,6 @@ export declare class HookWebpackError extends WebpackError {
|
|
|
19
19
|
*/
|
|
20
20
|
constructor(error: Error, hook: string);
|
|
21
21
|
}
|
|
22
|
-
export default HookWebpackError;
|
|
23
22
|
/**
|
|
24
23
|
* @param error an error
|
|
25
24
|
* @param hook name of the hook
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import type { Compiler, IgnoreWarningsNormalized, RspackPluginInstance } from '
|
|
10
|
+
import type { Compiler, IgnoreWarningsNormalized, RspackPluginInstance } from '../index.js';
|
|
11
11
|
declare class IgnoreWarningsPlugin implements RspackPluginInstance {
|
|
12
12
|
_ignorePattern: IgnoreWarningsNormalized;
|
|
13
13
|
name: string;
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import type { Compiler } from '../Compiler';
|
|
11
|
-
import type { MatchObject } from './ModuleFilenameHelpers';
|
|
10
|
+
import type { Compiler } from '../Compiler.js';
|
|
11
|
+
import type { MatchObject } from './ModuleFilenameHelpers.js';
|
|
12
12
|
type LoaderOptionsPluginOptions = MatchObject & {
|
|
13
13
|
[key: string]: unknown;
|
|
14
14
|
};
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import type { Compiler } from '../Compiler';
|
|
11
|
-
import type { Target } from '../config';
|
|
10
|
+
import type { Compiler } from '../Compiler.js';
|
|
11
|
+
import type { Target } from '../config/index.js';
|
|
12
12
|
export declare class LoaderTargetPlugin {
|
|
13
13
|
readonly target: Target;
|
|
14
14
|
/**
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
10
|
import type { DependencyLocation } from '@rspack/binding';
|
|
11
|
-
import type { Chunk } from '../Chunk';
|
|
12
|
-
import type { Module } from '../Module';
|
|
11
|
+
import type { Chunk } from '../Chunk.js';
|
|
12
|
+
import type { Module } from '../Module.js';
|
|
13
13
|
export declare class WebpackError extends Error {
|
|
14
14
|
loc?: DependencyLocation;
|
|
15
15
|
file?: string;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import type Hash from '../../util/hash';
|
|
10
|
+
import type Hash from '../../util/hash/index.js';
|
|
11
11
|
export type HashConstructor = typeof Hash;
|
|
12
12
|
export interface HashableObject {
|
|
13
13
|
updateHash(hash: Hash): void;
|
|
@@ -32,4 +32,4 @@ declare class LazyHashedEtag {
|
|
|
32
32
|
* @returns etag
|
|
33
33
|
*/
|
|
34
34
|
export declare const getter: (obj: HashableObject, hashFunction?: string | HashConstructor) => LazyHashedEtag;
|
|
35
|
-
export
|
|
35
|
+
export {};
|
|
@@ -7,11 +7,10 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import type { Etag } from '../Cache';
|
|
10
|
+
import type { Etag } from '../Cache.js';
|
|
11
11
|
/**
|
|
12
12
|
* @param first first
|
|
13
13
|
* @param second second
|
|
14
14
|
* @returns result
|
|
15
15
|
*/
|
|
16
16
|
export declare const mergeEtags: (first: Etag, second: Etag) => Etag;
|
|
17
|
-
export default mergeEtags;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { JsLoaderContext } from '@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
|
+
parseMeta: Record<string, string>;
|
|
10
|
+
};
|
|
11
|
+
export type WorkerCacheResult = {
|
|
12
|
+
type: 'disabled';
|
|
13
|
+
} | {
|
|
14
|
+
type: 'miss';
|
|
15
|
+
} | {
|
|
16
|
+
type: 'hit';
|
|
17
|
+
entry: LoaderCacheEntry;
|
|
18
|
+
};
|
|
19
|
+
export declare class LoaderCache {
|
|
20
|
+
#private;
|
|
21
|
+
constructor(context: JsLoaderContext, dependencies: LoaderDependenciesState);
|
|
22
|
+
get(loaderIndex: number, content: LoaderCacheContent | null | undefined, additionalData: unknown): Promise<LoaderCacheEntry | null | undefined>;
|
|
23
|
+
store(loaderIndex: number, content: LoaderCacheContent | null | undefined, sourceMap: Uint8Array | undefined, additionalData: unknown): Promise<void>;
|
|
24
|
+
workerGet(loaderIndex: number, content: LoaderCacheContent | null | undefined, additionalData: unknown): Promise<WorkerCacheResult>;
|
|
25
|
+
workerStore(loaderIndex: number, content: LoaderCacheContent | null | undefined, sourceMap: Uint8Array | undefined, additionalData: unknown): Promise<void>;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { JsLoaderContext } from '@rspack/binding';
|
|
2
|
+
export type LoaderDependencies = JsLoaderContext['dependencies'];
|
|
3
|
+
export declare class LoaderDependenciesState {
|
|
4
|
+
#private;
|
|
5
|
+
readonly existing: LoaderDependencies;
|
|
6
|
+
constructor(existing: LoaderDependencies);
|
|
7
|
+
get added(): LoaderDependencies;
|
|
8
|
+
get removed(): LoaderDependencies;
|
|
9
|
+
resetChanges(): void;
|
|
10
|
+
mergeChanges(): void;
|
|
11
|
+
addDependencies(dependencies: LoaderDependencies): void;
|
|
12
|
+
addFile(dependency: string): void;
|
|
13
|
+
addContext(dependency: string): void;
|
|
14
|
+
addMissing(dependency: string): void;
|
|
15
|
+
addBuild(dependency: string): void;
|
|
16
|
+
fileDependencies(): string[];
|
|
17
|
+
contextDependencies(): string[];
|
|
18
|
+
missingDependencies(): string[];
|
|
19
|
+
clearDependencies(): void;
|
|
20
|
+
private add;
|
|
21
|
+
private get;
|
|
22
|
+
private clear;
|
|
23
|
+
}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { type JsLoaderContext, type JsLoaderItem } from '@rspack/binding';
|
|
2
|
-
import type { Compiler } from '../Compiler';
|
|
2
|
+
import type { Compiler } from '../Compiler.js';
|
|
3
|
+
type LoaderObjectOptions = string | (object & {
|
|
4
|
+
ident?: unknown;
|
|
5
|
+
}) | null;
|
|
3
6
|
export declare class LoaderObject {
|
|
4
7
|
request: string;
|
|
5
8
|
path: string;
|
|
6
9
|
query: string;
|
|
7
10
|
fragment: string;
|
|
8
|
-
options?:
|
|
9
|
-
ident: string;
|
|
10
|
-
normal?: Function;
|
|
11
|
-
pitch?: Function;
|
|
12
|
-
raw?: boolean;
|
|
11
|
+
options?: LoaderObjectOptions;
|
|
12
|
+
ident: string | null;
|
|
13
|
+
normal?: Function | null;
|
|
14
|
+
pitch?: Function | null;
|
|
15
|
+
raw?: boolean | null;
|
|
13
16
|
type?: 'module' | 'commonjs';
|
|
14
17
|
parallel?: boolean | {
|
|
15
18
|
maxWorkers?: number;
|
|
@@ -29,8 +32,4 @@ export declare class LoaderObject {
|
|
|
29
32
|
static __to_binding(loader: LoaderObject): JsLoaderItem;
|
|
30
33
|
}
|
|
31
34
|
export declare function runLoaders(compiler: Compiler, context: JsLoaderContext): Promise<JsLoaderContext>;
|
|
32
|
-
export
|
|
33
|
-
path: string;
|
|
34
|
-
query: string;
|
|
35
|
-
fragment: string;
|
|
36
|
-
};
|
|
35
|
+
export {};
|
|
@@ -7,6 +7,6 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/loader-runner/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import type { Compiler } from '../exports';
|
|
11
|
-
import type { LoaderObject } from '.';
|
|
10
|
+
import type { Compiler } from '../exports.js';
|
|
11
|
+
import type { LoaderObject } from './index.js';
|
|
12
12
|
export default function loadLoader(loader: LoaderObject, compiler: Compiler, callback: (err: unknown) => void): void;
|
|
@@ -43,6 +43,8 @@ export declare enum RequestType {
|
|
|
43
43
|
GetContextDependencies = "GetContextDependencies",
|
|
44
44
|
GetMissingDependencies = "GetMissingDependencies",
|
|
45
45
|
ClearDependencies = "ClearDependencies",
|
|
46
|
+
BeginDependencyChanges = "BeginDependencyChanges",
|
|
47
|
+
MergeDependencyChanges = "MergeDependencyChanges",
|
|
46
48
|
Resolve = "Resolve",
|
|
47
49
|
GetResolve = "GetResolve",
|
|
48
50
|
GetLogger = "GetLogger",
|
|
@@ -53,6 +55,9 @@ export declare enum RequestType {
|
|
|
53
55
|
SetCacheable = "SetCacheable",
|
|
54
56
|
ImportModule = "ImportModule",
|
|
55
57
|
UpdateLoaderObjects = "UpdateLoaderObjects",
|
|
58
|
+
UpdateBuildInfo = "UpdateBuildInfo",
|
|
59
|
+
LoaderCacheGet = "LoaderCacheGet",
|
|
60
|
+
LoaderCacheStore = "LoaderCacheStore",
|
|
56
61
|
CompilationGetPath = "CompilationGetPath",
|
|
57
62
|
CompilationGetPathWithInfo = "CompilationGetPathWithInfo",
|
|
58
63
|
CompilationGetAssetPath = "CompilationGetAssetPath",
|
|
@@ -63,8 +68,12 @@ export declare enum RequestSyncType {
|
|
|
63
68
|
}
|
|
64
69
|
export type HandleIncomingRequest = (requestType: RequestType, ...args: any[]) => any;
|
|
65
70
|
type WorkerArgs = any[];
|
|
66
|
-
export type WorkerError = Error
|
|
71
|
+
export type WorkerError = Error & {
|
|
72
|
+
__internal__isAggregateError?: boolean;
|
|
73
|
+
errors?: unknown;
|
|
74
|
+
};
|
|
67
75
|
export declare function serializeError(error: unknown): WorkerError;
|
|
76
|
+
export declare function deserializeError(error: WorkerError): WorkerError;
|
|
68
77
|
export declare const run: (loaderName: string, task: any, options: RunOptions & {
|
|
69
78
|
handleIncomingRequest: HandleIncomingRequest;
|
|
70
79
|
}, workerOptions?: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { LoaderContext } from '../config/adapterRuleUse';
|
|
2
|
-
import type { Compiler } from '../exports';
|
|
3
|
-
import type { LoaderObject } from '.';
|
|
1
|
+
import type { LoaderContext } from '../config/adapterRuleUse.js';
|
|
2
|
+
import type { Compiler } from '../exports.js';
|
|
3
|
+
import type { LoaderObject } from './index.js';
|
|
4
4
|
export declare function convertArgs(args: any[], raw: boolean): void;
|
|
5
5
|
export declare const loadLoader: (loaderObject: LoaderObject, compiler: Compiler) => Promise<void>;
|
|
6
6
|
export declare const runSyncOrAsync: (arg1: Function, arg2: LoaderContext<{}>, arg3: any[]) => Promise<any[]>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type MessagePort } from 'node:worker_threads';
|
|
2
2
|
import { JsLoaderState } from '@rspack/binding';
|
|
3
|
-
import type { LoaderContext } from '../config';
|
|
3
|
+
import type { LoaderContext } from '../config/index.js';
|
|
4
4
|
interface WorkerOptions {
|
|
5
5
|
loaderContext: LoaderContext;
|
|
6
6
|
loaderState: JsLoaderState;
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import type { FilterTypes } from '../config';
|
|
11
|
-
import { type LogTypeEnum } from './Logger';
|
|
10
|
+
import type { FilterTypes } from '../config/index.js';
|
|
11
|
+
import { type LogTypeEnum } from './Logger.js';
|
|
12
12
|
export type FilterFunction = (ident: string) => boolean;
|
|
13
13
|
export type LoggerConsole = {
|
|
14
14
|
clear: () => void;
|
package/dist/l~0.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var modules = {}, moduleCache = {};
|
|
2
|
+
function rspackRequire(moduleId) {
|
|
3
|
+
var cachedModule = moduleCache[moduleId];
|
|
4
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
5
|
+
var module = moduleCache[moduleId] = {
|
|
6
|
+
exports: {}
|
|
7
|
+
};
|
|
8
|
+
return modules[moduleId](module, module.exports, rspackRequire), module.exports;
|
|
9
|
+
}
|
|
10
|
+
var moduleFactories = modules, compatGetDefaultExport = (module)=>{
|
|
11
|
+
var getter = module && module.__esModule ? ()=>module.default : ()=>module;
|
|
12
|
+
return definePropertyGetters(getter, {
|
|
13
|
+
a: getter
|
|
14
|
+
}), getter;
|
|
15
|
+
}, definePropertyGetters = (exports, getters, values)=>{
|
|
16
|
+
var define = (defs, kind)=>{
|
|
17
|
+
for(var key in defs)hasOwnProperty(defs, key) && !hasOwnProperty(exports, key) && Object.defineProperty(exports, key, {
|
|
18
|
+
enumerable: !0,
|
|
19
|
+
[kind]: defs[key]
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
define(getters, "get"), define(values, "value");
|
|
23
|
+
};
|
|
24
|
+
moduleFactories.add = function(modules) {
|
|
25
|
+
Object.assign(moduleFactories, modules);
|
|
26
|
+
};
|
|
27
|
+
var hasOwnProperty = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop), makeNamespaceObject = (exports)=>{
|
|
28
|
+
"u" > typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports, Symbol.toStringTag, {
|
|
29
|
+
value: 'Module'
|
|
30
|
+
}), Object.defineProperty(exports, '__esModule', {
|
|
31
|
+
value: !0
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
export { rspackRequire, moduleFactories, compatGetDefaultExport, definePropertyGetters, makeNamespaceObject };
|
package/dist/l~3.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var modules = {}, moduleCache = {};
|
|
2
|
+
function rspackRequire(moduleId) {
|
|
3
|
+
var cachedModule = moduleCache[moduleId];
|
|
4
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
5
|
+
var module = moduleCache[moduleId] = {
|
|
6
|
+
exports: {}
|
|
7
|
+
};
|
|
8
|
+
return modules[moduleId](module, module.exports, rspackRequire), module.exports;
|
|
9
|
+
}
|
|
10
|
+
var moduleFactories = modules, compatGetDefaultExport = (module)=>{
|
|
11
|
+
var getter = module && module.__esModule ? ()=>module.default : ()=>module;
|
|
12
|
+
return definePropertyGetters(getter, {
|
|
13
|
+
a: getter
|
|
14
|
+
}), getter;
|
|
15
|
+
}, definePropertyGetters = (exports, getters, values)=>{
|
|
16
|
+
var define = (defs, kind)=>{
|
|
17
|
+
for(var key in defs)hasOwnProperty(defs, key) && !hasOwnProperty(exports, key) && Object.defineProperty(exports, key, {
|
|
18
|
+
enumerable: !0,
|
|
19
|
+
[kind]: defs[key]
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
define(getters, "get"), define(values, "value");
|
|
23
|
+
};
|
|
24
|
+
moduleFactories.add = function(modules) {
|
|
25
|
+
Object.assign(moduleFactories, modules);
|
|
26
|
+
};
|
|
27
|
+
var hasOwnProperty = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop), makeNamespaceObject = (exports)=>{
|
|
28
|
+
"u" > typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports, Symbol.toStringTag, {
|
|
29
|
+
value: 'Module'
|
|
30
|
+
}), Object.defineProperty(exports, '__esModule', {
|
|
31
|
+
value: !0
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
export { rspackRequire, moduleFactories, compatGetDefaultExport, definePropertyGetters, makeNamespaceObject };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __module_federation_bundler_runtime__,__module_federation_runtime_plugins__,__module_federation_remote_infos__,__module_federation_container_name__,__module_federation_share_strategy__;
|
|
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})}}}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Compiler } from '
|
|
2
|
-
import type { InfrastructureLogging } from '../config';
|
|
1
|
+
import type { Compiler } from '../index.js';
|
|
2
|
+
import type { InfrastructureLogging } from '../config/index.js';
|
|
3
3
|
export interface NodeEnvironmentPluginOptions {
|
|
4
4
|
infrastructureLogging: InfrastructureLogging;
|
|
5
5
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import type { Compiler } from '../Compiler';
|
|
10
|
+
import type { Compiler } from '../Compiler.js';
|
|
11
11
|
export type NodeTemplatePluginOptions = {
|
|
12
12
|
asyncChunkLoading?: boolean;
|
|
13
13
|
};
|
|
@@ -7,12 +7,24 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import type Watchpack from '../../compiled/watchpack';
|
|
11
|
-
import type { FileSystemInfoEntry, InputFileSystem, Watcher, WatchFileSystem } from '../util/fs';
|
|
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>;
|
|
12
13
|
export default class NodeWatchFileSystem implements WatchFileSystem {
|
|
14
|
+
#private;
|
|
13
15
|
inputFileSystem: InputFileSystem;
|
|
14
16
|
watcherOptions: Watchpack.WatchOptions;
|
|
15
|
-
watcher?:
|
|
17
|
+
watcher?: WatchpackInstance;
|
|
16
18
|
constructor(inputFileSystem: InputFileSystem);
|
|
17
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;
|
|
18
29
|
}
|
|
30
|
+
export {};
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import type { LoggerConsole } from '../logging/createConsoleLogger';
|
|
10
|
+
import type { LoggerConsole } from '../logging/createConsoleLogger.js';
|
|
11
11
|
export default function ({ colors, appendOnly, stream, }: {
|
|
12
12
|
colors?: boolean;
|
|
13
13
|
appendOnly?: boolean;
|
package/dist/rspack.d.ts
CHANGED
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import type { Callback } from '
|
|
11
|
-
import { Compiler } from './Compiler';
|
|
12
|
-
import { type RspackOptions } from './config';
|
|
13
|
-
import { MultiCompiler, type MultiRspackOptions } from './MultiCompiler';
|
|
14
|
-
import MultiStats from './MultiStats';
|
|
15
|
-
import { Stats } from './Stats';
|
|
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
16
|
declare function createMultiCompiler(options: MultiRspackOptions): MultiCompiler;
|
|
17
|
-
declare function createCompiler(userOptions: RspackOptions): Compiler;
|
|
17
|
+
declare function createCompiler(userOptions: RspackOptions, compilerIndex?: number): Compiler;
|
|
18
18
|
declare function rspack(options: MultiRspackOptions): MultiCompiler;
|
|
19
19
|
declare function rspack(options: RspackOptions): Compiler;
|
|
20
20
|
declare function rspack(options: MultiRspackOptions | RspackOptions): MultiCompiler | Compiler;
|
|
@@ -22,4 +22,3 @@ declare function rspack(options: MultiRspackOptions, callback?: Callback<Error,
|
|
|
22
22
|
declare function rspack(options: RspackOptions, callback?: Callback<Error, Stats>): null | Compiler;
|
|
23
23
|
declare function rspack(options: MultiRspackOptions | RspackOptions, callback?: Callback<Error, MultiStats | Stats>): null | MultiCompiler | Compiler;
|
|
24
24
|
export { createCompiler, createMultiCompiler, MultiStats, rspack, Stats };
|
|
25
|
-
export default rspack;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare function normalizeUrl(url: string): string;
|
|
2
|
-
|
|
3
|
-
declare function cssReload(moduleId: string, options: Record<string, any>):
|
|
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
4
|
export { cssReload };
|