webpack 5.93.0 → 5.95.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 +8 -5
- package/bin/webpack.js +6 -7
- package/hot/log.js +1 -2
- package/hot/only-dev-server.js +1 -1
- package/hot/poll.js +1 -1
- package/hot/signal.js +1 -1
- package/lib/APIPlugin.js +4 -3
- package/lib/AbstractMethodError.js +10 -5
- package/lib/AutomaticPrefetchPlugin.js +1 -1
- package/lib/BannerPlugin.js +12 -6
- package/lib/Cache.js +8 -10
- package/lib/CacheFacade.js +3 -3
- package/lib/CaseSensitiveModulesWarning.js +5 -7
- package/lib/Chunk.js +14 -11
- package/lib/ChunkGraph.js +58 -36
- package/lib/ChunkGroup.js +2 -3
- package/lib/ChunkTemplate.js +43 -0
- package/lib/CleanPlugin.js +10 -11
- package/lib/CodeGenerationResults.js +6 -5
- package/lib/CommentCompilationWarning.js +0 -1
- package/lib/Compilation.js +223 -191
- package/lib/Compiler.js +81 -82
- package/lib/ConcatenationScope.js +3 -6
- package/lib/ConditionalInitFragment.js +6 -7
- package/lib/ConstPlugin.js +7 -15
- package/lib/ContextExclusionPlugin.js +3 -3
- package/lib/ContextModule.js +33 -20
- package/lib/ContextModuleFactory.js +89 -44
- package/lib/ContextReplacementPlugin.js +10 -9
- package/lib/DefinePlugin.js +75 -68
- package/lib/DelegatedModule.js +7 -3
- package/lib/DelegatedModuleFactoryPlugin.js +36 -22
- package/lib/DelegatedPlugin.js +4 -0
- package/lib/DependenciesBlock.js +0 -1
- package/lib/Dependency.js +10 -14
- package/lib/DllEntryPlugin.js +4 -2
- package/lib/DllModuleFactory.js +1 -0
- package/lib/DllPlugin.js +9 -7
- package/lib/DllReferencePlugin.js +30 -15
- package/lib/EntryPlugin.js +1 -3
- package/lib/EnvironmentPlugin.js +6 -2
- package/lib/ErrorHelpers.js +11 -12
- package/lib/EvalDevToolModulePlugin.js +10 -12
- package/lib/EvalSourceMapDevToolPlugin.js +15 -13
- package/lib/ExportsInfo.js +185 -120
- package/lib/ExternalModule.js +41 -15
- package/lib/ExternalModuleFactoryPlugin.js +23 -10
- package/lib/FileSystemInfo.js +791 -422
- package/lib/FlagAllModulesAsUsedPlugin.js +1 -1
- package/lib/FlagDependencyExportsPlugin.js +12 -11
- package/lib/FlagDependencyUsagePlugin.js +1 -1
- package/lib/Generator.js +2 -5
- package/lib/GraphHelpers.js +3 -2
- package/lib/HookWebpackError.js +8 -10
- package/lib/HotModuleReplacementPlugin.js +78 -64
- package/lib/IgnoreErrorModuleFactory.js +3 -3
- package/lib/IgnorePlugin.js +1 -3
- package/lib/IgnoreWarningsPlugin.js +6 -9
- package/lib/InitFragment.js +2 -3
- package/lib/LibManifestPlugin.js +4 -3
- package/lib/MainTemplate.js +72 -19
- package/lib/Module.js +25 -9
- package/lib/ModuleBuildError.js +4 -11
- package/lib/ModuleDependencyError.js +5 -5
- package/lib/ModuleDependencyWarning.js +5 -5
- package/lib/ModuleError.js +1 -5
- package/lib/ModuleFilenameHelpers.js +29 -46
- package/lib/ModuleGraph.js +7 -6
- package/lib/ModuleGraphConnection.js +6 -6
- package/lib/ModuleInfoHeaderPlugin.js +82 -30
- package/lib/ModuleParseError.js +8 -9
- package/lib/ModuleRestoreError.js +1 -1
- package/lib/ModuleStoreError.js +1 -1
- package/lib/ModuleTemplate.js +33 -1
- package/lib/ModuleTypeConstants.js +21 -22
- package/lib/ModuleWarning.js +1 -5
- package/lib/MultiCompiler.js +24 -26
- package/lib/MultiStats.js +73 -31
- package/lib/MultiWatching.js +1 -1
- package/lib/NormalModule.js +130 -69
- package/lib/NormalModuleFactory.js +53 -49
- package/lib/OptimizationStages.js +3 -3
- package/lib/ProgressPlugin.js +9 -9
- package/lib/ProvidePlugin.js +4 -4
- package/lib/RuntimeGlobals.js +71 -70
- package/lib/RuntimeModule.js +1 -1
- package/lib/RuntimePlugin.js +24 -12
- package/lib/RuntimeTemplate.js +40 -44
- package/lib/SizeFormatHelpers.js +2 -4
- package/lib/SourceMapDevToolPlugin.js +42 -34
- package/lib/Stats.js +5 -11
- package/lib/Template.js +18 -24
- package/lib/TemplatedPathPlugin.js +21 -13
- package/lib/WarnDeprecatedOptionPlugin.js +0 -1
- package/lib/WatchIgnorePlugin.js +26 -9
- package/lib/Watching.js +10 -5
- package/lib/WebpackOptionsApply.js +84 -62
- package/lib/asset/AssetGenerator.js +107 -42
- package/lib/asset/AssetModulesPlugin.js +29 -23
- package/lib/asset/AssetSourceGenerator.js +2 -7
- package/lib/async-modules/AwaitDependenciesInitFragment.js +6 -7
- package/lib/buildChunkGraph.js +93 -81
- package/lib/cache/IdleFileCachePlugin.js +4 -4
- package/lib/cache/MemoryWithGcCachePlugin.js +5 -5
- package/lib/cache/PackFileCacheStrategy.js +51 -50
- package/lib/cache/ResolverCachePlugin.js +6 -6
- package/lib/cache/mergeEtags.js +16 -21
- package/lib/cli.js +148 -104
- package/lib/config/browserslistTargetHandler.js +16 -13
- package/lib/config/defaults.js +32 -28
- package/lib/config/normalization.js +335 -344
- package/lib/config/target.js +42 -52
- package/lib/container/ContainerEntryModule.js +2 -2
- package/lib/container/ContainerPlugin.js +1 -1
- package/lib/container/RemoteRuntimeModule.js +11 -8
- package/lib/container/options.js +18 -4
- package/lib/css/CssExportsGenerator.js +26 -24
- package/lib/css/CssGenerator.js +9 -4
- package/lib/css/CssLoadingRuntimeModule.js +10 -10
- package/lib/css/CssModulesPlugin.js +127 -47
- package/lib/css/CssParser.js +20 -18
- package/lib/css/walkCssTokens.js +80 -95
- package/lib/debug/ProfilingPlugin.js +19 -20
- package/lib/dependencies/AMDDefineDependency.js +1 -1
- package/lib/dependencies/AMDDefineDependencyParserPlugin.js +83 -47
- package/lib/dependencies/AMDRequireArrayDependency.js +9 -10
- package/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +22 -16
- package/lib/dependencies/AMDRuntimeModules.js +2 -2
- package/lib/dependencies/CommonJsDependencyHelpers.js +6 -2
- package/lib/dependencies/CommonJsExportRequireDependency.js +37 -41
- package/lib/dependencies/CommonJsExportsDependency.js +0 -1
- package/lib/dependencies/CommonJsExportsParserPlugin.js +19 -23
- package/lib/dependencies/CommonJsFullRequireDependency.js +1 -1
- package/lib/dependencies/CommonJsImportsParserPlugin.js +52 -61
- package/lib/dependencies/CommonJsSelfReferenceDependency.js +6 -8
- package/lib/dependencies/ConstDependency.js +1 -1
- package/lib/dependencies/ContextDependency.js +7 -2
- package/lib/dependencies/ContextDependencyHelpers.js +31 -34
- package/lib/dependencies/ContextElementDependency.js +35 -8
- package/lib/dependencies/CriticalDependencyWarning.js +1 -1
- package/lib/dependencies/CssExportDependency.js +7 -7
- package/lib/dependencies/CssImportDependency.js +0 -2
- package/lib/dependencies/CssLocalIdentifierDependency.js +3 -3
- package/lib/dependencies/CssSelfLocalIdentifierDependency.js +2 -1
- package/lib/dependencies/CssUrlDependency.js +4 -5
- package/lib/dependencies/DynamicExports.js +5 -5
- package/lib/dependencies/ExportsInfoDependency.js +1 -2
- package/lib/dependencies/HarmonyAcceptImportDependency.js +1 -1
- package/lib/dependencies/HarmonyEvaluatedImportSpecifierDependency.js +4 -5
- package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +27 -16
- package/lib/dependencies/HarmonyExportExpressionDependency.js +1 -1
- package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +107 -64
- package/lib/dependencies/HarmonyExports.js +2 -2
- package/lib/dependencies/HarmonyImportDependency.js +2 -4
- package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +19 -4
- package/lib/dependencies/HarmonyImportSpecifierDependency.js +40 -15
- package/lib/dependencies/ImportDependency.js +1 -1
- package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +5 -5
- package/lib/dependencies/ImportMetaPlugin.js +11 -13
- package/lib/dependencies/ImportParserPlugin.js +39 -44
- package/lib/dependencies/JsonExportsDependency.js +22 -18
- package/lib/dependencies/LoaderPlugin.js +47 -36
- package/lib/dependencies/LocalModule.js +1 -1
- package/lib/dependencies/LocalModulesHelpers.js +4 -4
- package/lib/dependencies/ModuleDecoratorDependency.js +1 -1
- package/lib/dependencies/ProvidedDependency.js +1 -1
- package/lib/dependencies/PureExpressionDependency.js +6 -6
- package/lib/dependencies/RequireContextDependencyParserPlugin.js +1 -1
- package/lib/dependencies/RuntimeRequirementsDependency.js +1 -1
- package/lib/dependencies/SystemPlugin.js +1 -1
- package/lib/dependencies/URLDependency.js +3 -3
- package/lib/dependencies/URLPlugin.js +66 -12
- package/lib/dependencies/WorkerPlugin.js +25 -24
- package/lib/dependencies/processExportInfo.js +3 -1
- package/lib/electron/ElectronTargetPlugin.js +1 -0
- package/lib/esm/ModuleChunkFormatPlugin.js +3 -3
- package/lib/esm/ModuleChunkLoadingRuntimeModule.js +7 -3
- package/lib/formatLocation.js +1 -2
- package/lib/hmr/HotModuleReplacement.runtime.js +4 -5
- package/lib/hmr/HotModuleReplacementRuntimeModule.js +1 -0
- package/lib/hmr/JavascriptHotModuleReplacement.runtime.js +9 -12
- package/lib/hmr/LazyCompilationPlugin.js +27 -12
- package/lib/hmr/lazyCompilationBackend.js +64 -40
- package/lib/ids/ChunkModuleIdRangePlugin.js +1 -3
- package/lib/ids/DeterministicChunkIdsPlugin.js +2 -4
- package/lib/ids/DeterministicModuleIdsPlugin.js +1 -1
- package/lib/ids/HashedModuleIdsPlugin.js +5 -1
- package/lib/ids/IdHelpers.js +29 -39
- package/lib/ids/SyncModuleIdsPlugin.js +7 -2
- package/lib/index.js +1 -5
- package/lib/javascript/ArrayPushCallbackChunkFormatPlugin.js +5 -4
- package/lib/javascript/BasicEvaluatedExpression.js +4 -19
- package/lib/javascript/ChunkHelpers.js +1 -1
- package/lib/javascript/CommonJsChunkFormatPlugin.js +3 -2
- package/lib/javascript/EnableChunkLoadingPlugin.js +7 -6
- package/lib/javascript/JavascriptGenerator.js +23 -7
- package/lib/javascript/JavascriptModulesPlugin.js +133 -86
- package/lib/javascript/JavascriptParser.js +179 -200
- package/lib/javascript/JavascriptParserHelpers.js +20 -21
- package/lib/javascript/StartupHelpers.js +41 -13
- package/lib/json/JsonGenerator.js +7 -13
- package/lib/json/JsonModulesPlugin.js +1 -4
- package/lib/json/JsonParser.js +5 -3
- package/lib/library/AmdLibraryPlugin.js +12 -16
- package/lib/library/AssignLibraryPlugin.js +8 -10
- package/lib/library/EnableLibraryPlugin.js +15 -14
- package/lib/library/JsonpLibraryPlugin.js +2 -1
- package/lib/library/ModernModuleLibraryPlugin.js +8 -6
- package/lib/library/ModuleLibraryPlugin.js +2 -1
- package/lib/library/SystemLibraryPlugin.js +2 -1
- package/lib/library/UmdLibraryPlugin.js +66 -92
- package/lib/logging/Logger.js +32 -4
- package/lib/logging/createConsoleLogger.js +12 -13
- package/lib/logging/runtime.js +7 -8
- package/lib/logging/truncateArgs.js +5 -8
- package/lib/node/NodeWatchFileSystem.js +3 -18
- package/lib/node/ReadFileChunkLoadingRuntimeModule.js +2 -2
- package/lib/node/ReadFileCompileAsyncWasmPlugin.js +1 -0
- package/lib/node/RequireChunkLoadingRuntimeModule.js +2 -2
- package/lib/node/nodeConsole.js +22 -22
- package/lib/optimize/AggressiveMergingPlugin.js +2 -4
- package/lib/optimize/AggressiveSplittingPlugin.js +16 -19
- package/lib/optimize/ConcatenatedModule.js +81 -51
- package/lib/optimize/EnsureChunkConditionsPlugin.js +1 -1
- package/lib/optimize/FlagIncludedChunksPlugin.js +3 -3
- package/lib/optimize/InnerGraph.js +17 -17
- package/lib/optimize/InnerGraphPlugin.js +8 -7
- package/lib/optimize/LimitChunkCountPlugin.js +2 -3
- package/lib/optimize/MangleExportsPlugin.js +1 -0
- package/lib/optimize/MergeDuplicateChunksPlugin.js +2 -2
- package/lib/optimize/MinMaxSizeWarning.js +1 -1
- package/lib/optimize/ModuleConcatenationPlugin.js +54 -78
- package/lib/optimize/RealContentHashPlugin.js +7 -10
- package/lib/optimize/RemoveParentModulesPlugin.js +3 -3
- package/lib/optimize/SideEffectsFlagPlugin.js +6 -2
- package/lib/optimize/SplitChunksPlugin.js +34 -30
- package/lib/performance/SizeLimitsPlugin.js +2 -2
- package/lib/prefetch/ChunkPrefetchTriggerRuntimeModule.js +1 -1
- package/lib/prefetch/ChunkPreloadTriggerRuntimeModule.js +1 -1
- package/lib/rules/BasicEffectRulePlugin.js +3 -1
- package/lib/rules/BasicMatcherRulePlugin.js +3 -1
- package/lib/rules/ObjectMatcherRulePlugin.js +4 -1
- package/lib/rules/RuleSetCompiler.js +41 -22
- package/lib/rules/UseEffectRulePlugin.js +36 -32
- package/lib/runtime/AsyncModuleRuntimeModule.js +1 -1
- package/lib/runtime/AutoPublicPathRuntimeModule.js +8 -3
- package/lib/runtime/CreateFakeNamespaceObjectRuntimeModule.js +2 -2
- package/lib/runtime/DefinePropertyGettersRuntimeModule.js +1 -1
- package/lib/runtime/EnsureChunkRuntimeModule.js +10 -11
- package/lib/runtime/GetChunkFilenameRuntimeModule.js +11 -17
- package/lib/runtime/LoadScriptRuntimeModule.js +17 -18
- package/lib/runtime/StartupChunkDependenciesRuntimeModule.js +1 -3
- package/lib/schemes/DataUriPlugin.js +1 -1
- package/lib/schemes/HttpUriPlugin.js +241 -126
- package/lib/serialization/BinaryMiddleware.js +44 -28
- package/lib/serialization/DateObjectSerializer.js +1 -0
- package/lib/serialization/ErrorObjectSerializer.js +2 -0
- package/lib/serialization/FileMiddleware.js +154 -106
- package/lib/serialization/MapObjectSerializer.js +2 -1
- package/lib/serialization/NullPrototypeObjectSerializer.js +3 -2
- package/lib/serialization/ObjectMiddleware.js +52 -56
- package/lib/serialization/PlainObjectSerializer.js +32 -6
- package/lib/serialization/RegExpObjectSerializer.js +1 -0
- package/lib/serialization/Serializer.js +4 -5
- package/lib/serialization/SerializerMiddleware.js +6 -6
- package/lib/serialization/SetObjectSerializer.js +2 -1
- package/lib/sharing/ConsumeSharedPlugin.js +116 -97
- package/lib/sharing/ConsumeSharedRuntimeModule.js +4 -4
- package/lib/sharing/ProvideForSharedDependency.js +0 -1
- package/lib/sharing/ProvideSharedPlugin.js +2 -2
- package/lib/sharing/resolveMatchedConfigs.js +2 -1
- package/lib/sharing/utils.js +15 -27
- package/lib/stats/DefaultStatsFactoryPlugin.js +424 -281
- package/lib/stats/DefaultStatsPresetPlugin.js +73 -18
- package/lib/stats/DefaultStatsPrinterPlugin.js +370 -101
- package/lib/stats/StatsFactory.js +127 -56
- package/lib/stats/StatsPrinter.js +75 -44
- package/lib/util/ArrayHelpers.js +8 -4
- package/lib/util/ArrayQueue.js +1 -1
- package/lib/util/AsyncQueue.js +31 -12
- package/lib/util/IterableHelpers.js +3 -4
- package/lib/util/LazyBucketSortedSet.js +60 -44
- package/lib/util/LazySet.js +13 -0
- package/lib/util/MapHelpers.js +1 -3
- package/lib/util/ParallelismFactorCalculator.js +1 -1
- package/lib/util/Queue.js +1 -1
- package/lib/util/Semaphore.js +4 -7
- package/lib/util/SetHelpers.js +5 -5
- package/lib/util/SortableSet.js +4 -3
- package/lib/util/StackedCacheMap.js +4 -6
- package/lib/util/StackedMap.js +1 -3
- package/lib/util/StringXor.js +0 -5
- package/lib/util/TupleQueue.js +1 -1
- package/lib/util/TupleSet.js +15 -5
- package/lib/util/URLAbsoluteSpecifier.js +7 -7
- package/lib/util/WeakTupleMap.js +19 -21
- package/lib/util/binarySearchBounds.js +5 -12
- package/lib/util/chainedImports.js +1 -1
- package/lib/util/cleverMerge.js +21 -19
- package/lib/util/comparators.js +57 -52
- package/lib/util/compileBooleanMatcher.js +3 -6
- package/lib/util/conventions.js +8 -11
- package/lib/util/createHash.js +9 -6
- package/lib/util/deprecation.js +22 -12
- package/lib/util/deterministicGrouping.js +19 -26
- package/lib/util/findGraphRoots.js +2 -2
- package/lib/util/fs.js +32 -32
- package/lib/util/hash/md4.js +2 -2
- package/lib/util/hash/wasm-hash.js +7 -7
- package/lib/util/hash/xxhash64.js +2 -2
- package/lib/util/identifier.js +81 -59
- package/lib/util/memoize.js +8 -10
- package/lib/util/mergeScope.js +6 -9
- package/lib/util/nonNumericOnlyHash.js +2 -2
- package/lib/util/numberHash.js +1 -6
- package/lib/util/objectToMap.js +0 -1
- package/lib/util/propertyAccess.js +2 -5
- package/lib/util/propertyName.js +1 -3
- package/lib/util/registerExternalSerializer.js +1 -1
- package/lib/util/runtime.js +109 -113
- package/lib/util/semver.js +29 -27
- package/lib/util/serialization.js +16 -1
- package/lib/util/smartGrouping.js +5 -5
- package/lib/util/source.js +1 -1
- package/lib/wasm/EnableWasmLoadingPlugin.js +5 -4
- package/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js +3 -3
- package/lib/wasm-async/AsyncWebAssemblyJavascriptGenerator.js +5 -6
- package/lib/wasm-async/AsyncWebAssemblyModulesPlugin.js +3 -3
- package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +20 -19
- package/lib/wasm-sync/WebAssemblyGenerator.js +14 -29
- package/lib/wasm-sync/WebAssemblyJavascriptGenerator.js +1 -1
- package/lib/wasm-sync/WebAssemblyUtils.js +2 -2
- package/lib/web/JsonpChunkLoadingRuntimeModule.js +2 -3
- package/lib/webworker/ImportScriptsChunkLoadingPlugin.js +3 -1
- package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +1 -1
- package/package.json +18 -17
- package/schemas/WebpackOptions.check.js +1 -1
- package/schemas/WebpackOptions.json +5 -0
- package/schemas/plugins/container/ContainerReferencePlugin.check.js +1 -1
- package/schemas/plugins/container/ContainerReferencePlugin.json +1 -0
- package/schemas/plugins/container/ExternalsType.check.js +1 -1
- package/schemas/plugins/container/ModuleFederationPlugin.check.js +1 -1
- package/schemas/plugins/container/ModuleFederationPlugin.json +1 -0
- package/types.d.ts +681 -355
package/lib/RuntimeGlobals.js
CHANGED
@@ -8,157 +8,158 @@
|
|
8
8
|
/**
|
9
9
|
* the internal require function
|
10
10
|
*/
|
11
|
-
exports.require = "__webpack_require__";
|
11
|
+
module.exports.require = "__webpack_require__";
|
12
12
|
|
13
13
|
/**
|
14
14
|
* access to properties of the internal require function/object
|
15
15
|
*/
|
16
|
-
exports.requireScope = "__webpack_require__.*";
|
16
|
+
module.exports.requireScope = "__webpack_require__.*";
|
17
17
|
|
18
18
|
/**
|
19
19
|
* the internal exports object
|
20
20
|
*/
|
21
|
-
exports.exports = "__webpack_exports__";
|
21
|
+
module.exports.exports = "__webpack_exports__";
|
22
22
|
|
23
23
|
/**
|
24
24
|
* top-level this need to be the exports object
|
25
25
|
*/
|
26
|
-
exports.thisAsExports = "top-level-this-exports";
|
26
|
+
module.exports.thisAsExports = "top-level-this-exports";
|
27
27
|
|
28
28
|
/**
|
29
29
|
* runtime need to return the exports of the last entry module
|
30
30
|
*/
|
31
|
-
exports.returnExportsFromRuntime = "return-exports-from-runtime";
|
31
|
+
module.exports.returnExportsFromRuntime = "return-exports-from-runtime";
|
32
32
|
|
33
33
|
/**
|
34
34
|
* the internal module object
|
35
35
|
*/
|
36
|
-
exports.module = "module";
|
36
|
+
module.exports.module = "module";
|
37
37
|
|
38
38
|
/**
|
39
39
|
* the internal module object
|
40
40
|
*/
|
41
|
-
exports.moduleId = "module.id";
|
41
|
+
module.exports.moduleId = "module.id";
|
42
42
|
|
43
43
|
/**
|
44
44
|
* the internal module object
|
45
45
|
*/
|
46
|
-
exports.moduleLoaded = "module.loaded";
|
46
|
+
module.exports.moduleLoaded = "module.loaded";
|
47
47
|
|
48
48
|
/**
|
49
49
|
* the bundle public path
|
50
50
|
*/
|
51
|
-
exports.publicPath = "__webpack_require__.p";
|
51
|
+
module.exports.publicPath = "__webpack_require__.p";
|
52
52
|
|
53
53
|
/**
|
54
54
|
* the module id of the entry point
|
55
55
|
*/
|
56
|
-
exports.entryModuleId = "__webpack_require__.s";
|
56
|
+
module.exports.entryModuleId = "__webpack_require__.s";
|
57
57
|
|
58
58
|
/**
|
59
59
|
* the module cache
|
60
60
|
*/
|
61
|
-
exports.moduleCache = "__webpack_require__.c";
|
61
|
+
module.exports.moduleCache = "__webpack_require__.c";
|
62
62
|
|
63
63
|
/**
|
64
64
|
* the module functions
|
65
65
|
*/
|
66
|
-
exports.moduleFactories = "__webpack_require__.m";
|
66
|
+
module.exports.moduleFactories = "__webpack_require__.m";
|
67
67
|
|
68
68
|
/**
|
69
69
|
* the module functions, with only write access
|
70
70
|
*/
|
71
|
-
exports.moduleFactoriesAddOnly = "__webpack_require__.m (add only)";
|
71
|
+
module.exports.moduleFactoriesAddOnly = "__webpack_require__.m (add only)";
|
72
72
|
|
73
73
|
/**
|
74
74
|
* the chunk ensure function
|
75
75
|
*/
|
76
|
-
exports.ensureChunk = "__webpack_require__.e";
|
76
|
+
module.exports.ensureChunk = "__webpack_require__.e";
|
77
77
|
|
78
78
|
/**
|
79
79
|
* an object with handlers to ensure a chunk
|
80
80
|
*/
|
81
|
-
exports.ensureChunkHandlers = "__webpack_require__.f";
|
81
|
+
module.exports.ensureChunkHandlers = "__webpack_require__.f";
|
82
82
|
|
83
83
|
/**
|
84
84
|
* a runtime requirement if ensureChunkHandlers should include loading of chunk needed for entries
|
85
85
|
*/
|
86
|
-
exports.ensureChunkIncludeEntries =
|
86
|
+
module.exports.ensureChunkIncludeEntries =
|
87
|
+
"__webpack_require__.f (include entries)";
|
87
88
|
|
88
89
|
/**
|
89
90
|
* the chunk prefetch function
|
90
91
|
*/
|
91
|
-
exports.prefetchChunk = "__webpack_require__.E";
|
92
|
+
module.exports.prefetchChunk = "__webpack_require__.E";
|
92
93
|
|
93
94
|
/**
|
94
95
|
* an object with handlers to prefetch a chunk
|
95
96
|
*/
|
96
|
-
exports.prefetchChunkHandlers = "__webpack_require__.F";
|
97
|
+
module.exports.prefetchChunkHandlers = "__webpack_require__.F";
|
97
98
|
|
98
99
|
/**
|
99
100
|
* the chunk preload function
|
100
101
|
*/
|
101
|
-
exports.preloadChunk = "__webpack_require__.G";
|
102
|
+
module.exports.preloadChunk = "__webpack_require__.G";
|
102
103
|
|
103
104
|
/**
|
104
105
|
* an object with handlers to preload a chunk
|
105
106
|
*/
|
106
|
-
exports.preloadChunkHandlers = "__webpack_require__.H";
|
107
|
+
module.exports.preloadChunkHandlers = "__webpack_require__.H";
|
107
108
|
|
108
109
|
/**
|
109
110
|
* the exported property define getters function
|
110
111
|
*/
|
111
|
-
exports.definePropertyGetters = "__webpack_require__.d";
|
112
|
+
module.exports.definePropertyGetters = "__webpack_require__.d";
|
112
113
|
|
113
114
|
/**
|
114
115
|
* define compatibility on export
|
115
116
|
*/
|
116
|
-
exports.makeNamespaceObject = "__webpack_require__.r";
|
117
|
+
module.exports.makeNamespaceObject = "__webpack_require__.r";
|
117
118
|
|
118
119
|
/**
|
119
120
|
* create a fake namespace object
|
120
121
|
*/
|
121
|
-
exports.createFakeNamespaceObject = "__webpack_require__.t";
|
122
|
+
module.exports.createFakeNamespaceObject = "__webpack_require__.t";
|
122
123
|
|
123
124
|
/**
|
124
125
|
* compatibility get default export
|
125
126
|
*/
|
126
|
-
exports.compatGetDefaultExport = "__webpack_require__.n";
|
127
|
+
module.exports.compatGetDefaultExport = "__webpack_require__.n";
|
127
128
|
|
128
129
|
/**
|
129
130
|
* harmony module decorator
|
130
131
|
*/
|
131
|
-
exports.harmonyModuleDecorator = "__webpack_require__.hmd";
|
132
|
+
module.exports.harmonyModuleDecorator = "__webpack_require__.hmd";
|
132
133
|
|
133
134
|
/**
|
134
135
|
* node.js module decorator
|
135
136
|
*/
|
136
|
-
exports.nodeModuleDecorator = "__webpack_require__.nmd";
|
137
|
+
module.exports.nodeModuleDecorator = "__webpack_require__.nmd";
|
137
138
|
|
138
139
|
/**
|
139
140
|
* the webpack hash
|
140
141
|
*/
|
141
|
-
exports.getFullHash = "__webpack_require__.h";
|
142
|
+
module.exports.getFullHash = "__webpack_require__.h";
|
142
143
|
|
143
144
|
/**
|
144
145
|
* an object containing all installed WebAssembly.Instance export objects keyed by module id
|
145
146
|
*/
|
146
|
-
exports.wasmInstances = "__webpack_require__.w";
|
147
|
+
module.exports.wasmInstances = "__webpack_require__.w";
|
147
148
|
|
148
149
|
/**
|
149
150
|
* instantiate a wasm instance from module exports object, id, hash and importsObject
|
150
151
|
*/
|
151
|
-
exports.instantiateWasm = "__webpack_require__.v";
|
152
|
+
module.exports.instantiateWasm = "__webpack_require__.v";
|
152
153
|
|
153
154
|
/**
|
154
155
|
* the uncaught error handler for the webpack runtime
|
155
156
|
*/
|
156
|
-
exports.uncaughtErrorHandler = "__webpack_require__.oe";
|
157
|
+
module.exports.uncaughtErrorHandler = "__webpack_require__.oe";
|
157
158
|
|
158
159
|
/**
|
159
160
|
* the script nonce
|
160
161
|
*/
|
161
|
-
exports.scriptNonce = "__webpack_require__.nc";
|
162
|
+
module.exports.scriptNonce = "__webpack_require__.nc";
|
162
163
|
|
163
164
|
/**
|
164
165
|
* function to load a script tag.
|
@@ -166,101 +167,101 @@ exports.scriptNonce = "__webpack_require__.nc";
|
|
166
167
|
* done function is called when loading has finished or timeout occurred.
|
167
168
|
* It will attach to existing script tags with data-webpack == uniqueName + ":" + key or src == url.
|
168
169
|
*/
|
169
|
-
exports.loadScript = "__webpack_require__.l";
|
170
|
+
module.exports.loadScript = "__webpack_require__.l";
|
170
171
|
|
171
172
|
/**
|
172
173
|
* function to promote a string to a TrustedScript using webpack's Trusted
|
173
174
|
* Types policy
|
174
175
|
* Arguments: (script: string) => TrustedScript
|
175
176
|
*/
|
176
|
-
exports.createScript = "__webpack_require__.ts";
|
177
|
+
module.exports.createScript = "__webpack_require__.ts";
|
177
178
|
|
178
179
|
/**
|
179
180
|
* function to promote a string to a TrustedScriptURL using webpack's Trusted
|
180
181
|
* Types policy
|
181
182
|
* Arguments: (url: string) => TrustedScriptURL
|
182
183
|
*/
|
183
|
-
exports.createScriptUrl = "__webpack_require__.tu";
|
184
|
+
module.exports.createScriptUrl = "__webpack_require__.tu";
|
184
185
|
|
185
186
|
/**
|
186
187
|
* function to return webpack's Trusted Types policy
|
187
188
|
* Arguments: () => TrustedTypePolicy
|
188
189
|
*/
|
189
|
-
exports.getTrustedTypesPolicy = "__webpack_require__.tt";
|
190
|
+
module.exports.getTrustedTypesPolicy = "__webpack_require__.tt";
|
190
191
|
|
191
192
|
/**
|
192
193
|
* a flag when a chunk has a fetch priority
|
193
194
|
*/
|
194
|
-
exports.hasFetchPriority = "has fetch priority";
|
195
|
+
module.exports.hasFetchPriority = "has fetch priority";
|
195
196
|
|
196
197
|
/**
|
197
198
|
* the chunk name of the chunk with the runtime
|
198
199
|
*/
|
199
|
-
exports.chunkName = "__webpack_require__.cn";
|
200
|
+
module.exports.chunkName = "__webpack_require__.cn";
|
200
201
|
|
201
202
|
/**
|
202
203
|
* the runtime id of the current runtime
|
203
204
|
*/
|
204
|
-
exports.runtimeId = "__webpack_require__.j";
|
205
|
+
module.exports.runtimeId = "__webpack_require__.j";
|
205
206
|
|
206
207
|
/**
|
207
208
|
* the filename of the script part of the chunk
|
208
209
|
*/
|
209
|
-
exports.getChunkScriptFilename = "__webpack_require__.u";
|
210
|
+
module.exports.getChunkScriptFilename = "__webpack_require__.u";
|
210
211
|
|
211
212
|
/**
|
212
213
|
* the filename of the css part of the chunk
|
213
214
|
*/
|
214
|
-
exports.getChunkCssFilename = "__webpack_require__.k";
|
215
|
+
module.exports.getChunkCssFilename = "__webpack_require__.k";
|
215
216
|
|
216
217
|
/**
|
217
218
|
* a flag when a module/chunk/tree has css modules
|
218
219
|
*/
|
219
|
-
exports.hasCssModules = "has css modules";
|
220
|
+
module.exports.hasCssModules = "has css modules";
|
220
221
|
|
221
222
|
/**
|
222
223
|
* the filename of the script part of the hot update chunk
|
223
224
|
*/
|
224
|
-
exports.getChunkUpdateScriptFilename = "__webpack_require__.hu";
|
225
|
+
module.exports.getChunkUpdateScriptFilename = "__webpack_require__.hu";
|
225
226
|
|
226
227
|
/**
|
227
228
|
* the filename of the css part of the hot update chunk
|
228
229
|
*/
|
229
|
-
exports.getChunkUpdateCssFilename = "__webpack_require__.hk";
|
230
|
+
module.exports.getChunkUpdateCssFilename = "__webpack_require__.hk";
|
230
231
|
|
231
232
|
/**
|
232
233
|
* startup signal from runtime
|
233
234
|
* This will be called when the runtime chunk has been loaded.
|
234
235
|
*/
|
235
|
-
exports.startup = "__webpack_require__.x";
|
236
|
+
module.exports.startup = "__webpack_require__.x";
|
236
237
|
|
237
238
|
/**
|
238
239
|
* @deprecated
|
239
240
|
* creating a default startup function with the entry modules
|
240
241
|
*/
|
241
|
-
exports.startupNoDefault = "__webpack_require__.x (no default handler)";
|
242
|
+
module.exports.startupNoDefault = "__webpack_require__.x (no default handler)";
|
242
243
|
|
243
244
|
/**
|
244
245
|
* startup signal from runtime but only used to add logic after the startup
|
245
246
|
*/
|
246
|
-
exports.startupOnlyAfter = "__webpack_require__.x (only after)";
|
247
|
+
module.exports.startupOnlyAfter = "__webpack_require__.x (only after)";
|
247
248
|
|
248
249
|
/**
|
249
250
|
* startup signal from runtime but only used to add sync logic before the startup
|
250
251
|
*/
|
251
|
-
exports.startupOnlyBefore = "__webpack_require__.x (only before)";
|
252
|
+
module.exports.startupOnlyBefore = "__webpack_require__.x (only before)";
|
252
253
|
|
253
254
|
/**
|
254
255
|
* global callback functions for installing chunks
|
255
256
|
*/
|
256
|
-
exports.chunkCallback = "webpackChunk";
|
257
|
+
module.exports.chunkCallback = "webpackChunk";
|
257
258
|
|
258
259
|
/**
|
259
260
|
* method to startup an entrypoint with needed chunks.
|
260
261
|
* Signature: (moduleId: Id, chunkIds: Id[]) => any.
|
261
262
|
* Returns the exports of the module or a Promise
|
262
263
|
*/
|
263
|
-
exports.startupEntrypoint = "__webpack_require__.X";
|
264
|
+
module.exports.startupEntrypoint = "__webpack_require__.X";
|
264
265
|
|
265
266
|
/**
|
266
267
|
* register deferred code, which will run when certain
|
@@ -270,106 +271,106 @@ exports.startupEntrypoint = "__webpack_require__.X";
|
|
270
271
|
* When (priority & 1) it will wait for all other handlers with lower priority to
|
271
272
|
* be executed before itself is executed
|
272
273
|
*/
|
273
|
-
exports.onChunksLoaded = "__webpack_require__.O";
|
274
|
+
module.exports.onChunksLoaded = "__webpack_require__.O";
|
274
275
|
|
275
276
|
/**
|
276
277
|
* method to install a chunk that was loaded somehow
|
277
278
|
* Signature: ({ id, ids, modules, runtime }) => void
|
278
279
|
*/
|
279
|
-
exports.externalInstallChunk = "__webpack_require__.C";
|
280
|
+
module.exports.externalInstallChunk = "__webpack_require__.C";
|
280
281
|
|
281
282
|
/**
|
282
283
|
* interceptor for module executions
|
283
284
|
*/
|
284
|
-
exports.interceptModuleExecution = "__webpack_require__.i";
|
285
|
+
module.exports.interceptModuleExecution = "__webpack_require__.i";
|
285
286
|
|
286
287
|
/**
|
287
288
|
* the global object
|
288
289
|
*/
|
289
|
-
exports.global = "__webpack_require__.g";
|
290
|
+
module.exports.global = "__webpack_require__.g";
|
290
291
|
|
291
292
|
/**
|
292
293
|
* an object with all share scopes
|
293
294
|
*/
|
294
|
-
exports.shareScopeMap = "__webpack_require__.S";
|
295
|
+
module.exports.shareScopeMap = "__webpack_require__.S";
|
295
296
|
|
296
297
|
/**
|
297
298
|
* The sharing init sequence function (only runs once per share scope).
|
298
299
|
* Has one argument, the name of the share scope.
|
299
300
|
* Creates a share scope if not existing
|
300
301
|
*/
|
301
|
-
exports.initializeSharing = "__webpack_require__.I";
|
302
|
+
module.exports.initializeSharing = "__webpack_require__.I";
|
302
303
|
|
303
304
|
/**
|
304
305
|
* The current scope when getting a module from a remote
|
305
306
|
*/
|
306
|
-
exports.currentRemoteGetScope = "__webpack_require__.R";
|
307
|
+
module.exports.currentRemoteGetScope = "__webpack_require__.R";
|
307
308
|
|
308
309
|
/**
|
309
310
|
* the filename of the HMR manifest
|
310
311
|
*/
|
311
|
-
exports.getUpdateManifestFilename = "__webpack_require__.hmrF";
|
312
|
+
module.exports.getUpdateManifestFilename = "__webpack_require__.hmrF";
|
312
313
|
|
313
314
|
/**
|
314
315
|
* function downloading the update manifest
|
315
316
|
*/
|
316
|
-
exports.hmrDownloadManifest = "__webpack_require__.hmrM";
|
317
|
+
module.exports.hmrDownloadManifest = "__webpack_require__.hmrM";
|
317
318
|
|
318
319
|
/**
|
319
320
|
* array with handler functions to download chunk updates
|
320
321
|
*/
|
321
|
-
exports.hmrDownloadUpdateHandlers = "__webpack_require__.hmrC";
|
322
|
+
module.exports.hmrDownloadUpdateHandlers = "__webpack_require__.hmrC";
|
322
323
|
|
323
324
|
/**
|
324
325
|
* object with all hmr module data for all modules
|
325
326
|
*/
|
326
|
-
exports.hmrModuleData = "__webpack_require__.hmrD";
|
327
|
+
module.exports.hmrModuleData = "__webpack_require__.hmrD";
|
327
328
|
|
328
329
|
/**
|
329
330
|
* array with handler functions when a module should be invalidated
|
330
331
|
*/
|
331
|
-
exports.hmrInvalidateModuleHandlers = "__webpack_require__.hmrI";
|
332
|
+
module.exports.hmrInvalidateModuleHandlers = "__webpack_require__.hmrI";
|
332
333
|
|
333
334
|
/**
|
334
335
|
* the prefix for storing state of runtime modules when hmr is enabled
|
335
336
|
*/
|
336
|
-
exports.hmrRuntimeStatePrefix = "__webpack_require__.hmrS";
|
337
|
+
module.exports.hmrRuntimeStatePrefix = "__webpack_require__.hmrS";
|
337
338
|
|
338
339
|
/**
|
339
340
|
* the AMD define function
|
340
341
|
*/
|
341
|
-
exports.amdDefine = "__webpack_require__.amdD";
|
342
|
+
module.exports.amdDefine = "__webpack_require__.amdD";
|
342
343
|
|
343
344
|
/**
|
344
345
|
* the AMD options
|
345
346
|
*/
|
346
|
-
exports.amdOptions = "__webpack_require__.amdO";
|
347
|
+
module.exports.amdOptions = "__webpack_require__.amdO";
|
347
348
|
|
348
349
|
/**
|
349
350
|
* the System polyfill object
|
350
351
|
*/
|
351
|
-
exports.system = "__webpack_require__.System";
|
352
|
+
module.exports.system = "__webpack_require__.System";
|
352
353
|
|
353
354
|
/**
|
354
355
|
* the shorthand for Object.prototype.hasOwnProperty
|
355
356
|
* using of it decreases the compiled bundle size
|
356
357
|
*/
|
357
|
-
exports.hasOwnProperty = "__webpack_require__.o";
|
358
|
+
module.exports.hasOwnProperty = "__webpack_require__.o";
|
358
359
|
|
359
360
|
/**
|
360
361
|
* the System.register context object
|
361
362
|
*/
|
362
|
-
exports.systemContext = "__webpack_require__.y";
|
363
|
+
module.exports.systemContext = "__webpack_require__.y";
|
363
364
|
|
364
365
|
/**
|
365
366
|
* the baseURI of current document
|
366
367
|
*/
|
367
|
-
exports.baseURI = "__webpack_require__.b";
|
368
|
+
module.exports.baseURI = "__webpack_require__.b";
|
368
369
|
|
369
370
|
/**
|
370
371
|
* a RelativeURL class when relative URLs are used
|
371
372
|
*/
|
372
|
-
exports.relativeUrl = "__webpack_require__.U";
|
373
|
+
module.exports.relativeUrl = "__webpack_require__.U";
|
373
374
|
|
374
375
|
/**
|
375
376
|
* Creates an async module. The body function must be a async function.
|
@@ -383,4 +384,4 @@ exports.relativeUrl = "__webpack_require__.U";
|
|
383
384
|
* hasAwaitAfterDependencies?: boolean
|
384
385
|
* ) => void
|
385
386
|
*/
|
386
|
-
exports.asyncModule = "__webpack_require__.a";
|
387
|
+
module.exports.asyncModule = "__webpack_require__.a";
|
package/lib/RuntimeModule.js
CHANGED
package/lib/RuntimePlugin.js
CHANGED
@@ -35,9 +35,12 @@ const SystemContextRuntimeModule = require("./runtime/SystemContextRuntimeModule
|
|
35
35
|
const ShareRuntimeModule = require("./sharing/ShareRuntimeModule");
|
36
36
|
const StringXor = require("./util/StringXor");
|
37
37
|
|
38
|
+
/** @typedef {import("../declarations/WebpackOptions").LibraryOptions} LibraryOptions */
|
39
|
+
/** @typedef {import("../declarations/WebpackOptions").OutputNormalized} OutputNormalized */
|
38
40
|
/** @typedef {import("./Chunk")} Chunk */
|
39
41
|
/** @typedef {import("./Compiler")} Compiler */
|
40
42
|
/** @typedef {import("./Module")} Module */
|
43
|
+
/** @typedef {import("./TemplatedPathPlugin").TemplatePath} TemplatePath */
|
41
44
|
|
42
45
|
const GLOBALS_ON_REQUIRE = [
|
43
46
|
RuntimeGlobals.chunkName,
|
@@ -241,13 +244,12 @@ class RuntimePlugin {
|
|
241
244
|
compilation.hooks.runtimeRequirementInTree
|
242
245
|
.for(RuntimeGlobals.systemContext)
|
243
246
|
.tap("RuntimePlugin", chunk => {
|
244
|
-
const { outputOptions } = compilation;
|
245
|
-
const { library: globalLibrary } = outputOptions;
|
246
247
|
const entryOptions = chunk.getEntryOptions();
|
247
248
|
const libraryType =
|
248
249
|
entryOptions && entryOptions.library !== undefined
|
249
250
|
? entryOptions.library.type
|
250
|
-
:
|
251
|
+
: /** @type {LibraryOptions} */
|
252
|
+
(compilation.outputOptions.library).type;
|
251
253
|
|
252
254
|
if (libraryType === "system") {
|
253
255
|
compilation.addRuntimeModule(
|
@@ -275,10 +277,13 @@ class RuntimePlugin {
|
|
275
277
|
"javascript",
|
276
278
|
RuntimeGlobals.getChunkScriptFilename,
|
277
279
|
chunk =>
|
278
|
-
|
279
|
-
(
|
280
|
-
|
281
|
-
|
280
|
+
/** @type {TemplatePath} */
|
281
|
+
(
|
282
|
+
chunk.filenameTemplate ||
|
283
|
+
(chunk.canBeInitial()
|
284
|
+
? compilation.outputOptions.filename
|
285
|
+
: compilation.outputOptions.chunkFilename)
|
286
|
+
),
|
282
287
|
false
|
283
288
|
)
|
284
289
|
);
|
@@ -313,7 +318,8 @@ class RuntimePlugin {
|
|
313
318
|
.tap("RuntimePlugin", (chunk, set) => {
|
314
319
|
if (
|
315
320
|
/\[(full)?hash(:\d+)?\]/.test(
|
316
|
-
|
321
|
+
/** @type {NonNullable<OutputNormalized["hotUpdateChunkFilename"]>} */
|
322
|
+
(compilation.outputOptions.hotUpdateChunkFilename)
|
317
323
|
)
|
318
324
|
)
|
319
325
|
set.add(RuntimeGlobals.getFullHash);
|
@@ -323,7 +329,9 @@ class RuntimePlugin {
|
|
323
329
|
"javascript",
|
324
330
|
"javascript update",
|
325
331
|
RuntimeGlobals.getChunkUpdateScriptFilename,
|
326
|
-
c =>
|
332
|
+
c =>
|
333
|
+
/** @type {NonNullable<OutputNormalized["hotUpdateChunkFilename"]>} */
|
334
|
+
(compilation.outputOptions.hotUpdateChunkFilename),
|
327
335
|
true
|
328
336
|
)
|
329
337
|
);
|
@@ -334,7 +342,8 @@ class RuntimePlugin {
|
|
334
342
|
.tap("RuntimePlugin", (chunk, set) => {
|
335
343
|
if (
|
336
344
|
/\[(full)?hash(:\d+)?\]/.test(
|
337
|
-
|
345
|
+
/** @type {NonNullable<OutputNormalized["hotUpdateMainFilename"]>} */
|
346
|
+
(compilation.outputOptions.hotUpdateMainFilename)
|
338
347
|
)
|
339
348
|
) {
|
340
349
|
set.add(RuntimeGlobals.getFullHash);
|
@@ -344,7 +353,8 @@ class RuntimePlugin {
|
|
344
353
|
new GetMainFilenameRuntimeModule(
|
345
354
|
"update manifest",
|
346
355
|
RuntimeGlobals.getUpdateManifestFilename,
|
347
|
-
|
356
|
+
/** @type {NonNullable<OutputNormalized["hotUpdateMainFilename"]>} */
|
357
|
+
(compilation.outputOptions.hotUpdateMainFilename)
|
348
358
|
)
|
349
359
|
);
|
350
360
|
return true;
|
@@ -376,7 +386,9 @@ class RuntimePlugin {
|
|
376
386
|
compilation.hooks.runtimeRequirementInTree
|
377
387
|
.for(RuntimeGlobals.loadScript)
|
378
388
|
.tap("RuntimePlugin", (chunk, set) => {
|
379
|
-
const withCreateScriptUrl =
|
389
|
+
const withCreateScriptUrl = Boolean(
|
390
|
+
compilation.outputOptions.trustedTypes
|
391
|
+
);
|
380
392
|
if (withCreateScriptUrl) {
|
381
393
|
set.add(RuntimeGlobals.createScriptUrl);
|
382
394
|
}
|