@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,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/config/normalization.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 { HttpUriPluginOptions } from '../builtin-plugin/index.js';
|
|
11
|
+
import type { Compilation } from '../Compilation.js';
|
|
12
|
+
import type WebpackError from '../lib/WebpackError.js';
|
|
13
|
+
import type { Amd, AssetModuleFilename, Bail, BundlerInfoOptions, ChunkFilename, ChunkLoading, ChunkLoadingGlobal, Clean, Context, CrossOriginLoading, CssChunkFilename, CssFilename, Dependencies, DevServer, DevTool, DevtoolFallbackModuleFilenameTemplate, DevtoolModuleFilenameTemplate, DevtoolNamespace, EnabledLibraryTypes, EnabledWasmLoadingTypes, EntryDescription, Environment, Externals, ExternalsPresets, ExternalsType, Filename, GeneratorOptionsByModuleType, GlobalObject, HashDigest, HashDigestLength, HashFunction, HashSalt, HotUpdateChunkFilename, HotUpdateGlobal, HotUpdateMainFilename, Iife, ImportFunctionName, ImportMetaName, Incremental, InfrastructureLogging, LazyCompilationOptions, LibraryOptions, Loader, Mode, NewCache, Name, Node, NoParseOption, Optimization, OutputModule, ParserOptionsByModuleType, Path, Performance, Plugins, PublicPath, Resolve, RspackOptions, RuleSetRules, ScriptType, SourceMapFilename, StatsValue, StrictModuleErrorHandling, Target, TrustedTypes, UniqueName, WasmLoading, WasmStreamingFallback, Watch, WatchOptions, WebassemblyModuleFilename, WorkerPublicPath } from './types.js';
|
|
14
|
+
export declare const getNormalizedRspackOptions: (config: RspackOptions) => RspackOptionsNormalized;
|
|
15
|
+
export type EntryDynamicNormalized = () => Promise<EntryStaticNormalized>;
|
|
16
|
+
export type EntryNormalized = EntryDynamicNormalized | EntryStaticNormalized;
|
|
17
|
+
export interface EntryStaticNormalized {
|
|
18
|
+
[k: string]: EntryDescriptionNormalized;
|
|
19
|
+
}
|
|
20
|
+
export type EntryDescriptionNormalized = Pick<EntryDescription, 'runtime' | 'chunkLoading' | 'wasmLoading' | 'asyncChunks' | 'publicPath' | 'baseUri' | 'filename' | 'library' | 'layer'> & {
|
|
21
|
+
import?: string[];
|
|
22
|
+
dependOn?: string[];
|
|
23
|
+
};
|
|
24
|
+
export interface OutputNormalized {
|
|
25
|
+
path?: Path;
|
|
26
|
+
pathinfo?: boolean | 'verbose';
|
|
27
|
+
clean?: Clean;
|
|
28
|
+
publicPath?: PublicPath;
|
|
29
|
+
filename?: Filename;
|
|
30
|
+
chunkFilename?: ChunkFilename;
|
|
31
|
+
crossOriginLoading?: CrossOriginLoading;
|
|
32
|
+
cssFilename?: CssFilename;
|
|
33
|
+
cssChunkFilename?: CssChunkFilename;
|
|
34
|
+
hotUpdateMainFilename?: HotUpdateMainFilename;
|
|
35
|
+
hotUpdateChunkFilename?: HotUpdateChunkFilename;
|
|
36
|
+
hotUpdateGlobal?: HotUpdateGlobal;
|
|
37
|
+
assetModuleFilename?: AssetModuleFilename;
|
|
38
|
+
uniqueName?: UniqueName;
|
|
39
|
+
chunkLoadingGlobal?: ChunkLoadingGlobal;
|
|
40
|
+
enabledLibraryTypes?: EnabledLibraryTypes;
|
|
41
|
+
library?: LibraryOptions;
|
|
42
|
+
module?: OutputModule;
|
|
43
|
+
strictModuleErrorHandling?: StrictModuleErrorHandling;
|
|
44
|
+
globalObject?: GlobalObject;
|
|
45
|
+
importFunctionName?: ImportFunctionName;
|
|
46
|
+
importMetaName?: ImportMetaName;
|
|
47
|
+
iife?: Iife;
|
|
48
|
+
wasmLoading?: WasmLoading;
|
|
49
|
+
wasmStreamingFallback?: WasmStreamingFallback;
|
|
50
|
+
enabledWasmLoadingTypes?: EnabledWasmLoadingTypes;
|
|
51
|
+
webassemblyModuleFilename?: WebassemblyModuleFilename;
|
|
52
|
+
chunkFormat?: string | false;
|
|
53
|
+
chunkLoading?: string | false;
|
|
54
|
+
enabledChunkLoadingTypes?: string[];
|
|
55
|
+
trustedTypes?: TrustedTypes;
|
|
56
|
+
sourceMapFilename?: SourceMapFilename;
|
|
57
|
+
hashDigest?: HashDigest;
|
|
58
|
+
hashDigestLength?: HashDigestLength;
|
|
59
|
+
hashFunction?: HashFunction;
|
|
60
|
+
hashSalt?: HashSalt;
|
|
61
|
+
asyncChunks?: boolean;
|
|
62
|
+
workerChunkLoading?: ChunkLoading;
|
|
63
|
+
workerWasmLoading?: WasmLoading;
|
|
64
|
+
workerPublicPath?: WorkerPublicPath;
|
|
65
|
+
scriptType?: ScriptType;
|
|
66
|
+
devtoolNamespace?: DevtoolNamespace;
|
|
67
|
+
devtoolModuleFilenameTemplate?: DevtoolModuleFilenameTemplate;
|
|
68
|
+
devtoolFallbackModuleFilenameTemplate?: DevtoolFallbackModuleFilenameTemplate;
|
|
69
|
+
environment?: Environment;
|
|
70
|
+
chunkLoadTimeout?: number;
|
|
71
|
+
compareBeforeEmit?: boolean;
|
|
72
|
+
bundlerInfo?: BundlerInfoOptions;
|
|
73
|
+
}
|
|
74
|
+
export interface ModuleOptionsNormalized {
|
|
75
|
+
defaultRules?: RuleSetRules;
|
|
76
|
+
rules: RuleSetRules;
|
|
77
|
+
parser: ParserOptionsByModuleType;
|
|
78
|
+
generator: GeneratorOptionsByModuleType;
|
|
79
|
+
noParse?: NoParseOption;
|
|
80
|
+
}
|
|
81
|
+
export type CacheSnapshotNormalized = {
|
|
82
|
+
immutablePaths?: (string | RegExp)[];
|
|
83
|
+
unmanagedPaths?: (string | RegExp)[];
|
|
84
|
+
managedPaths?: (string | RegExp)[];
|
|
85
|
+
};
|
|
86
|
+
export type CacheNormalized = false | {
|
|
87
|
+
type: 'memory';
|
|
88
|
+
snapshot: CacheSnapshotNormalized;
|
|
89
|
+
} | {
|
|
90
|
+
type: 'persistent';
|
|
91
|
+
name?: string;
|
|
92
|
+
buildDependencies: string[];
|
|
93
|
+
version?: string;
|
|
94
|
+
maxAge?: number;
|
|
95
|
+
maxVersions?: number;
|
|
96
|
+
snapshot: CacheSnapshotNormalized;
|
|
97
|
+
storage: {
|
|
98
|
+
type: 'filesystem';
|
|
99
|
+
directory?: string;
|
|
100
|
+
location?: string;
|
|
101
|
+
};
|
|
102
|
+
portable?: boolean;
|
|
103
|
+
readonly?: boolean;
|
|
104
|
+
};
|
|
105
|
+
export interface ExperimentsNormalized {
|
|
106
|
+
asyncWebAssembly?: boolean;
|
|
107
|
+
css?: boolean;
|
|
108
|
+
futureDefaults?: boolean;
|
|
109
|
+
newCache?: false | NewCache;
|
|
110
|
+
buildHttp?: HttpUriPluginOptions;
|
|
111
|
+
useInputFileSystem?: false | RegExp[];
|
|
112
|
+
nativeWatcher?: boolean;
|
|
113
|
+
deferImport?: boolean;
|
|
114
|
+
sourceImport?: boolean;
|
|
115
|
+
pureFunctions?: boolean;
|
|
116
|
+
runtimeMode?: 'webpack' | 'rspack';
|
|
117
|
+
}
|
|
118
|
+
export type IgnoreWarningsNormalized = ((warning: WebpackError, compilation: Compilation) => boolean)[];
|
|
119
|
+
export type OptimizationRuntimeChunkNormalized = false | {
|
|
120
|
+
name: string | ((entrypoint: {
|
|
121
|
+
name: string;
|
|
122
|
+
}) => string);
|
|
123
|
+
};
|
|
124
|
+
export interface RspackOptionsNormalized {
|
|
125
|
+
name?: Name;
|
|
126
|
+
dependencies?: Dependencies;
|
|
127
|
+
context?: Context;
|
|
128
|
+
mode?: Mode;
|
|
129
|
+
entry: EntryNormalized;
|
|
130
|
+
output: OutputNormalized;
|
|
131
|
+
resolve: Resolve;
|
|
132
|
+
resolveLoader: Resolve;
|
|
133
|
+
module: ModuleOptionsNormalized;
|
|
134
|
+
target?: Target;
|
|
135
|
+
externals?: Externals;
|
|
136
|
+
externalsType?: ExternalsType;
|
|
137
|
+
externalsPresets: ExternalsPresets;
|
|
138
|
+
infrastructureLogging: InfrastructureLogging;
|
|
139
|
+
devtool?: DevTool;
|
|
140
|
+
node: Node;
|
|
141
|
+
loader: Loader;
|
|
142
|
+
cache?: CacheNormalized;
|
|
143
|
+
stats: StatsValue;
|
|
144
|
+
optimization: Optimization;
|
|
145
|
+
plugins: Plugins;
|
|
146
|
+
experiments: ExperimentsNormalized;
|
|
147
|
+
lazyCompilation?: false | LazyCompilationOptions;
|
|
148
|
+
incremental?: false | Incremental;
|
|
149
|
+
watch?: Watch;
|
|
150
|
+
watchOptions: WatchOptions;
|
|
151
|
+
devServer?: false | DevServer;
|
|
152
|
+
ignoreWarnings?: IgnoreWarningsNormalized;
|
|
153
|
+
performance?: Performance;
|
|
154
|
+
amd?: Amd;
|
|
155
|
+
bail?: Bail;
|
|
156
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/config/target.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 context the context directory
|
|
12
|
+
* @returns default target
|
|
13
|
+
*/
|
|
14
|
+
export declare const getDefaultTarget: (context: string) => 'browserslist' | 'web';
|
|
15
|
+
export type PlatformTargetProperties = {
|
|
16
|
+
/** web platform, importing of http(s) and std: is available */
|
|
17
|
+
web?: boolean | null;
|
|
18
|
+
/** browser platform, running in a normal web browser */
|
|
19
|
+
browser?: boolean | null;
|
|
20
|
+
/** (Web)Worker platform, running in a web/shared/service worker */
|
|
21
|
+
webworker?: boolean | null;
|
|
22
|
+
/** node platform, require of node built-in modules is available */
|
|
23
|
+
node?: boolean | null;
|
|
24
|
+
/** nwjs platform, require of legacy nw.gui is available */
|
|
25
|
+
nwjs?: boolean | null;
|
|
26
|
+
/** electron platform, require of some electron built-in modules is available */
|
|
27
|
+
electron?: boolean | null;
|
|
28
|
+
};
|
|
29
|
+
export type ElectronContextTargetProperties = {
|
|
30
|
+
/** in main context */
|
|
31
|
+
electronMain: boolean | null;
|
|
32
|
+
/** in preload context */
|
|
33
|
+
electronPreload: boolean | null;
|
|
34
|
+
/** in renderer context with node integration */
|
|
35
|
+
electronRenderer: boolean | null;
|
|
36
|
+
};
|
|
37
|
+
export type ApiTargetProperties = {
|
|
38
|
+
/** has require function available */
|
|
39
|
+
require: boolean | null;
|
|
40
|
+
/** has node.js built-in modules available */
|
|
41
|
+
nodeBuiltins: boolean | null;
|
|
42
|
+
/** node.js allows to use `node:` prefix for core modules */
|
|
43
|
+
nodePrefixForCoreModules: boolean | null;
|
|
44
|
+
/** has document available (allows script tags) */
|
|
45
|
+
document: boolean | null;
|
|
46
|
+
/** has importScripts available */
|
|
47
|
+
importScripts: boolean | null;
|
|
48
|
+
/** has importScripts available when creating a worker */
|
|
49
|
+
importScriptsInWorker: boolean | null;
|
|
50
|
+
/** node.js allows to use `import.meta.dirname` and `import.meta.filename` */
|
|
51
|
+
importMetaDirnameAndFilename: boolean | null;
|
|
52
|
+
/** has fetch function available for WebAssembly */
|
|
53
|
+
fetchWasm: boolean | null;
|
|
54
|
+
/** has global variable available */
|
|
55
|
+
global: boolean | null;
|
|
56
|
+
};
|
|
57
|
+
export type EcmaTargetProperties = {
|
|
58
|
+
/** has globalThis variable available */
|
|
59
|
+
globalThis: boolean | null;
|
|
60
|
+
/** big int literal syntax is available */
|
|
61
|
+
bigIntLiteral: boolean | null;
|
|
62
|
+
/** const and let variable declarations are available */
|
|
63
|
+
const: boolean | null;
|
|
64
|
+
/** computed property names in object literals are available */
|
|
65
|
+
computedProperty: boolean | null;
|
|
66
|
+
/** method shorthand in object is available */
|
|
67
|
+
methodShorthand: boolean | null;
|
|
68
|
+
/** arrow functions are available */
|
|
69
|
+
arrowFunction: boolean | null;
|
|
70
|
+
/** for of iteration is available */
|
|
71
|
+
forOf: boolean | null;
|
|
72
|
+
/** destructuring is available */
|
|
73
|
+
destructuring: boolean | null;
|
|
74
|
+
/** async import() is available */
|
|
75
|
+
dynamicImport: boolean | null;
|
|
76
|
+
/** async import() is available when creating a worker */
|
|
77
|
+
dynamicImportInWorker: boolean | null;
|
|
78
|
+
/** ESM syntax is available (when in module) */
|
|
79
|
+
module: boolean | null;
|
|
80
|
+
/** optional chaining is available */
|
|
81
|
+
optionalChaining: boolean | null;
|
|
82
|
+
/** logical assignment is available */
|
|
83
|
+
logicalAssignment: boolean | null;
|
|
84
|
+
/** template literal is available */
|
|
85
|
+
templateLiteral: boolean | null;
|
|
86
|
+
/** async functions and await are available */
|
|
87
|
+
asyncFunction: boolean | null;
|
|
88
|
+
};
|
|
89
|
+
export type ExtractedTargetProperties = {
|
|
90
|
+
esVersion?: number | null;
|
|
91
|
+
targets?: Record<string, string> | null;
|
|
92
|
+
};
|
|
93
|
+
type Never<T> = {
|
|
94
|
+
[P in keyof T]?: never;
|
|
95
|
+
};
|
|
96
|
+
type Mix<A, B> = (A & Never<B>) | (Never<A> & B) | (A & B);
|
|
97
|
+
export type TargetProperties = Mix<Mix<PlatformTargetProperties, ElectronContextTargetProperties>, Mix<ApiTargetProperties, EcmaTargetProperties>> & ExtractedTargetProperties;
|
|
98
|
+
export declare const getTargetProperties: (target: string, context: string) => TargetProperties;
|
|
99
|
+
export declare const getTargetsProperties: (targets: string[], context: string) => TargetProperties;
|
|
100
|
+
export {};
|