@ohos-ports/rspack-core 1.7.11-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +15 -0
- package/compiled/@swc/types/index.d.ts +2134 -0
- package/compiled/@swc/types/index.js +19 -0
- package/compiled/@swc/types/license +201 -0
- package/compiled/@swc/types/package.json +1 -0
- package/compiled/browserslist-load-config/index.d.ts +21 -0
- package/compiled/browserslist-load-config/index.js +252 -0
- package/compiled/browserslist-load-config/license +21 -0
- package/compiled/browserslist-load-config/package.json +1 -0
- package/compiled/tinypool/LICENSE +24 -0
- package/compiled/tinypool/README.md +20 -0
- package/compiled/tinypool/dist/common-Qw-RoVFD.js +28 -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 +195 -0
- package/compiled/tinypool/dist/index.js +820 -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 +39 -0
- package/compiled/watchpack/index.d.ts +217 -0
- package/compiled/watchpack/index.js +3124 -0
- package/compiled/watchpack/license +20 -0
- package/compiled/watchpack/package.json +1 -0
- package/compiled/webpack-sources/index.js +4675 -0
- package/compiled/webpack-sources/license +21 -0
- package/compiled/webpack-sources/package.json +1 -0
- package/compiled/webpack-sources/types.d.ts +458 -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 +438 -0
- package/dist/Compiler.d.ts +226 -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 +1 -0
- package/dist/FileSystem.d.ts +54 -0
- package/dist/FileSystemInfo.d.ts +5 -0
- package/dist/Module.d.ts +42 -0
- package/dist/ModuleGraph.d.ts +19 -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 +23 -0
- package/dist/NormalModule.d.ts +15 -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 +356 -0
- package/dist/RuntimeModule.d.ts +34 -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/index.d.ts +1 -0
- package/dist/builtin-loader/lightningcss/index.d.ts +117 -0
- package/dist/builtin-loader/swc/collectTypeScriptInfo.d.ts +21 -0
- package/dist/builtin-loader/swc/index.d.ts +5 -0
- package/dist/builtin-loader/swc/pluginImport.d.ts +33 -0
- package/dist/builtin-loader/swc/types.d.ts +89 -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/CircularDependencyRspackPlugin.d.ts +54 -0
- package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +9 -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/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 +7 -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 +11 -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 +12 -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/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 +15 -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 +32 -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 +11 -0
- package/dist/builtin-plugin/ProvidePlugin.d.ts +10 -0
- package/dist/builtin-plugin/RealContentHashPlugin.d.ts +9 -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 +49 -0
- package/dist/builtin-plugin/RslibPlugin.d.ts +11 -0
- package/dist/builtin-plugin/RstestPlugin.d.ts +11 -0
- package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +11 -0
- package/dist/builtin-plugin/RuntimePlugin.d.ts +29 -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 +11 -0
- package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +39 -0
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +215 -0
- package/dist/builtin-plugin/URLPlugin.d.ts +9 -0
- package/dist/builtin-plugin/WebWorkerTemplatePlugin.d.ts +7 -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 +6 -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 +82 -0
- package/dist/builtin-plugin/html-plugin/plugin.d.ts +24 -0
- package/dist/builtin-plugin/html-plugin/taps.d.ts +2 -0
- package/dist/builtin-plugin/index.d.ts +84 -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/config/adapter.d.ts +8 -0
- package/dist/config/adapterRuleUse.d.ts +391 -0
- package/dist/config/browserslistTargetHandler.d.ts +15 -0
- package/dist/config/defaults.d.ts +13 -0
- package/dist/config/devServer.d.ts +314 -0
- package/dist/config/index.d.ts +5 -0
- package/dist/config/normalization.d.ts +174 -0
- package/dist/config/target.d.ts +93 -0
- package/dist/config/types.d.ts +2432 -0
- package/dist/container/ContainerPlugin.d.ts +41 -0
- package/dist/container/ContainerReferencePlugin.d.ts +34 -0
- package/dist/container/ModuleFederationManifestPlugin.d.ts +37 -0
- package/dist/container/ModuleFederationPlugin.d.ts +17 -0
- package/dist/container/ModuleFederationPluginV1.d.ts +22 -0
- package/dist/container/ModuleFederationRuntimePlugin.d.ts +16 -0
- package/dist/container/index.d.ts +4 -0
- package/dist/container/options.d.ts +3 -0
- package/dist/cssExtractHmr.js +124 -0
- package/dist/cssExtractLoader.js +160 -0
- package/dist/error/ConcurrentCompilationError.d.ts +14 -0
- package/dist/exports.d.ts +178 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +12638 -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 +40 -0
- package/dist/lib/IgnoreWarningsPlugin.d.ts +25 -0
- package/dist/lib/LoaderOptionsPlugin.d.ts +28 -0
- package/dist/lib/LoaderTargetPlugin.d.ts +24 -0
- package/dist/lib/ModuleFilenameHelpers.d.ts +53 -0
- package/dist/lib/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 +17 -0
- package/dist/loader-runner/LoaderLoadingError.d.ts +13 -0
- package/dist/loader-runner/ModuleError.d.ts +13 -0
- package/dist/loader-runner/index.d.ts +36 -0
- package/dist/loader-runner/loadLoader.d.ts +12 -0
- package/dist/loader-runner/service.d.ts +73 -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 +18 -0
- package/dist/node/nodeConsole.d.ts +15 -0
- package/dist/rspack.d.ts +25 -0
- package/dist/rspackOptionsApply.d.ts +4 -0
- package/dist/runtime/cssExtractHmr.d.ts +4 -0
- package/dist/runtime/moduleFederationDefaultRuntime.d.ts +2 -0
- package/dist/sharing/ConsumeSharedPlugin.d.ts +42 -0
- package/dist/sharing/ProvideSharedPlugin.d.ts +35 -0
- package/dist/sharing/SharePlugin.d.ts +53 -0
- package/dist/sharing/ShareRuntimePlugin.d.ts +9 -0
- package/dist/sharing/utils.d.ts +1 -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 +341 -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/index.d.ts +6 -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 +46 -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 +14 -0
- package/dist/util/fs.d.ts +375 -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 +31 -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/validateConfig.d.ts +5 -0
- package/dist/worker.js +978 -0
- package/hot/dev-server.js +75 -0
- package/hot/emitter.js +21 -0
- package/hot/lazy-compilation-node.js +106 -0
- package/hot/lazy-compilation-web.js +98 -0
- package/hot/log-apply-result.js +49 -0
- package/hot/log.js +79 -0
- package/hot/only-dev-server.js +103 -0
- package/hot/poll.js +40 -0
- package/hot/signal.js +66 -0
- package/module.d.ts +273 -0
- package/package.json +79 -0
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/blob/v5.88.2/lib/RuntimeGlobals.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 { JsRuntimeGlobals } from '@rspack/binding';
|
|
11
|
+
import type { RspackOptionsNormalized } from './config';
|
|
12
|
+
export declare function __from_binding_runtime_globals(runtimeRequirements: JsRuntimeGlobals, compilerRuntimeGlobals: Record<string, string>): Set<string>;
|
|
13
|
+
export declare function __to_binding_runtime_globals(runtimeRequirements: Set<string>, compilerRuntimeGlobals: Record<string, string>): JsRuntimeGlobals;
|
|
14
|
+
declare enum RuntimeGlobals {
|
|
15
|
+
/**
|
|
16
|
+
* the internal require function
|
|
17
|
+
*/
|
|
18
|
+
require = 0,
|
|
19
|
+
/**
|
|
20
|
+
* access to properties of the internal require function/object
|
|
21
|
+
*/
|
|
22
|
+
requireScope = 1,
|
|
23
|
+
/**
|
|
24
|
+
* the internal exports object
|
|
25
|
+
*/
|
|
26
|
+
exports = 2,
|
|
27
|
+
/**
|
|
28
|
+
* top-level this need to be the exports object
|
|
29
|
+
*/
|
|
30
|
+
thisAsExports = 3,
|
|
31
|
+
/**
|
|
32
|
+
* runtime need to return the exports of the last entry module
|
|
33
|
+
*/
|
|
34
|
+
returnExportsFromRuntime = 4,
|
|
35
|
+
/**
|
|
36
|
+
* the internal module object
|
|
37
|
+
*/
|
|
38
|
+
module = 5,
|
|
39
|
+
/**
|
|
40
|
+
* the internal module object
|
|
41
|
+
*/
|
|
42
|
+
moduleId = 6,
|
|
43
|
+
/**
|
|
44
|
+
* the internal module object
|
|
45
|
+
*/
|
|
46
|
+
moduleLoaded = 7,
|
|
47
|
+
/**
|
|
48
|
+
* the bundle public path
|
|
49
|
+
*/
|
|
50
|
+
publicPath = 8,
|
|
51
|
+
/**
|
|
52
|
+
* the module id of the entry point
|
|
53
|
+
*/
|
|
54
|
+
entryModuleId = 9,
|
|
55
|
+
/**
|
|
56
|
+
* the module cache
|
|
57
|
+
*/
|
|
58
|
+
moduleCache = 10,
|
|
59
|
+
/**
|
|
60
|
+
* the module functions
|
|
61
|
+
*/
|
|
62
|
+
moduleFactories = 11,
|
|
63
|
+
/**
|
|
64
|
+
* the module functions, with only write access
|
|
65
|
+
*/
|
|
66
|
+
moduleFactoriesAddOnly = 12,
|
|
67
|
+
/**
|
|
68
|
+
* the chunk ensure function
|
|
69
|
+
*/
|
|
70
|
+
ensureChunk = 13,
|
|
71
|
+
/**
|
|
72
|
+
* an object with handlers to ensure a chunk
|
|
73
|
+
*/
|
|
74
|
+
ensureChunkHandlers = 14,
|
|
75
|
+
/**
|
|
76
|
+
* a runtime requirement if ensureChunkHandlers should include loading of chunk needed for entries
|
|
77
|
+
*/
|
|
78
|
+
ensureChunkIncludeEntries = 15,
|
|
79
|
+
/**
|
|
80
|
+
* the chunk prefetch function
|
|
81
|
+
*/
|
|
82
|
+
prefetchChunk = 16,
|
|
83
|
+
/**
|
|
84
|
+
* an object with handlers to prefetch a chunk
|
|
85
|
+
*/
|
|
86
|
+
prefetchChunkHandlers = 17,
|
|
87
|
+
/**
|
|
88
|
+
* the chunk preload function
|
|
89
|
+
*/
|
|
90
|
+
preloadChunk = 18,
|
|
91
|
+
/**
|
|
92
|
+
* an object with handlers to preload a chunk
|
|
93
|
+
*/
|
|
94
|
+
preloadChunkHandlers = 19,
|
|
95
|
+
/**
|
|
96
|
+
* the exported property define getters function
|
|
97
|
+
*/
|
|
98
|
+
definePropertyGetters = 20,
|
|
99
|
+
/**
|
|
100
|
+
* define compatibility on export
|
|
101
|
+
*/
|
|
102
|
+
makeNamespaceObject = 21,
|
|
103
|
+
/**
|
|
104
|
+
* create a fake namespace object
|
|
105
|
+
*/
|
|
106
|
+
createFakeNamespaceObject = 22,
|
|
107
|
+
/**
|
|
108
|
+
* compatibility get default export
|
|
109
|
+
*/
|
|
110
|
+
compatGetDefaultExport = 23,
|
|
111
|
+
/**
|
|
112
|
+
* ES modules decorator
|
|
113
|
+
*/
|
|
114
|
+
harmonyModuleDecorator = 24,
|
|
115
|
+
/**
|
|
116
|
+
* node.js module decorator
|
|
117
|
+
*/
|
|
118
|
+
nodeModuleDecorator = 25,
|
|
119
|
+
/**
|
|
120
|
+
* the webpack hash
|
|
121
|
+
*/
|
|
122
|
+
getFullHash = 26,
|
|
123
|
+
/**
|
|
124
|
+
* an object containing all installed WebAssembly.Instance export objects keyed by module id
|
|
125
|
+
*/
|
|
126
|
+
wasmInstances = 27,
|
|
127
|
+
/**
|
|
128
|
+
* instantiate a wasm instance from module exports object, id, hash and importsObject
|
|
129
|
+
*/
|
|
130
|
+
instantiateWasm = 28,
|
|
131
|
+
/**
|
|
132
|
+
* the uncaught error handler for the webpack runtime
|
|
133
|
+
*/
|
|
134
|
+
uncaughtErrorHandler = 29,
|
|
135
|
+
/**
|
|
136
|
+
* the script nonce
|
|
137
|
+
*/
|
|
138
|
+
scriptNonce = 30,
|
|
139
|
+
/**
|
|
140
|
+
* function to load a script tag.
|
|
141
|
+
* Arguments: (url: string, done: (event) =\> void), key?: string | number, chunkId?: string | number) =\> void
|
|
142
|
+
* done function is called when loading has finished or timeout occurred.
|
|
143
|
+
* It will attach to existing script tags with data-webpack == uniqueName + ":" + key or src == url.
|
|
144
|
+
*/
|
|
145
|
+
loadScript = 31,
|
|
146
|
+
/**
|
|
147
|
+
* function to promote a string to a TrustedScript using webpack's Trusted
|
|
148
|
+
* Types policy
|
|
149
|
+
* Arguments: (script: string) =\> TrustedScript
|
|
150
|
+
*/
|
|
151
|
+
createScript = 32,
|
|
152
|
+
/**
|
|
153
|
+
* function to promote a string to a TrustedScriptURL using webpack's Trusted
|
|
154
|
+
* Types policy
|
|
155
|
+
* Arguments: (url: string) =\> TrustedScriptURL
|
|
156
|
+
*/
|
|
157
|
+
createScriptUrl = 33,
|
|
158
|
+
/**
|
|
159
|
+
* function to return webpack's Trusted Types policy
|
|
160
|
+
* Arguments: () =\> TrustedTypePolicy
|
|
161
|
+
*/
|
|
162
|
+
getTrustedTypesPolicy = 34,
|
|
163
|
+
/**
|
|
164
|
+
* a flag when a chunk has a fetch priority
|
|
165
|
+
*/
|
|
166
|
+
hasFetchPriority = 35,
|
|
167
|
+
/**
|
|
168
|
+
* the chunk name of the chunk with the runtime
|
|
169
|
+
*/
|
|
170
|
+
chunkName = 36,
|
|
171
|
+
/**
|
|
172
|
+
* the runtime id of the current runtime
|
|
173
|
+
*/
|
|
174
|
+
runtimeId = 37,
|
|
175
|
+
/**
|
|
176
|
+
* the filename of the script part of the chunk
|
|
177
|
+
*/
|
|
178
|
+
getChunkScriptFilename = 38,
|
|
179
|
+
/**
|
|
180
|
+
* the filename of the css part of the chunk
|
|
181
|
+
*/
|
|
182
|
+
getChunkCssFilename = 39,
|
|
183
|
+
/**
|
|
184
|
+
* rspack version
|
|
185
|
+
* @internal
|
|
186
|
+
*/
|
|
187
|
+
rspackVersion = 40,
|
|
188
|
+
/**
|
|
189
|
+
* a flag when a module/chunk/tree has css modules
|
|
190
|
+
*/
|
|
191
|
+
hasCssModules = 41,
|
|
192
|
+
/**
|
|
193
|
+
* rspack unique id
|
|
194
|
+
* @internal
|
|
195
|
+
*/
|
|
196
|
+
rspackUniqueId = 42,
|
|
197
|
+
/**
|
|
198
|
+
* the filename of the script part of the hot update chunk
|
|
199
|
+
*/
|
|
200
|
+
getChunkUpdateScriptFilename = 43,
|
|
201
|
+
/**
|
|
202
|
+
* the filename of the css part of the hot update chunk
|
|
203
|
+
*/
|
|
204
|
+
getChunkUpdateCssFilename = 44,
|
|
205
|
+
/**
|
|
206
|
+
* startup signal from runtime
|
|
207
|
+
* This will be called when the runtime chunk has been loaded.
|
|
208
|
+
*/
|
|
209
|
+
startup = 45,
|
|
210
|
+
/**
|
|
211
|
+
* @deprecated
|
|
212
|
+
* creating a default startup function with the entry modules
|
|
213
|
+
*/
|
|
214
|
+
startupNoDefault = 46,
|
|
215
|
+
/**
|
|
216
|
+
* startup signal from runtime but only used to add logic after the startup
|
|
217
|
+
*/
|
|
218
|
+
startupOnlyAfter = 47,
|
|
219
|
+
/**
|
|
220
|
+
* startup signal from runtime but only used to add sync logic before the startup
|
|
221
|
+
*/
|
|
222
|
+
startupOnlyBefore = 48,
|
|
223
|
+
/**
|
|
224
|
+
* global callback functions for installing chunks
|
|
225
|
+
*/
|
|
226
|
+
chunkCallback = 49,
|
|
227
|
+
/**
|
|
228
|
+
* method to startup an entrypoint with needed chunks.
|
|
229
|
+
* Signature: (moduleId: Id, chunkIds: Id[]) =\> any.
|
|
230
|
+
* Returns the exports of the module or a Promise
|
|
231
|
+
*/
|
|
232
|
+
startupEntrypoint = 50,
|
|
233
|
+
/**
|
|
234
|
+
* startup signal from runtime for chunk dependencies
|
|
235
|
+
*/
|
|
236
|
+
startupChunkDependencies = 51,
|
|
237
|
+
/**
|
|
238
|
+
* register deferred code, which will run when certain
|
|
239
|
+
* chunks are loaded.
|
|
240
|
+
* Signature: (chunkIds: Id[], fn: () =\> any, priority: int \>= 0 = 0) =\> any
|
|
241
|
+
* Returned value will be returned directly when all chunks are already loaded
|
|
242
|
+
* When (priority & 1) it will wait for all other handlers with lower priority to
|
|
243
|
+
* be executed before itself is executed
|
|
244
|
+
*/
|
|
245
|
+
onChunksLoaded = 52,
|
|
246
|
+
/**
|
|
247
|
+
* method to install a chunk that was loaded somehow
|
|
248
|
+
* Signature: (\{ id, ids, modules, runtime \}) =\> void
|
|
249
|
+
*/
|
|
250
|
+
externalInstallChunk = 53,
|
|
251
|
+
/**
|
|
252
|
+
* interceptor for module executions
|
|
253
|
+
*/
|
|
254
|
+
interceptModuleExecution = 54,
|
|
255
|
+
/**
|
|
256
|
+
* the global object
|
|
257
|
+
*/
|
|
258
|
+
global = 55,
|
|
259
|
+
/**
|
|
260
|
+
* an object with all share scopes
|
|
261
|
+
*/
|
|
262
|
+
shareScopeMap = 56,
|
|
263
|
+
/**
|
|
264
|
+
* The sharing init sequence function (only runs once per share scope).
|
|
265
|
+
* Has one argument, the name of the share scope.
|
|
266
|
+
* Creates a share scope if not existing
|
|
267
|
+
*/
|
|
268
|
+
initializeSharing = 57,
|
|
269
|
+
/**
|
|
270
|
+
* The current scope when getting a module from a remote
|
|
271
|
+
*/
|
|
272
|
+
currentRemoteGetScope = 58,
|
|
273
|
+
/**
|
|
274
|
+
* the filename of the HMR manifest
|
|
275
|
+
*/
|
|
276
|
+
getUpdateManifestFilename = 59,
|
|
277
|
+
/**
|
|
278
|
+
* function downloading the update manifest
|
|
279
|
+
*/
|
|
280
|
+
hmrDownloadManifest = 60,
|
|
281
|
+
/**
|
|
282
|
+
* array with handler functions to download chunk updates
|
|
283
|
+
*/
|
|
284
|
+
hmrDownloadUpdateHandlers = 61,
|
|
285
|
+
/**
|
|
286
|
+
* object with all hmr module data for all modules
|
|
287
|
+
*/
|
|
288
|
+
hmrModuleData = 62,
|
|
289
|
+
/**
|
|
290
|
+
* array with handler functions when a module should be invalidated
|
|
291
|
+
*/
|
|
292
|
+
hmrInvalidateModuleHandlers = 63,
|
|
293
|
+
/**
|
|
294
|
+
* the prefix for storing state of runtime modules when hmr is enabled
|
|
295
|
+
*/
|
|
296
|
+
hmrRuntimeStatePrefix = 64,
|
|
297
|
+
/**
|
|
298
|
+
* the AMD define function
|
|
299
|
+
*/
|
|
300
|
+
amdDefine = 65,
|
|
301
|
+
/**
|
|
302
|
+
* the AMD options
|
|
303
|
+
*/
|
|
304
|
+
amdOptions = 66,
|
|
305
|
+
/**
|
|
306
|
+
* the System polyfill object
|
|
307
|
+
*/
|
|
308
|
+
system = 67,
|
|
309
|
+
/**
|
|
310
|
+
* the shorthand for Object.prototype.hasOwnProperty
|
|
311
|
+
* using of it decreases the compiled bundle size
|
|
312
|
+
*/
|
|
313
|
+
hasOwnProperty = 68,
|
|
314
|
+
/**
|
|
315
|
+
* the System.register context object
|
|
316
|
+
*/
|
|
317
|
+
systemContext = 69,
|
|
318
|
+
/**
|
|
319
|
+
* the baseURI of current document
|
|
320
|
+
*/
|
|
321
|
+
baseURI = 70,
|
|
322
|
+
/**
|
|
323
|
+
* a RelativeURL class when relative URLs are used
|
|
324
|
+
*/
|
|
325
|
+
relativeUrl = 71,
|
|
326
|
+
/**
|
|
327
|
+
* Creates an async module. The body function must be a async function.
|
|
328
|
+
* "module.exports" will be decorated with an AsyncModulePromise.
|
|
329
|
+
* The body function will be called.
|
|
330
|
+
* To handle async dependencies correctly do this: "([a, b, c] = await handleDependencies([a, b, c]));".
|
|
331
|
+
* If "hasAwaitAfterDependencies" is truthy, "handleDependencies()" must be called at the end of the body function.
|
|
332
|
+
* Signature: function(
|
|
333
|
+
* module: Module,
|
|
334
|
+
* body: (handleDependencies: (deps: AsyncModulePromise[]) =\> Promise\<any[]\> & () =\> void,
|
|
335
|
+
* hasAwaitAfterDependencies?: boolean
|
|
336
|
+
* ) =\> void
|
|
337
|
+
*/
|
|
338
|
+
asyncModule = 72,
|
|
339
|
+
asyncModuleExportSymbol = 73,
|
|
340
|
+
makeDeferredNamespaceObject = 74,
|
|
341
|
+
makeDeferredNamespaceObjectSymbol = 75
|
|
342
|
+
}
|
|
343
|
+
export declare const isReservedRuntimeGlobal: (r: string, compilerRuntimeGlobals: Record<string, string>) => boolean;
|
|
344
|
+
export declare function renderModulePrefix(_compilerOptions: RspackOptionsNormalized): string;
|
|
345
|
+
export declare enum RuntimeVariable {
|
|
346
|
+
Require = 0,
|
|
347
|
+
Modules = 1,
|
|
348
|
+
ModuleCache = 2,
|
|
349
|
+
Module = 3,
|
|
350
|
+
Exports = 4,
|
|
351
|
+
StartupExec = 5
|
|
352
|
+
}
|
|
353
|
+
export declare function renderRuntimeVariables(variable: RuntimeVariable, _compilerOptions?: RspackOptionsNormalized): string;
|
|
354
|
+
export declare function createCompilerRuntimeGlobals(compilerOptions?: RspackOptionsNormalized): Record<keyof typeof RuntimeGlobals, string>;
|
|
355
|
+
declare const DefaultRuntimeGlobals: Record<"publicPath" | "chunkName" | "moduleId" | "module" | "exports" | "require" | "global" | "system" | "requireScope" | "thisAsExports" | "returnExportsFromRuntime" | "moduleLoaded" | "entryModuleId" | "moduleCache" | "moduleFactories" | "moduleFactoriesAddOnly" | "ensureChunk" | "ensureChunkHandlers" | "ensureChunkIncludeEntries" | "prefetchChunk" | "prefetchChunkHandlers" | "preloadChunk" | "preloadChunkHandlers" | "definePropertyGetters" | "makeNamespaceObject" | "createFakeNamespaceObject" | "compatGetDefaultExport" | "harmonyModuleDecorator" | "nodeModuleDecorator" | "getFullHash" | "wasmInstances" | "instantiateWasm" | "uncaughtErrorHandler" | "scriptNonce" | "loadScript" | "createScript" | "createScriptUrl" | "getTrustedTypesPolicy" | "hasFetchPriority" | "runtimeId" | "getChunkScriptFilename" | "getChunkCssFilename" | "rspackVersion" | "hasCssModules" | "rspackUniqueId" | "getChunkUpdateScriptFilename" | "getChunkUpdateCssFilename" | "startup" | "startupNoDefault" | "startupOnlyAfter" | "startupOnlyBefore" | "chunkCallback" | "startupEntrypoint" | "startupChunkDependencies" | "onChunksLoaded" | "externalInstallChunk" | "interceptModuleExecution" | "shareScopeMap" | "initializeSharing" | "currentRemoteGetScope" | "getUpdateManifestFilename" | "hmrDownloadManifest" | "hmrDownloadUpdateHandlers" | "hmrModuleData" | "hmrInvalidateModuleHandlers" | "hmrRuntimeStatePrefix" | "amdDefine" | "amdOptions" | "hasOwnProperty" | "systemContext" | "baseURI" | "relativeUrl" | "asyncModule" | "asyncModuleExportSymbol" | "makeDeferredNamespaceObject" | "makeDeferredNamespaceObjectSymbol", string>;
|
|
356
|
+
export { DefaultRuntimeGlobals as RuntimeGlobals };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { JsAddingRuntimeModule, JsRuntimeModule, JsSource } from '@rspack/binding';
|
|
2
|
+
import type { Chunk } from './Chunk';
|
|
3
|
+
import type { ChunkGraph } from './ChunkGraph';
|
|
4
|
+
import type { Compilation } from './Compilation';
|
|
5
|
+
export declare enum RuntimeModuleStage {
|
|
6
|
+
NORMAL = 0,
|
|
7
|
+
BASIC = 5,
|
|
8
|
+
ATTACH = 10,
|
|
9
|
+
TRIGGER = 20
|
|
10
|
+
}
|
|
11
|
+
export declare class RuntimeModule {
|
|
12
|
+
static STAGE_NORMAL: RuntimeModuleStage;
|
|
13
|
+
static STAGE_BASIC: RuntimeModuleStage;
|
|
14
|
+
static STAGE_ATTACH: RuntimeModuleStage;
|
|
15
|
+
static STAGE_TRIGGER: RuntimeModuleStage;
|
|
16
|
+
static __to_binding(module: RuntimeModule): JsAddingRuntimeModule;
|
|
17
|
+
private _name;
|
|
18
|
+
private _stage;
|
|
19
|
+
fullHash: boolean;
|
|
20
|
+
dependentHash: boolean;
|
|
21
|
+
protected chunk: Chunk | null;
|
|
22
|
+
protected compilation: Compilation | null;
|
|
23
|
+
protected chunkGraph: ChunkGraph | null;
|
|
24
|
+
constructor(name: string, stage?: RuntimeModuleStage);
|
|
25
|
+
attach(compilation: Compilation, chunk: Chunk, chunkGraph: ChunkGraph): void;
|
|
26
|
+
get source(): JsSource | undefined;
|
|
27
|
+
get name(): string;
|
|
28
|
+
get stage(): RuntimeModuleStage;
|
|
29
|
+
identifier(): string;
|
|
30
|
+
readableIdentifier(): string;
|
|
31
|
+
shouldIsolate(): boolean;
|
|
32
|
+
generate(): string;
|
|
33
|
+
}
|
|
34
|
+
export declare function createRenderedRuntimeModule(module: JsRuntimeModule): RuntimeModule;
|
package/dist/Stats.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Compilation } from './Compilation';
|
|
2
|
+
import type { StatsOptions, StatsValue } from './config';
|
|
3
|
+
import type { StatsCompilation } from './stats/statsFactoryUtils';
|
|
4
|
+
export type { StatsAsset, StatsChunk, StatsCompilation, StatsError, StatsModule, } from './stats/statsFactoryUtils';
|
|
5
|
+
export declare class Stats {
|
|
6
|
+
#private;
|
|
7
|
+
constructor(compilation: Compilation);
|
|
8
|
+
get compilation(): Compilation;
|
|
9
|
+
get hash(): Readonly<string | null>;
|
|
10
|
+
get startTime(): number | undefined;
|
|
11
|
+
get endTime(): number | undefined;
|
|
12
|
+
hasErrors(): boolean;
|
|
13
|
+
hasWarnings(): boolean;
|
|
14
|
+
toJson(opts?: StatsValue, forToString?: boolean): StatsCompilation;
|
|
15
|
+
toString(opts?: StatsValue): string;
|
|
16
|
+
}
|
|
17
|
+
export declare function normalizeStatsPreset(options?: StatsValue): StatsOptions;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/Template.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
|
+
declare class Template {
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
* @param fn a runtime function (.runtime.js) "template"
|
|
14
|
+
* @returns the updated and normalized function string
|
|
15
|
+
*/
|
|
16
|
+
static getFunctionContent(fn: Function): string;
|
|
17
|
+
/**
|
|
18
|
+
* @param str the string converted to identifier
|
|
19
|
+
* @returns created identifier
|
|
20
|
+
*/
|
|
21
|
+
static toIdentifier(str: any): string;
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @param str string to be converted to commented in bundle code
|
|
25
|
+
* @returns returns a commented version of string
|
|
26
|
+
*/
|
|
27
|
+
static toComment(str: string): string;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @param str string to be converted to "normal comment"
|
|
31
|
+
* @returns returns a commented version of string
|
|
32
|
+
*/
|
|
33
|
+
static toNormalComment(str: string): string;
|
|
34
|
+
/**
|
|
35
|
+
* @param str string path to be normalized
|
|
36
|
+
* @returns normalized bundle-safe path
|
|
37
|
+
*/
|
|
38
|
+
static toPath(str: string): string;
|
|
39
|
+
/**
|
|
40
|
+
* @param num number to convert to ident
|
|
41
|
+
* @returns returns single character ident
|
|
42
|
+
*/
|
|
43
|
+
static numberToIdentifier(num: number): string;
|
|
44
|
+
/**
|
|
45
|
+
* @param num number to convert to ident
|
|
46
|
+
* @returns returns single character ident
|
|
47
|
+
*/
|
|
48
|
+
static numberToIdentifierContinuation(num: number): string;
|
|
49
|
+
/**
|
|
50
|
+
*
|
|
51
|
+
* @param s string to convert to identity
|
|
52
|
+
* @returns converted identity
|
|
53
|
+
*/
|
|
54
|
+
static indent(s: string | string[]): string;
|
|
55
|
+
/**
|
|
56
|
+
*
|
|
57
|
+
* @param s string to create prefix for
|
|
58
|
+
* @param prefix prefix to compose
|
|
59
|
+
* @returns returns new prefix string
|
|
60
|
+
*/
|
|
61
|
+
static prefix(s: string | string[], prefix: string): string;
|
|
62
|
+
/**
|
|
63
|
+
*
|
|
64
|
+
* @param str string or string collection
|
|
65
|
+
* @returns returns a single string from array
|
|
66
|
+
*/
|
|
67
|
+
static asString(str: string | string[]): string;
|
|
68
|
+
/**
|
|
69
|
+
* @param modules a collection of modules to get array bounds for
|
|
70
|
+
* @returns returns the upper and lower array bounds
|
|
71
|
+
* or false if not every module has a number based id
|
|
72
|
+
*/
|
|
73
|
+
static getModulesArrayBounds(modules: {
|
|
74
|
+
id: string | number;
|
|
75
|
+
}[]): [number, number] | false;
|
|
76
|
+
}
|
|
77
|
+
export { Template };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Compiler } from './Compiler';
|
|
2
|
+
export declare class VirtualModulesPlugin {
|
|
3
|
+
#private;
|
|
4
|
+
constructor(modules?: Record<string, string>);
|
|
5
|
+
apply(compiler: Compiler): void;
|
|
6
|
+
writeModule(filePath: string, contents: string): void;
|
|
7
|
+
private getVirtualFileStore;
|
|
8
|
+
static __internal__take_virtual_files(compiler: Compiler): {
|
|
9
|
+
path: string;
|
|
10
|
+
content: string;
|
|
11
|
+
}[] | undefined;
|
|
12
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/blob/4b4ca3b/lib/Watching.js
|
|
4
|
+
*
|
|
5
|
+
* MIT Licensed
|
|
6
|
+
* Author Tobias Koppers @sokra
|
|
7
|
+
* Copyright (c) JS Foundation and other contributors
|
|
8
|
+
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
|
+
*/
|
|
10
|
+
import type { Callback } from '@rspack/lite-tapable';
|
|
11
|
+
import type { Compiler } from '.';
|
|
12
|
+
import { Stats } from '.';
|
|
13
|
+
import type { WatchOptions } from './config';
|
|
14
|
+
import type { Watcher } from './util/fs';
|
|
15
|
+
export declare class Watching {
|
|
16
|
+
#private;
|
|
17
|
+
watcher?: Watcher;
|
|
18
|
+
pausedWatcher?: Watcher;
|
|
19
|
+
compiler: Compiler;
|
|
20
|
+
handler: Callback<Error, Stats>;
|
|
21
|
+
callbacks: Callback<Error, void>[];
|
|
22
|
+
watchOptions: WatchOptions;
|
|
23
|
+
lastWatcherStartTime: number;
|
|
24
|
+
running: boolean;
|
|
25
|
+
blocked: boolean;
|
|
26
|
+
isBlocked: () => boolean;
|
|
27
|
+
onChange: () => void;
|
|
28
|
+
onInvalid: () => void;
|
|
29
|
+
invalid: boolean;
|
|
30
|
+
startTime?: number;
|
|
31
|
+
suspended: boolean;
|
|
32
|
+
constructor(compiler: Compiler, watchOptions: WatchOptions, handler: Callback<Error, Stats>);
|
|
33
|
+
watch(files: Iterable<string> & {
|
|
34
|
+
added?: Iterable<string>;
|
|
35
|
+
removed?: Iterable<string>;
|
|
36
|
+
}, dirs: Iterable<string> & {
|
|
37
|
+
added?: Iterable<string>;
|
|
38
|
+
removed?: Iterable<string>;
|
|
39
|
+
}, missing: Iterable<string> & {
|
|
40
|
+
added?: Iterable<string>;
|
|
41
|
+
removed?: Iterable<string>;
|
|
42
|
+
}): void;
|
|
43
|
+
close(callback?: () => void): void;
|
|
44
|
+
invalidate(callback?: Callback<Error, void>): void;
|
|
45
|
+
/**
|
|
46
|
+
* @internal This is not a public API yet, still unstable, might change in the future
|
|
47
|
+
*/
|
|
48
|
+
invalidateWithChangesAndRemovals(changedFiles?: Set<string>, removedFiles?: Set<string>, callback?: Callback<Error, void>): void;
|
|
49
|
+
/**
|
|
50
|
+
* The reason why this is _done instead of #done, is that in Webpack,
|
|
51
|
+
* it will rewrite this function to another function
|
|
52
|
+
*/
|
|
53
|
+
private _done;
|
|
54
|
+
suspend(): void;
|
|
55
|
+
resume(): void;
|
|
56
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './swc';
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
MIT License
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2021-present Devon Govett
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
export declare function toFeatures(featureOptions: FeatureOptions): Features;
|
|
25
|
+
export declare enum Features {
|
|
26
|
+
Empty = 0,
|
|
27
|
+
Nesting = 1,
|
|
28
|
+
NotSelectorList = 2,
|
|
29
|
+
DirSelector = 4,
|
|
30
|
+
LangSelectorList = 8,
|
|
31
|
+
IsSelector = 16,
|
|
32
|
+
TextDecorationThicknessPercent = 32,
|
|
33
|
+
MediaIntervalSyntax = 64,
|
|
34
|
+
MediaRangeSyntax = 128,
|
|
35
|
+
CustomMediaQueries = 256,
|
|
36
|
+
ClampFunction = 512,
|
|
37
|
+
ColorFunction = 1024,
|
|
38
|
+
OklabColors = 2048,
|
|
39
|
+
LabColors = 4096,
|
|
40
|
+
P3Colors = 8192,
|
|
41
|
+
HexAlphaColors = 16384,
|
|
42
|
+
SpaceSeparatedColorNotation = 32768,
|
|
43
|
+
FontFamilySystemUi = 65536,
|
|
44
|
+
DoublePositionGradients = 131072,
|
|
45
|
+
VendorPrefixes = 262144,
|
|
46
|
+
LogicalProperties = 524288,
|
|
47
|
+
Selectors = 31,
|
|
48
|
+
MediaQueries = 448,
|
|
49
|
+
Color = 64512
|
|
50
|
+
}
|
|
51
|
+
export interface Targets {
|
|
52
|
+
android?: number;
|
|
53
|
+
chrome?: number;
|
|
54
|
+
edge?: number;
|
|
55
|
+
firefox?: number;
|
|
56
|
+
ie?: number;
|
|
57
|
+
ios_saf?: number;
|
|
58
|
+
opera?: number;
|
|
59
|
+
safari?: number;
|
|
60
|
+
samsung?: number;
|
|
61
|
+
}
|
|
62
|
+
export interface Drafts {
|
|
63
|
+
/** Whether to enable @custom-media rules. */
|
|
64
|
+
customMedia?: boolean;
|
|
65
|
+
}
|
|
66
|
+
export interface NonStandard {
|
|
67
|
+
/** Whether to enable the non-standard >>> and /deep/ selector combinators used by Angular and Vue. */
|
|
68
|
+
deepSelectorCombinator?: boolean;
|
|
69
|
+
}
|
|
70
|
+
export interface PseudoClasses {
|
|
71
|
+
hover?: string;
|
|
72
|
+
active?: string;
|
|
73
|
+
focus?: string;
|
|
74
|
+
focusVisible?: string;
|
|
75
|
+
focusWithin?: string;
|
|
76
|
+
}
|
|
77
|
+
export type FeatureOptions = {
|
|
78
|
+
nesting?: boolean;
|
|
79
|
+
notSelectorList?: boolean;
|
|
80
|
+
dirSelector?: boolean;
|
|
81
|
+
langSelectorList?: boolean;
|
|
82
|
+
isSelector?: boolean;
|
|
83
|
+
textDecorationThicknessPercent?: boolean;
|
|
84
|
+
mediaIntervalSyntax?: boolean;
|
|
85
|
+
mediaRangeSyntax?: boolean;
|
|
86
|
+
customMediaQueries?: boolean;
|
|
87
|
+
clampFunction?: boolean;
|
|
88
|
+
colorFunction?: boolean;
|
|
89
|
+
oklabColors?: boolean;
|
|
90
|
+
labColors?: boolean;
|
|
91
|
+
p3Colors?: boolean;
|
|
92
|
+
hexAlphaColors?: boolean;
|
|
93
|
+
spaceSeparatedColorNotation?: boolean;
|
|
94
|
+
fontFamilySystemUi?: boolean;
|
|
95
|
+
doublePositionGradients?: boolean;
|
|
96
|
+
vendorPrefixes?: boolean;
|
|
97
|
+
logicalProperties?: boolean;
|
|
98
|
+
selectors?: boolean;
|
|
99
|
+
mediaQueries?: boolean;
|
|
100
|
+
color?: boolean;
|
|
101
|
+
};
|
|
102
|
+
export type LoaderOptions = {
|
|
103
|
+
minify?: boolean;
|
|
104
|
+
errorRecovery?: boolean;
|
|
105
|
+
targets?: Targets | string[] | string;
|
|
106
|
+
include?: FeatureOptions;
|
|
107
|
+
exclude?: FeatureOptions;
|
|
108
|
+
/**
|
|
109
|
+
* @deprecated Use `drafts` instead.
|
|
110
|
+
* This will be removed in the next major version.
|
|
111
|
+
*/
|
|
112
|
+
draft?: Drafts;
|
|
113
|
+
drafts?: Drafts;
|
|
114
|
+
nonStandard?: NonStandard;
|
|
115
|
+
pseudoClasses?: PseudoClasses;
|
|
116
|
+
unusedSymbols?: string[];
|
|
117
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type CollectTypeScriptInfoOptions = {
|
|
2
|
+
/**
|
|
3
|
+
* Whether to collect type exports information for `typeReexportsPresence`.
|
|
4
|
+
* This is used to check type exports of submodules when running in `'tolerant'` mode.
|
|
5
|
+
* @default false
|
|
6
|
+
*/
|
|
7
|
+
typeExports?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Whether to collect information about exported `enum`s.
|
|
10
|
+
* - `true` will collect all `enum` information, including `const enum`s and regular `enum`s.
|
|
11
|
+
* - `false` will not collect any `enum` information.
|
|
12
|
+
* - `'const-only'` will gather only `const enum`s, enabling Rspack to perform cross-module
|
|
13
|
+
* inlining optimizations for them.
|
|
14
|
+
* @default false
|
|
15
|
+
*/
|
|
16
|
+
exportedEnum?: boolean | 'const-only';
|
|
17
|
+
};
|
|
18
|
+
export declare function resolveCollectTypeScriptInfo(options: CollectTypeScriptInfoOptions): {
|
|
19
|
+
typeExports: boolean | undefined;
|
|
20
|
+
exportedEnum: string;
|
|
21
|
+
};
|