webpack 5.100.2 → 5.101.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/README.md +12 -10
- package/bin/webpack.js +7 -7
- package/lib/APIPlugin.js +12 -14
- package/lib/AutomaticPrefetchPlugin.js +2 -2
- package/lib/BannerPlugin.js +4 -4
- package/lib/Cache.js +1 -1
- package/lib/CacheFacade.js +7 -7
- package/lib/CaseSensitiveModulesWarning.js +2 -2
- package/lib/Chunk.js +3 -3
- package/lib/ChunkGraph.js +63 -18
- package/lib/ChunkGroup.js +4 -4
- package/lib/CleanPlugin.js +19 -53
- package/lib/CodeGenerationResults.js +3 -3
- package/lib/CompatibilityPlugin.js +6 -6
- package/lib/Compilation.js +168 -116
- package/lib/Compiler.js +37 -37
- package/lib/ConcatenationScope.js +39 -1
- package/lib/ConstPlugin.js +11 -11
- package/lib/ContextExclusionPlugin.js +3 -3
- package/lib/ContextModule.js +12 -11
- package/lib/ContextModuleFactory.js +11 -11
- package/lib/ContextReplacementPlugin.js +5 -5
- package/lib/DefinePlugin.js +24 -22
- package/lib/DelegatedModuleFactoryPlugin.js +1 -1
- package/lib/Dependency.js +2 -1
- package/lib/DllEntryPlugin.js +1 -1
- package/lib/DllReferencePlugin.js +1 -1
- package/lib/DynamicEntryPlugin.js +3 -3
- package/lib/EntryPlugin.js +1 -1
- package/lib/EnvironmentPlugin.js +1 -1
- package/lib/ErrorHelpers.js +2 -2
- package/lib/EvalDevToolModulePlugin.js +2 -2
- package/lib/EvalSourceMapDevToolPlugin.js +5 -5
- package/lib/ExportsInfo.js +9 -9
- package/lib/ExportsInfoApiPlugin.js +2 -2
- package/lib/ExternalModule.js +163 -48
- package/lib/ExternalModuleFactoryPlugin.js +2 -2
- package/lib/ExternalsPlugin.js +45 -0
- package/lib/FileSystemInfo.js +64 -61
- package/lib/FlagAllModulesAsUsedPlugin.js +2 -2
- package/lib/FlagDependencyExportsPlugin.js +7 -7
- package/lib/FlagDependencyUsagePlugin.js +4 -4
- package/lib/FlagEntryExportAsUsedPlugin.js +1 -1
- package/lib/HotModuleReplacementPlugin.js +27 -27
- package/lib/IgnorePlugin.js +3 -3
- package/lib/IgnoreWarningsPlugin.js +4 -4
- package/lib/InitFragment.js +6 -0
- package/lib/InvalidDependenciesModuleWarning.js +1 -1
- package/lib/JavascriptMetaInfoPlugin.js +1 -1
- package/lib/LibManifestPlugin.js +2 -2
- package/lib/LoaderOptionsPlugin.js +1 -1
- package/lib/LoaderTargetPlugin.js +2 -2
- package/lib/MainTemplate.js +1 -1
- package/lib/Module.js +3 -2
- package/lib/ModuleFilenameHelpers.js +3 -3
- package/lib/ModuleGraph.js +23 -38
- package/lib/ModuleInfoHeaderPlugin.js +3 -3
- package/lib/ModuleParseError.js +5 -3
- package/lib/ModuleTemplate.js +3 -2
- package/lib/MultiCompiler.js +29 -24
- package/lib/MultiStats.js +18 -13
- package/lib/MultiWatching.js +1 -1
- package/lib/NoEmitOnErrorsPlugin.js +2 -2
- package/lib/NodeStuffPlugin.js +27 -15
- package/lib/NormalModule.js +23 -23
- package/lib/NormalModuleFactory.js +23 -21
- package/lib/NormalModuleReplacementPlugin.js +3 -3
- package/lib/PrefetchPlugin.js +1 -1
- package/lib/ProgressPlugin.js +11 -11
- package/lib/ProvidePlugin.js +2 -2
- package/lib/RecordIdsPlugin.js +3 -3
- package/lib/ResolverFactory.js +3 -3
- package/lib/RuntimeGlobals.js +20 -0
- package/lib/RuntimePlugin.js +16 -16
- package/lib/RuntimeTemplate.js +35 -26
- package/lib/SizeFormatHelpers.js +1 -1
- package/lib/SourceMapDevToolModuleOptionsPlugin.js +4 -4
- package/lib/SourceMapDevToolPlugin.js +9 -9
- package/lib/Stats.js +2 -2
- package/lib/Template.js +1 -1
- package/lib/TemplatedPathPlugin.js +2 -2
- package/lib/UseStrictPlugin.js +1 -1
- package/lib/WarnCaseSensitiveModulesPlugin.js +1 -1
- package/lib/WarnDeprecatedOptionPlugin.js +1 -1
- package/lib/WarnNoModeSetPlugin.js +1 -1
- package/lib/WatchIgnorePlugin.js +2 -2
- package/lib/Watching.js +12 -14
- package/lib/WebpackIsIncludedPlugin.js +2 -2
- package/lib/WebpackOptionsApply.js +3 -3
- package/lib/asset/AssetGenerator.js +1 -1
- package/lib/asset/AssetModulesPlugin.js +6 -6
- package/lib/async-modules/AsyncModuleHelpers.js +1 -1
- package/lib/async-modules/AwaitDependenciesInitFragment.js +36 -24
- package/lib/async-modules/InferAsyncModulesPlugin.js +3 -3
- package/lib/buildChunkGraph.js +5 -5
- package/lib/cache/AddBuildDependenciesPlugin.js +1 -1
- package/lib/cache/IdleFileCachePlugin.js +5 -5
- package/lib/cache/PackFileCacheStrategy.js +20 -20
- package/lib/cache/ResolverCachePlugin.js +4 -4
- package/lib/cli.js +196 -14
- package/lib/config/browserslistTargetHandler.js +6 -6
- package/lib/config/defaults.js +23 -14
- package/lib/config/normalization.js +41 -38
- package/lib/config/target.js +4 -4
- package/lib/container/ContainerEntryModule.js +3 -3
- package/lib/container/ContainerPlugin.js +3 -3
- package/lib/container/ContainerReferencePlugin.js +3 -3
- package/lib/container/FallbackModule.js +1 -1
- package/lib/container/HoistContainerReferencesPlugin.js +7 -7
- package/lib/container/options.js +4 -4
- package/lib/css/CssGenerator.js +5 -3
- package/lib/css/CssLoadingRuntimeModule.js +1 -1
- package/lib/css/CssModulesPlugin.js +25 -22
- package/lib/css/CssParser.js +5 -5
- package/lib/css/walkCssTokens.js +9 -9
- package/lib/debug/ProfilingPlugin.js +5 -5
- package/lib/dependencies/AMDDefineDependencyParserPlugin.js +4 -4
- package/lib/dependencies/AMDPlugin.js +3 -3
- package/lib/dependencies/AMDRequireArrayDependency.js +1 -1
- package/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +3 -3
- package/lib/dependencies/CommonJsExportRequireDependency.js +2 -2
- package/lib/dependencies/CommonJsExportsParserPlugin.js +12 -10
- package/lib/dependencies/CommonJsImportsParserPlugin.js +21 -19
- package/lib/dependencies/CommonJsPlugin.js +2 -2
- package/lib/dependencies/ContextDependency.js +1 -1
- package/lib/dependencies/ContextDependencyHelpers.js +3 -3
- package/lib/dependencies/CssIcssExportDependency.js +2 -2
- package/lib/dependencies/CssLocalIdentifierDependency.js +2 -2
- package/lib/dependencies/CssUrlDependency.js +4 -4
- package/lib/dependencies/DynamicExports.js +5 -5
- package/lib/dependencies/HarmonyAcceptDependency.js +91 -5
- package/lib/dependencies/HarmonyDetectionParserPlugin.js +2 -2
- package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +17 -13
- package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +7 -8
- package/lib/dependencies/HarmonyExportInitFragment.js +1 -1
- package/lib/dependencies/HarmonyExports.js +1 -1
- package/lib/dependencies/HarmonyImportDependency.js +28 -9
- package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +56 -48
- package/lib/dependencies/HarmonyImportSideEffectDependency.js +4 -5
- package/lib/dependencies/HarmonyImportSpecifierDependency.js +3 -4
- package/lib/dependencies/HarmonyModulesPlugin.js +2 -8
- package/lib/dependencies/HarmonyTopLevelThisParserPlugin.js +1 -1
- package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +4 -4
- package/lib/dependencies/ImportMetaPlugin.js +7 -7
- package/lib/dependencies/ImportParserPlugin.js +4 -4
- package/lib/dependencies/JsonExportsDependency.js +7 -2
- package/lib/dependencies/LoaderPlugin.js +4 -4
- package/lib/dependencies/ModuleDependency.js +2 -1
- package/lib/dependencies/ProvidedDependency.js +2 -2
- package/lib/dependencies/PureExpressionDependency.js +1 -1
- package/lib/dependencies/RequireContextDependencyParserPlugin.js +1 -1
- package/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin.js +1 -1
- package/lib/dependencies/RequireIncludeDependencyParserPlugin.js +3 -3
- package/lib/dependencies/SystemPlugin.js +3 -3
- package/lib/dependencies/WorkerPlugin.js +5 -5
- package/lib/dependencies/getFunctionExpression.js +1 -1
- package/lib/esm/ExportWebpackRequireRuntimeModule.js +8 -1
- package/lib/esm/ModuleChunkFormatPlugin.js +35 -69
- package/lib/esm/ModuleChunkLoadingPlugin.js +3 -6
- package/lib/esm/ModuleChunkLoadingRuntimeModule.js +15 -11
- package/lib/formatLocation.js +2 -2
- package/lib/hmr/HotModuleReplacement.runtime.js +39 -27
- package/lib/hmr/JavascriptHotModuleReplacement.runtime.js +43 -32
- package/lib/hmr/JavascriptHotModuleReplacementHelper.js +1 -1
- package/lib/hmr/LazyCompilationPlugin.js +6 -6
- package/lib/hmr/lazyCompilationBackend.js +6 -6
- package/lib/ids/ChunkModuleIdRangePlugin.js +4 -4
- package/lib/ids/DeterministicChunkIdsPlugin.js +5 -4
- package/lib/ids/DeterministicModuleIdsPlugin.js +2 -2
- package/lib/ids/HashedModuleIdsPlugin.js +1 -1
- package/lib/ids/IdHelpers.js +9 -9
- package/lib/ids/NamedChunkIdsPlugin.js +5 -5
- package/lib/ids/NamedModuleIdsPlugin.js +2 -2
- package/lib/ids/NaturalChunkIdsPlugin.js +2 -2
- package/lib/ids/NaturalModuleIdsPlugin.js +1 -1
- package/lib/ids/OccurrenceChunkIdsPlugin.js +2 -2
- package/lib/ids/OccurrenceModuleIdsPlugin.js +4 -4
- package/lib/ids/SyncModuleIdsPlugin.js +4 -4
- package/lib/index.js +18 -6
- package/lib/javascript/ArrayPushCallbackChunkFormatPlugin.js +1 -1
- package/lib/javascript/BasicEvaluatedExpression.js +3 -3
- package/lib/javascript/ChunkFormatHelpers.js +70 -0
- package/lib/javascript/CommonJsChunkFormatPlugin.js +10 -21
- package/lib/javascript/EnableChunkLoadingPlugin.js +1 -1
- package/lib/javascript/JavascriptGenerator.js +1 -1
- package/lib/javascript/JavascriptModulesPlugin.js +108 -54
- package/lib/javascript/JavascriptParser.js +80 -78
- package/lib/javascript/JavascriptParserHelpers.js +3 -3
- package/lib/javascript/StartupHelpers.js +2 -2
- package/lib/json/JsonGenerator.js +2 -2
- package/lib/json/JsonModulesPlugin.js +2 -2
- package/lib/library/AbstractLibraryPlugin.js +30 -3
- package/lib/library/AmdLibraryPlugin.js +3 -3
- package/lib/library/AssignLibraryPlugin.js +2 -2
- package/lib/library/EnableLibraryPlugin.js +2 -2
- package/lib/library/ModuleLibraryPlugin.js +49 -31
- package/lib/library/SystemLibraryPlugin.js +6 -4
- package/lib/library/UmdLibraryPlugin.js +14 -14
- package/lib/logging/createConsoleLogger.js +4 -4
- package/lib/logging/runtime.js +3 -3
- package/lib/logging/truncateArgs.js +4 -4
- package/lib/node/CommonJsChunkLoadingPlugin.js +2 -2
- package/lib/node/NodeEnvironmentPlugin.js +1 -1
- package/lib/node/ReadFileChunkLoadingRuntimeModule.js +16 -14
- package/lib/node/ReadFileCompileAsyncWasmPlugin.js +7 -7
- package/lib/node/ReadFileCompileWasmPlugin.js +7 -7
- package/lib/node/RequireChunkLoadingRuntimeModule.js +13 -6
- package/lib/node/nodeConsole.js +2 -2
- package/lib/optimize/AggressiveMergingPlugin.js +2 -2
- package/lib/optimize/AggressiveSplittingPlugin.js +10 -10
- package/lib/optimize/ConcatenatedModule.js +186 -77
- package/lib/optimize/EnsureChunkConditionsPlugin.js +2 -2
- package/lib/optimize/FlagIncludedChunksPlugin.js +2 -2
- package/lib/optimize/InnerGraph.js +5 -5
- package/lib/optimize/InnerGraphPlugin.js +14 -12
- package/lib/optimize/LimitChunkCountPlugin.js +5 -5
- package/lib/optimize/MangleExportsPlugin.js +5 -5
- package/lib/optimize/MergeDuplicateChunksPlugin.js +2 -2
- package/lib/optimize/MinChunkSizePlugin.js +3 -3
- package/lib/optimize/ModuleConcatenationPlugin.js +45 -38
- package/lib/optimize/RealContentHashPlugin.js +23 -23
- package/lib/optimize/RemoveEmptyChunksPlugin.js +2 -2
- package/lib/optimize/RemoveParentModulesPlugin.js +3 -3
- package/lib/optimize/RuntimeChunkPlugin.js +2 -2
- package/lib/optimize/SideEffectsFlagPlugin.js +5 -5
- package/lib/optimize/SplitChunksPlugin.js +20 -20
- package/lib/performance/AssetsOverSizeLimitWarning.js +1 -1
- package/lib/performance/EntrypointsOverSizeLimitWarning.js +2 -2
- package/lib/performance/SizeLimitsPlugin.js +4 -4
- package/lib/prefetch/ChunkPrefetchPreloadPlugin.js +1 -1
- package/lib/prefetch/ChunkPrefetchStartupRuntimeModule.js +3 -3
- package/lib/rules/BasicMatcherRulePlugin.js +1 -1
- package/lib/rules/RuleSetCompiler.js +10 -10
- package/lib/rules/UseEffectRulePlugin.js +2 -2
- package/lib/runtime/GetChunkFilenameRuntimeModule.js +19 -15
- package/lib/runtime/GetMainFilenameRuntimeModule.js +1 -1
- package/lib/runtime/GetTrustedTypesPolicyRuntimeModule.js +1 -1
- package/lib/runtime/MakeDeferredNamespaceObjectRuntime.js +1 -1
- package/lib/runtime/StartupChunkDependenciesPlugin.js +2 -2
- package/lib/runtime/StartupChunkDependenciesRuntimeModule.js +3 -3
- package/lib/schemes/DataUriPlugin.js +3 -3
- package/lib/schemes/FileUriPlugin.js +1 -1
- package/lib/schemes/HttpUriPlugin.js +40 -36
- package/lib/schemes/VirtualUrlPlugin.js +1 -1
- package/lib/serialization/BinaryMiddleware.js +11 -11
- package/lib/serialization/FileMiddleware.js +18 -17
- package/lib/serialization/ObjectMiddleware.js +8 -8
- package/lib/serialization/Serializer.js +2 -2
- package/lib/serialization/SerializerMiddleware.js +2 -2
- package/lib/sharing/ConsumeSharedPlugin.js +4 -4
- package/lib/sharing/ProvideSharedPlugin.js +4 -4
- package/lib/sharing/SharePlugin.js +1 -1
- package/lib/sharing/resolveMatchedConfigs.js +1 -1
- package/lib/stats/DefaultStatsFactoryPlugin.js +85 -80
- package/lib/stats/DefaultStatsPresetPlugin.js +15 -15
- package/lib/stats/DefaultStatsPrinterPlugin.js +87 -87
- package/lib/stats/StatsFactory.js +7 -7
- package/lib/stats/StatsPrinter.js +9 -9
- package/lib/url/URLParserPlugin.js +5 -5
- package/lib/util/AsyncQueue.js +4 -4
- package/lib/util/IterableHelpers.js +2 -2
- package/lib/util/LazyBucketSortedSet.js +3 -3
- package/lib/util/SetHelpers.js +2 -2
- package/lib/util/StackedCacheMap.js +1 -1
- package/lib/util/StackedMap.js +1 -1
- package/lib/util/TupleSet.js +1 -1
- package/lib/util/WeakTupleMap.js +1 -1
- package/lib/util/cleverMerge.js +8 -8
- package/lib/util/comparators.js +10 -10
- package/lib/util/compileBooleanMatcher.js +20 -20
- package/lib/util/concatenate.js +3 -3
- package/lib/util/conventions.js +4 -4
- package/lib/util/create-schema-validation.js +1 -1
- package/lib/util/createHash.js +1 -1
- package/lib/util/deprecation.js +4 -4
- package/lib/util/deterministicGrouping.js +7 -7
- package/lib/util/findGraphRoots.js +1 -1
- package/lib/util/fs.js +4 -4
- package/lib/util/identifier.js +14 -14
- package/lib/util/magicComment.js +5 -1
- package/lib/util/memoize.js +1 -1
- package/lib/util/processAsyncTree.js +2 -2
- package/lib/util/propertyName.js +1 -1
- package/lib/util/removeBOM.js +1 -1
- package/lib/util/runtime.js +6 -6
- package/lib/util/semver.js +16 -16
- package/lib/util/serialization.js +5 -5
- package/lib/util/smartGrouping.js +1 -1
- package/lib/validateSchema.js +2 -2
- package/lib/wasm/EnableWasmLoadingPlugin.js +1 -1
- package/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js +1 -1
- package/lib/wasm-async/AsyncWebAssemblyJavascriptGenerator.js +1 -1
- package/lib/wasm-async/UniversalCompileAsyncWasmPlugin.js +4 -4
- package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +13 -9
- package/lib/wasm-sync/WasmFinalizeExportsPlugin.js +2 -2
- package/lib/wasm-sync/WebAssemblyGenerator.js +16 -17
- package/lib/wasm-sync/WebAssemblyInInitialChunkError.js +4 -2
- package/lib/wasm-sync/WebAssemblyParser.js +2 -2
- package/lib/web/FetchCompileAsyncWasmPlugin.js +4 -4
- package/lib/web/FetchCompileWasmPlugin.js +4 -4
- package/lib/web/JsonpChunkLoadingPlugin.js +2 -2
- package/lib/web/JsonpChunkLoadingRuntimeModule.js +1 -1
- package/lib/webpack.js +17 -12
- package/lib/webworker/ImportScriptsChunkLoadingPlugin.js +2 -2
- package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +1 -1
- package/package.json +16 -16
- package/schemas/WebpackOptions.check.js +1 -1
- package/schemas/WebpackOptions.json +4 -0
- package/types.d.ts +275 -64
|
@@ -124,7 +124,7 @@ const LEADING_DOT_EXTENSION_REGEX = /^[^.]/;
|
|
|
124
124
|
* @param {LoaderItem} data data
|
|
125
125
|
* @returns {string} ident
|
|
126
126
|
*/
|
|
127
|
-
const loaderToIdent = data => {
|
|
127
|
+
const loaderToIdent = (data) => {
|
|
128
128
|
if (!data.options) {
|
|
129
129
|
return data.loader;
|
|
130
130
|
}
|
|
@@ -158,7 +158,7 @@ const stringifyLoadersAndResource = (loaders, resource) => {
|
|
|
158
158
|
* @param {(err?: null | Error) => void} callback callback
|
|
159
159
|
* @returns {(err?: null | Error) => void} callback
|
|
160
160
|
*/
|
|
161
|
-
const needCalls = (times, callback) => err => {
|
|
161
|
+
const needCalls = (times, callback) => (err) => {
|
|
162
162
|
if (--times === 0) {
|
|
163
163
|
return callback(err);
|
|
164
164
|
}
|
|
@@ -204,7 +204,7 @@ const mergeGlobalOptions = (globalOptions, type, localOptions) => {
|
|
|
204
204
|
* @returns {string} result
|
|
205
205
|
*/
|
|
206
206
|
const deprecationChangedHookMessage = (name, hook) => {
|
|
207
|
-
const names = hook.taps.map(tapped => tapped.name).join(", ");
|
|
207
|
+
const names = hook.taps.map((tapped) => tapped.name).join(", ");
|
|
208
208
|
|
|
209
209
|
return (
|
|
210
210
|
`NormalModuleFactory.${name} (${names}) is no longer a waterfall hook, but a bailing hook instead. ` +
|
|
@@ -227,7 +227,7 @@ const ruleSetCompiler = new RuleSetCompiler([
|
|
|
227
227
|
new BasicMatcherRulePlugin("issuer"),
|
|
228
228
|
new BasicMatcherRulePlugin("compiler"),
|
|
229
229
|
new BasicMatcherRulePlugin("issuerLayer"),
|
|
230
|
-
new ObjectMatcherRulePlugin("assert", "assertions", value => {
|
|
230
|
+
new ObjectMatcherRulePlugin("assert", "assertions", (value) => {
|
|
231
231
|
if (value) {
|
|
232
232
|
return (
|
|
233
233
|
/** @type {ImportAttributes} */ (value)._isLegacyAssert !== undefined
|
|
@@ -236,7 +236,7 @@ const ruleSetCompiler = new RuleSetCompiler([
|
|
|
236
236
|
|
|
237
237
|
return false;
|
|
238
238
|
}),
|
|
239
|
-
new ObjectMatcherRulePlugin("with", "assertions", value => {
|
|
239
|
+
new ObjectMatcherRulePlugin("with", "assertions", (value) => {
|
|
240
240
|
if (value) {
|
|
241
241
|
return !(/** @type {ImportAttributes} */ (value)._isLegacyAssert);
|
|
242
242
|
}
|
|
@@ -498,7 +498,7 @@ class NormalModuleFactory extends ModuleFactory {
|
|
|
498
498
|
)
|
|
499
499
|
.split(/!+/);
|
|
500
500
|
unresolvedResource = /** @type {string} */ (rawElements.pop());
|
|
501
|
-
elements = rawElements.map(el => {
|
|
501
|
+
elements = rawElements.map((el) => {
|
|
502
502
|
const { path, query } = cachedParseResourceWithoutFragment(el);
|
|
503
503
|
return {
|
|
504
504
|
loader: path,
|
|
@@ -528,7 +528,7 @@ class NormalModuleFactory extends ModuleFactory {
|
|
|
528
528
|
/** @type {undefined | LoaderItem[]} */
|
|
529
529
|
let loaders;
|
|
530
530
|
|
|
531
|
-
const continueCallback = needCalls(2, err => {
|
|
531
|
+
const continueCallback = needCalls(2, (err) => {
|
|
532
532
|
if (err) return callback(err);
|
|
533
533
|
|
|
534
534
|
// translate option idents
|
|
@@ -656,7 +656,7 @@ class NormalModuleFactory extends ModuleFactory {
|
|
|
656
656
|
/** @type {undefined | LoaderItem[]} */
|
|
657
657
|
let preLoaders;
|
|
658
658
|
|
|
659
|
-
const continueCallback = needCalls(3, err => {
|
|
659
|
+
const continueCallback = needCalls(3, (err) => {
|
|
660
660
|
if (err) {
|
|
661
661
|
return callback(err);
|
|
662
662
|
}
|
|
@@ -775,7 +775,7 @@ class NormalModuleFactory extends ModuleFactory {
|
|
|
775
775
|
/**
|
|
776
776
|
* @param {string} context context
|
|
777
777
|
*/
|
|
778
|
-
const defaultResolve = context => {
|
|
778
|
+
const defaultResolve = (context) => {
|
|
779
779
|
if (/^($|\?)/.test(unresolvedResource)) {
|
|
780
780
|
resourceData = {
|
|
781
781
|
...cacheParseResource(unresolvedResource),
|
|
@@ -835,7 +835,7 @@ class NormalModuleFactory extends ModuleFactory {
|
|
|
835
835
|
};
|
|
836
836
|
this.hooks.resolveForScheme
|
|
837
837
|
.for(scheme)
|
|
838
|
-
.callAsync(resourceData, data, err => {
|
|
838
|
+
.callAsync(resourceData, data, (err) => {
|
|
839
839
|
if (err) return continueCallback(err);
|
|
840
840
|
continueCallback();
|
|
841
841
|
});
|
|
@@ -1016,13 +1016,15 @@ ${hints.join("\n\n")}`;
|
|
|
1016
1016
|
// Check if the extension is missing a leading dot (e.g. "js" instead of ".js")
|
|
1017
1017
|
let appendResolveExtensionsHint = false;
|
|
1018
1018
|
const specifiedExtensions = [...resolver.options.extensions];
|
|
1019
|
-
const expectedExtensions = specifiedExtensions.map(
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1019
|
+
const expectedExtensions = specifiedExtensions.map(
|
|
1020
|
+
(extension) => {
|
|
1021
|
+
if (LEADING_DOT_EXTENSION_REGEX.test(extension)) {
|
|
1022
|
+
appendResolveExtensionsHint = true;
|
|
1023
|
+
return `.${extension}`;
|
|
1024
|
+
}
|
|
1025
|
+
return extension;
|
|
1023
1026
|
}
|
|
1024
|
-
|
|
1025
|
-
});
|
|
1027
|
+
);
|
|
1026
1028
|
if (appendResolveExtensionsHint) {
|
|
1027
1029
|
err.message += `\nDid you miss the leading dot in 'resolve.extensions'? Did you mean '${JSON.stringify(
|
|
1028
1030
|
expectedExtensions
|
|
@@ -1059,7 +1061,7 @@ ${hints.join("\n\n")}`;
|
|
|
1059
1061
|
) {
|
|
1060
1062
|
asyncLib.parallel(
|
|
1061
1063
|
[
|
|
1062
|
-
callback => {
|
|
1064
|
+
(callback) => {
|
|
1063
1065
|
if (!resolver.options.fullySpecified) return callback();
|
|
1064
1066
|
resolver
|
|
1065
1067
|
.withOptions({
|
|
@@ -1089,7 +1091,7 @@ Add the extension to the request.`
|
|
|
1089
1091
|
}
|
|
1090
1092
|
);
|
|
1091
1093
|
},
|
|
1092
|
-
callback => {
|
|
1094
|
+
(callback) => {
|
|
1093
1095
|
if (!resolver.options.enforceExtension) return callback();
|
|
1094
1096
|
resolver
|
|
1095
1097
|
.withOptions({
|
|
@@ -1128,7 +1130,7 @@ Including the extension in the request is no longer possible. Did you mean to en
|
|
|
1128
1130
|
}
|
|
1129
1131
|
);
|
|
1130
1132
|
},
|
|
1131
|
-
callback => {
|
|
1133
|
+
(callback) => {
|
|
1132
1134
|
if (
|
|
1133
1135
|
/^\.\.?\//.test(unresolvedResource) ||
|
|
1134
1136
|
resolver.options.preferRelative
|
|
@@ -1143,7 +1145,7 @@ Including the extension in the request is no longer possible. Did you mean to en
|
|
|
1143
1145
|
(err, resolvedResource) => {
|
|
1144
1146
|
if (err || !resolvedResource) return callback();
|
|
1145
1147
|
const moduleDirectories = resolver.options.modules
|
|
1146
|
-
.map(m => (Array.isArray(m) ? m.join(", ") : m))
|
|
1148
|
+
.map((m) => (Array.isArray(m) ? m.join(", ") : m))
|
|
1147
1149
|
.join(", ");
|
|
1148
1150
|
callback(
|
|
1149
1151
|
null,
|
|
@@ -1201,7 +1203,7 @@ If changing the source code is not an option there is also a resolve options cal
|
|
|
1201
1203
|
context,
|
|
1202
1204
|
`${item.loader}-loader`,
|
|
1203
1205
|
resolveContext,
|
|
1204
|
-
err2 => {
|
|
1206
|
+
(err2) => {
|
|
1205
1207
|
if (!err2) {
|
|
1206
1208
|
err.message =
|
|
1207
1209
|
`${err.message}\n` +
|
|
@@ -34,8 +34,8 @@ class NormalModuleReplacementPlugin {
|
|
|
34
34
|
apply(compiler) {
|
|
35
35
|
const resourceRegExp = this.resourceRegExp;
|
|
36
36
|
const newResource = this.newResource;
|
|
37
|
-
compiler.hooks.normalModuleFactory.tap(PLUGIN_NAME, nmf => {
|
|
38
|
-
nmf.hooks.beforeResolve.tap(PLUGIN_NAME, result => {
|
|
37
|
+
compiler.hooks.normalModuleFactory.tap(PLUGIN_NAME, (nmf) => {
|
|
38
|
+
nmf.hooks.beforeResolve.tap(PLUGIN_NAME, (result) => {
|
|
39
39
|
if (resourceRegExp.test(result.request)) {
|
|
40
40
|
if (typeof newResource === "function") {
|
|
41
41
|
newResource(result);
|
|
@@ -44,7 +44,7 @@ class NormalModuleReplacementPlugin {
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
|
-
nmf.hooks.afterResolve.tap(PLUGIN_NAME, result => {
|
|
47
|
+
nmf.hooks.afterResolve.tap(PLUGIN_NAME, (result) => {
|
|
48
48
|
const createData = result.createData;
|
|
49
49
|
if (resourceRegExp.test(/** @type {string} */ (createData.resource))) {
|
|
50
50
|
if (typeof newResource === "function") {
|
package/lib/PrefetchPlugin.js
CHANGED
package/lib/ProgressPlugin.js
CHANGED
|
@@ -74,7 +74,7 @@ const createDefaultHandler = (profile, logger) => {
|
|
|
74
74
|
lastStateInfo.length = 0;
|
|
75
75
|
}
|
|
76
76
|
const fullState = [msg, ...args];
|
|
77
|
-
const state = fullState.map(s => s.replace(/\d+\/\d+ /g, ""));
|
|
77
|
+
const state = fullState.map((s) => s.replace(/\d+\/\d+ /g, ""));
|
|
78
78
|
const now = Date.now();
|
|
79
79
|
const len = Math.max(state.length, lastStateInfo.length);
|
|
80
80
|
for (let i = len; i >= 0; i--) {
|
|
@@ -354,7 +354,7 @@ class ProgressPlugin {
|
|
|
354
354
|
/**
|
|
355
355
|
* @param {Module} module the module
|
|
356
356
|
*/
|
|
357
|
-
const moduleBuild = module => {
|
|
357
|
+
const moduleBuild = (module) => {
|
|
358
358
|
const ident = module.identifier();
|
|
359
359
|
if (ident) {
|
|
360
360
|
activeModules.add(ident);
|
|
@@ -375,7 +375,7 @@ class ProgressPlugin {
|
|
|
375
375
|
/**
|
|
376
376
|
* @param {Module} module the module
|
|
377
377
|
*/
|
|
378
|
-
const moduleDone = module => {
|
|
378
|
+
const moduleDone = (module) => {
|
|
379
379
|
doneModules++;
|
|
380
380
|
if (showActiveModules) {
|
|
381
381
|
const ident = module.identifier();
|
|
@@ -411,7 +411,7 @@ class ProgressPlugin {
|
|
|
411
411
|
compiler.hooks.beforeCompile.tap(PLUGIN_NAME, () => {
|
|
412
412
|
if (!cacheGetPromise) {
|
|
413
413
|
cacheGetPromise = cache.getPromise().then(
|
|
414
|
-
data => {
|
|
414
|
+
(data) => {
|
|
415
415
|
if (data) {
|
|
416
416
|
lastModulesCount = lastModulesCount || data.modulesCount;
|
|
417
417
|
lastDependenciesCount =
|
|
@@ -419,17 +419,17 @@ class ProgressPlugin {
|
|
|
419
419
|
}
|
|
420
420
|
return data;
|
|
421
421
|
},
|
|
422
|
-
_err => {
|
|
422
|
+
(_err) => {
|
|
423
423
|
// Ignore error
|
|
424
424
|
}
|
|
425
425
|
);
|
|
426
426
|
}
|
|
427
427
|
});
|
|
428
428
|
|
|
429
|
-
compiler.hooks.afterCompile.tapPromise(PLUGIN_NAME, compilation => {
|
|
429
|
+
compiler.hooks.afterCompile.tapPromise(PLUGIN_NAME, (compilation) => {
|
|
430
430
|
if (compilation.compiler.isChild()) return Promise.resolve();
|
|
431
431
|
return /** @type {Promise<CountsData>} */ (cacheGetPromise).then(
|
|
432
|
-
async oldData => {
|
|
432
|
+
async (oldData) => {
|
|
433
433
|
const realModulesCount = modulesCount - skippedModulesCount;
|
|
434
434
|
const realDependenciesCount =
|
|
435
435
|
dependenciesCount - skippedDependenciesCount;
|
|
@@ -448,7 +448,7 @@ class ProgressPlugin {
|
|
|
448
448
|
);
|
|
449
449
|
});
|
|
450
450
|
|
|
451
|
-
compiler.hooks.compilation.tap(PLUGIN_NAME, compilation => {
|
|
451
|
+
compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
|
|
452
452
|
if (compilation.compiler.isChild()) return;
|
|
453
453
|
lastModulesCount = modulesCount;
|
|
454
454
|
lastEntriesCount = entriesCount;
|
|
@@ -461,12 +461,12 @@ class ProgressPlugin {
|
|
|
461
461
|
0;
|
|
462
462
|
doneModules = doneDependencies = doneEntries = 0;
|
|
463
463
|
|
|
464
|
-
compilation.factorizeQueue.hooks.added.tap(PLUGIN_NAME, item =>
|
|
464
|
+
compilation.factorizeQueue.hooks.added.tap(PLUGIN_NAME, (item) =>
|
|
465
465
|
factorizeAdd(compilation.factorizeQueue, item)
|
|
466
466
|
);
|
|
467
467
|
compilation.factorizeQueue.hooks.result.tap(PLUGIN_NAME, factorizeDone);
|
|
468
468
|
|
|
469
|
-
compilation.addModuleQueue.hooks.added.tap(PLUGIN_NAME, item =>
|
|
469
|
+
compilation.addModuleQueue.hooks.added.tap(PLUGIN_NAME, (item) =>
|
|
470
470
|
moduleAdd(compilation.addModuleQueue, item)
|
|
471
471
|
);
|
|
472
472
|
compilation.processDependenciesQueue.hooks.result.tap(
|
|
@@ -487,7 +487,7 @@ class ProgressPlugin {
|
|
|
487
487
|
const requiredLoaders = new Set();
|
|
488
488
|
NormalModule.getCompilationHooks(compilation).beforeLoaders.tap(
|
|
489
489
|
PLUGIN_NAME,
|
|
490
|
-
loaders => {
|
|
490
|
+
(loaders) => {
|
|
491
491
|
for (const loader of loaders) {
|
|
492
492
|
if (
|
|
493
493
|
loader.type !== "module" &&
|
package/lib/ProvidePlugin.js
CHANGED
|
@@ -74,7 +74,7 @@ class ProvidePlugin {
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
parser.hooks.expression.for(name).tap(PLUGIN_NAME, expr => {
|
|
77
|
+
parser.hooks.expression.for(name).tap(PLUGIN_NAME, (expr) => {
|
|
78
78
|
const nameIdentifier = name.includes(".")
|
|
79
79
|
? `__webpack_provided_${name.replace(/\./g, "_dot_")}`
|
|
80
80
|
: name;
|
|
@@ -89,7 +89,7 @@ class ProvidePlugin {
|
|
|
89
89
|
return true;
|
|
90
90
|
});
|
|
91
91
|
|
|
92
|
-
parser.hooks.call.for(name).tap(PLUGIN_NAME, expr => {
|
|
92
|
+
parser.hooks.call.for(name).tap(PLUGIN_NAME, (expr) => {
|
|
93
93
|
const nameIdentifier = name.includes(".")
|
|
94
94
|
? `__webpack_provided_${name.replace(/\./g, "_dot_")}`
|
|
95
95
|
: name;
|
package/lib/RecordIdsPlugin.js
CHANGED
|
@@ -63,14 +63,14 @@ class RecordIdsPlugin {
|
|
|
63
63
|
* @param {Module} module the module
|
|
64
64
|
* @returns {string} the (portable) identifier
|
|
65
65
|
*/
|
|
66
|
-
const getModuleIdentifier = module => {
|
|
66
|
+
const getModuleIdentifier = (module) => {
|
|
67
67
|
if (portableIds) {
|
|
68
68
|
return makePathsRelative(module.identifier());
|
|
69
69
|
}
|
|
70
70
|
return module.identifier();
|
|
71
71
|
};
|
|
72
72
|
|
|
73
|
-
compiler.hooks.compilation.tap(PLUGIN_NAME, compilation => {
|
|
73
|
+
compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
|
|
74
74
|
compilation.hooks.recordModules.tap(PLUGIN_NAME, (modules, records) => {
|
|
75
75
|
const chunkGraph = compilation.chunkGraph;
|
|
76
76
|
if (!records.modules) records.modules = {};
|
|
@@ -112,7 +112,7 @@ class RecordIdsPlugin {
|
|
|
112
112
|
* @param {Chunk} chunk the chunk
|
|
113
113
|
* @returns {string[]} sources of the chunk
|
|
114
114
|
*/
|
|
115
|
-
const getChunkSources = chunk => {
|
|
115
|
+
const getChunkSources = (chunk) => {
|
|
116
116
|
/** @type {string[]} */
|
|
117
117
|
const sources = [];
|
|
118
118
|
for (const chunkGroup of chunk.groupsIterable) {
|
package/lib/ResolverFactory.js
CHANGED
|
@@ -36,7 +36,7 @@ const EMPTY_RESOLVE_OPTIONS = {};
|
|
|
36
36
|
* @param {ResolveOptionsWithDependencyType} resolveOptionsWithDepType enhanced options
|
|
37
37
|
* @returns {ResolveOptions} merged options
|
|
38
38
|
*/
|
|
39
|
-
const convertToResolveOptions = resolveOptionsWithDepType => {
|
|
39
|
+
const convertToResolveOptions = (resolveOptionsWithDepType) => {
|
|
40
40
|
const { dependencyType, plugins, ...remaining } = resolveOptionsWithDepType;
|
|
41
41
|
|
|
42
42
|
// check type compat
|
|
@@ -46,7 +46,7 @@ const convertToResolveOptions = resolveOptionsWithDepType => {
|
|
|
46
46
|
plugins:
|
|
47
47
|
plugins &&
|
|
48
48
|
/** @type {ResolvePluginInstance[]} */ (
|
|
49
|
-
plugins.filter(item => item !== "...")
|
|
49
|
+
plugins.filter((item) => item !== "...")
|
|
50
50
|
)
|
|
51
51
|
};
|
|
52
52
|
|
|
@@ -142,7 +142,7 @@ module.exports = class ResolverFactory {
|
|
|
142
142
|
}
|
|
143
143
|
/** @type {WeakMap<Partial<ResolveOptionsWithDependencyType>, ResolverWithOptions>} */
|
|
144
144
|
const childCache = new WeakMap();
|
|
145
|
-
resolver.withOptions = options => {
|
|
145
|
+
resolver.withOptions = (options) => {
|
|
146
146
|
const cacheEntry = childCache.get(options);
|
|
147
147
|
if (cacheEntry !== undefined) return cacheEntry;
|
|
148
148
|
const mergedOptions = cachedCleverMerge(originalResolveOptions, options);
|
package/lib/RuntimeGlobals.js
CHANGED
|
@@ -109,6 +109,26 @@ module.exports.ensureChunkIncludeEntries =
|
|
|
109
109
|
*/
|
|
110
110
|
module.exports.entryModuleId = "__webpack_require__.s";
|
|
111
111
|
|
|
112
|
+
/**
|
|
113
|
+
* esm module id
|
|
114
|
+
*/
|
|
115
|
+
module.exports.esmId = "__webpack_esm_id__";
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* esm module ids
|
|
119
|
+
*/
|
|
120
|
+
module.exports.esmIds = "__webpack_esm_ids__";
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* esm modules
|
|
124
|
+
*/
|
|
125
|
+
module.exports.esmModules = "__webpack_esm_modules__";
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* esm runtime
|
|
129
|
+
*/
|
|
130
|
+
module.exports.esmRuntime = "__webpack_esm_runtime__";
|
|
131
|
+
|
|
112
132
|
/**
|
|
113
133
|
* the internal exports object
|
|
114
134
|
*/
|
package/lib/RuntimePlugin.js
CHANGED
|
@@ -118,13 +118,13 @@ class RuntimePlugin {
|
|
|
118
118
|
* @returns {void}
|
|
119
119
|
*/
|
|
120
120
|
apply(compiler) {
|
|
121
|
-
compiler.hooks.compilation.tap(PLUGIN_NAME, compilation => {
|
|
121
|
+
compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
|
|
122
122
|
const globalChunkLoading = compilation.outputOptions.chunkLoading;
|
|
123
123
|
/**
|
|
124
124
|
* @param {Chunk} chunk chunk
|
|
125
125
|
* @returns {boolean} true, when chunk loading is disabled for the chunk
|
|
126
126
|
*/
|
|
127
|
-
const isChunkLoadingDisabledForChunk = chunk => {
|
|
127
|
+
const isChunkLoadingDisabledForChunk = (chunk) => {
|
|
128
128
|
const options = chunk.getEntryOptions();
|
|
129
129
|
const chunkLoading =
|
|
130
130
|
options && options.chunkLoading !== undefined
|
|
@@ -168,7 +168,7 @@ class RuntimePlugin {
|
|
|
168
168
|
}
|
|
169
169
|
compilation.hooks.runtimeRequirementInTree
|
|
170
170
|
.for(RuntimeGlobals.definePropertyGetters)
|
|
171
|
-
.tap(PLUGIN_NAME, chunk => {
|
|
171
|
+
.tap(PLUGIN_NAME, (chunk) => {
|
|
172
172
|
compilation.addRuntimeModule(
|
|
173
173
|
chunk,
|
|
174
174
|
new DefinePropertyGettersRuntimeModule()
|
|
@@ -177,7 +177,7 @@ class RuntimePlugin {
|
|
|
177
177
|
});
|
|
178
178
|
compilation.hooks.runtimeRequirementInTree
|
|
179
179
|
.for(RuntimeGlobals.makeNamespaceObject)
|
|
180
|
-
.tap(PLUGIN_NAME, chunk => {
|
|
180
|
+
.tap(PLUGIN_NAME, (chunk) => {
|
|
181
181
|
compilation.addRuntimeModule(
|
|
182
182
|
chunk,
|
|
183
183
|
new MakeNamespaceObjectRuntimeModule()
|
|
@@ -186,7 +186,7 @@ class RuntimePlugin {
|
|
|
186
186
|
});
|
|
187
187
|
compilation.hooks.runtimeRequirementInTree
|
|
188
188
|
.for(RuntimeGlobals.createFakeNamespaceObject)
|
|
189
|
-
.tap(PLUGIN_NAME, chunk => {
|
|
189
|
+
.tap(PLUGIN_NAME, (chunk) => {
|
|
190
190
|
compilation.addRuntimeModule(
|
|
191
191
|
chunk,
|
|
192
192
|
new CreateFakeNamespaceObjectRuntimeModule()
|
|
@@ -206,7 +206,7 @@ class RuntimePlugin {
|
|
|
206
206
|
});
|
|
207
207
|
compilation.hooks.runtimeRequirementInTree
|
|
208
208
|
.for(RuntimeGlobals.hasOwnProperty)
|
|
209
|
-
.tap(PLUGIN_NAME, chunk => {
|
|
209
|
+
.tap(PLUGIN_NAME, (chunk) => {
|
|
210
210
|
compilation.addRuntimeModule(
|
|
211
211
|
chunk,
|
|
212
212
|
new HasOwnPropertyRuntimeModule()
|
|
@@ -215,7 +215,7 @@ class RuntimePlugin {
|
|
|
215
215
|
});
|
|
216
216
|
compilation.hooks.runtimeRequirementInTree
|
|
217
217
|
.for(RuntimeGlobals.compatGetDefaultExport)
|
|
218
|
-
.tap(PLUGIN_NAME, chunk => {
|
|
218
|
+
.tap(PLUGIN_NAME, (chunk) => {
|
|
219
219
|
compilation.addRuntimeModule(
|
|
220
220
|
chunk,
|
|
221
221
|
new CompatGetDefaultExportRuntimeModule()
|
|
@@ -224,7 +224,7 @@ class RuntimePlugin {
|
|
|
224
224
|
});
|
|
225
225
|
compilation.hooks.runtimeRequirementInTree
|
|
226
226
|
.for(RuntimeGlobals.runtimeId)
|
|
227
|
-
.tap(PLUGIN_NAME, chunk => {
|
|
227
|
+
.tap(PLUGIN_NAME, (chunk) => {
|
|
228
228
|
compilation.addRuntimeModule(chunk, new RuntimeIdRuntimeModule());
|
|
229
229
|
return true;
|
|
230
230
|
});
|
|
@@ -259,13 +259,13 @@ class RuntimePlugin {
|
|
|
259
259
|
});
|
|
260
260
|
compilation.hooks.runtimeRequirementInTree
|
|
261
261
|
.for(RuntimeGlobals.global)
|
|
262
|
-
.tap(PLUGIN_NAME, chunk => {
|
|
262
|
+
.tap(PLUGIN_NAME, (chunk) => {
|
|
263
263
|
compilation.addRuntimeModule(chunk, new GlobalRuntimeModule());
|
|
264
264
|
return true;
|
|
265
265
|
});
|
|
266
266
|
compilation.hooks.runtimeRequirementInTree
|
|
267
267
|
.for(RuntimeGlobals.asyncModule)
|
|
268
|
-
.tap(PLUGIN_NAME, chunk => {
|
|
268
|
+
.tap(PLUGIN_NAME, (chunk) => {
|
|
269
269
|
const experiments = compilation.options.experiments;
|
|
270
270
|
compilation.addRuntimeModule(
|
|
271
271
|
chunk,
|
|
@@ -275,7 +275,7 @@ class RuntimePlugin {
|
|
|
275
275
|
});
|
|
276
276
|
compilation.hooks.runtimeRequirementInTree
|
|
277
277
|
.for(RuntimeGlobals.systemContext)
|
|
278
|
-
.tap(PLUGIN_NAME, chunk => {
|
|
278
|
+
.tap(PLUGIN_NAME, (chunk) => {
|
|
279
279
|
const entryOptions = chunk.getEntryOptions();
|
|
280
280
|
const libraryType =
|
|
281
281
|
entryOptions && entryOptions.library !== undefined
|
|
@@ -308,7 +308,7 @@ class RuntimePlugin {
|
|
|
308
308
|
"javascript",
|
|
309
309
|
"javascript",
|
|
310
310
|
RuntimeGlobals.getChunkScriptFilename,
|
|
311
|
-
chunk =>
|
|
311
|
+
(chunk) =>
|
|
312
312
|
getJavascriptModulesPlugin().chunkHasJs(chunk, chunkGraph) &&
|
|
313
313
|
/** @type {TemplatePath} */ (
|
|
314
314
|
chunk.filenameTemplate ||
|
|
@@ -338,7 +338,7 @@ class RuntimePlugin {
|
|
|
338
338
|
"css",
|
|
339
339
|
"css",
|
|
340
340
|
RuntimeGlobals.getChunkCssFilename,
|
|
341
|
-
chunk =>
|
|
341
|
+
(chunk) =>
|
|
342
342
|
getCssModulesPlugin().chunkHasCss(chunk, chunkGraph) &&
|
|
343
343
|
getChunkFilenameTemplate(chunk, compilation.outputOptions),
|
|
344
344
|
set.has(RuntimeGlobals.hmrDownloadUpdateHandlers)
|
|
@@ -363,7 +363,7 @@ class RuntimePlugin {
|
|
|
363
363
|
"javascript",
|
|
364
364
|
"javascript update",
|
|
365
365
|
RuntimeGlobals.getChunkUpdateScriptFilename,
|
|
366
|
-
_chunk =>
|
|
366
|
+
(_chunk) =>
|
|
367
367
|
/** @type {NonNullable<OutputNormalized["hotUpdateChunkFilename"]>} */
|
|
368
368
|
(compilation.outputOptions.hotUpdateChunkFilename),
|
|
369
369
|
true
|
|
@@ -480,7 +480,7 @@ class RuntimePlugin {
|
|
|
480
480
|
});
|
|
481
481
|
compilation.hooks.runtimeRequirementInTree
|
|
482
482
|
.for(RuntimeGlobals.baseURI)
|
|
483
|
-
.tap(PLUGIN_NAME, chunk => {
|
|
483
|
+
.tap(PLUGIN_NAME, (chunk) => {
|
|
484
484
|
if (isChunkLoadingDisabledForChunk(chunk)) {
|
|
485
485
|
compilation.addRuntimeModule(chunk, new BaseUriRuntimeModule());
|
|
486
486
|
return true;
|
|
@@ -488,7 +488,7 @@ class RuntimePlugin {
|
|
|
488
488
|
});
|
|
489
489
|
compilation.hooks.runtimeRequirementInTree
|
|
490
490
|
.for(RuntimeGlobals.scriptNonce)
|
|
491
|
-
.tap(PLUGIN_NAME, chunk => {
|
|
491
|
+
.tap(PLUGIN_NAME, (chunk) => {
|
|
492
492
|
compilation.addRuntimeModule(chunk, new NonceRuntimeModule());
|
|
493
493
|
return true;
|
|
494
494
|
});
|