webpack 5.101.3 → 5.102.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 +21 -26
- package/lib/APIPlugin.js +30 -36
- package/lib/AsyncDependenciesBlock.js +1 -4
- package/lib/BannerPlugin.js +0 -1
- package/lib/Cache.js +7 -6
- package/lib/CacheFacade.js +0 -1
- package/lib/Chunk.js +49 -31
- package/lib/ChunkGraph.js +37 -27
- package/lib/ChunkGroup.js +8 -10
- package/lib/ChunkTemplate.js +1 -1
- package/lib/CleanPlugin.js +3 -3
- package/lib/CodeGenerationResults.js +3 -2
- package/lib/CompatibilityPlugin.js +29 -12
- package/lib/Compilation.js +209 -196
- package/lib/Compiler.js +36 -35
- package/lib/ConcatenationScope.js +6 -1
- package/lib/ConditionalInitFragment.js +1 -1
- package/lib/ConstPlugin.js +6 -5
- package/lib/ContextExclusionPlugin.js +0 -1
- package/lib/ContextModule.js +25 -21
- package/lib/ContextModuleFactory.js +30 -11
- package/lib/ContextReplacementPlugin.js +38 -15
- package/lib/DefinePlugin.js +5 -9
- package/lib/DelegatedModule.js +7 -11
- package/lib/DependenciesBlock.js +0 -2
- package/lib/Dependency.js +9 -11
- package/lib/DependencyTemplates.js +2 -4
- package/lib/DllModule.js +1 -7
- package/lib/DllReferencePlugin.js +2 -4
- package/lib/DynamicEntryPlugin.js +0 -2
- package/lib/EntryOptionPlugin.js +0 -5
- package/lib/EnvironmentNotSupportAsyncWarning.js +0 -3
- package/lib/EvalDevToolModulePlugin.js +4 -3
- package/lib/EvalSourceMapDevToolPlugin.js +3 -4
- package/lib/ExportsInfo.js +50 -49
- package/lib/ExternalModule.js +84 -52
- package/lib/ExternalModuleFactoryPlugin.js +27 -7
- package/lib/ExternalsPlugin.js +24 -17
- package/lib/FileSystemInfo.js +105 -90
- package/lib/FlagDependencyUsagePlugin.js +3 -4
- package/lib/Generator.js +2 -13
- package/lib/GraphHelpers.js +0 -3
- package/lib/HookWebpackError.js +0 -2
- package/lib/HotModuleReplacementPlugin.js +22 -24
- package/lib/HotUpdateChunk.js +0 -3
- package/lib/IgnorePlugin.js +5 -2
- package/lib/InitFragment.js +41 -29
- package/lib/InvalidDependenciesModuleWarning.js +0 -1
- package/lib/LibManifestPlugin.js +4 -6
- package/lib/LoaderOptionsPlugin.js +1 -10
- package/lib/MainTemplate.js +8 -19
- package/lib/Module.js +32 -20
- package/lib/ModuleFactory.js +1 -1
- package/lib/ModuleFilenameHelpers.js +42 -25
- package/lib/ModuleGraph.js +30 -16
- package/lib/ModuleInfoHeaderPlugin.js +0 -1
- package/lib/ModuleTemplate.js +0 -2
- package/lib/ModuleTypeConstants.js +11 -1
- package/lib/MultiCompiler.js +23 -15
- package/lib/MultiWatching.js +6 -10
- package/lib/NodeStuffPlugin.js +2 -10
- package/lib/NormalModule.js +146 -89
- package/lib/NormalModuleFactory.js +132 -42
- package/lib/OptionsApply.js +1 -1
- package/lib/Parser.js +1 -1
- package/lib/ProgressPlugin.js +6 -10
- package/lib/ProvidePlugin.js +5 -7
- package/lib/RawModule.js +1 -6
- package/lib/RecordIdsPlugin.js +10 -6
- package/lib/ResolverFactory.js +0 -2
- package/lib/RuntimeGlobals.js +5 -0
- package/lib/RuntimeModule.js +1 -3
- package/lib/RuntimePlugin.js +26 -22
- package/lib/RuntimeTemplate.js +22 -12
- package/lib/SourceMapDevToolModuleOptionsPlugin.js +2 -2
- package/lib/SourceMapDevToolPlugin.js +11 -18
- package/lib/Stats.js +0 -1
- package/lib/Template.js +6 -11
- package/lib/TemplatedPathPlugin.js +2 -1
- package/lib/WatchIgnorePlugin.js +2 -3
- package/lib/Watching.js +15 -15
- package/lib/WebpackIsIncludedPlugin.js +0 -2
- package/lib/WebpackOptionsApply.js +74 -107
- package/lib/asset/AssetBytesGenerator.js +167 -0
- package/lib/asset/AssetBytesParser.js +37 -0
- package/lib/asset/AssetGenerator.js +22 -37
- package/lib/asset/AssetModulesPlugin.js +34 -16
- package/lib/asset/AssetParser.js +7 -3
- package/lib/asset/AssetSourceGenerator.js +1 -1
- package/lib/asset/RawDataUrlModule.js +3 -2
- package/lib/async-modules/AsyncModuleHelpers.js +6 -4
- package/lib/buildChunkGraph.js +0 -1
- package/lib/cache/MemoryCachePlugin.js +0 -2
- package/lib/cache/MemoryWithGcCachePlugin.js +0 -2
- package/lib/cache/PackFileCacheStrategy.js +14 -1
- package/lib/cache/ResolverCachePlugin.js +9 -15
- package/lib/cache/getLazyHashedEtag.js +1 -1
- package/lib/config/browserslistTargetHandler.js +77 -76
- package/lib/config/defaults.js +162 -23
- package/lib/config/normalization.js +18 -3
- package/lib/config/target.js +1 -1
- package/lib/container/ContainerEntryDependency.js +0 -1
- package/lib/container/ContainerEntryModule.js +3 -7
- package/lib/container/ContainerPlugin.js +1 -2
- package/lib/container/ContainerReferencePlugin.js +0 -1
- package/lib/container/FallbackDependency.js +2 -1
- package/lib/container/FallbackModule.js +6 -7
- package/lib/container/ModuleFederationPlugin.js +0 -1
- package/lib/container/RemoteModule.js +8 -8
- package/lib/container/RemoteRuntimeModule.js +2 -2
- package/lib/css/CssGenerator.js +3 -6
- package/lib/css/CssLoadingRuntimeModule.js +6 -9
- package/lib/css/CssModulesPlugin.js +13 -19
- package/lib/css/CssParser.js +3 -3
- package/lib/css/walkCssTokens.js +2 -2
- package/lib/debug/ProfilingPlugin.js +35 -8
- package/lib/dependencies/AMDDefineDependencyParserPlugin.js +12 -17
- package/lib/dependencies/AMDPlugin.js +2 -2
- package/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +1 -2
- package/lib/dependencies/CachedConstDependency.js +0 -4
- package/lib/dependencies/CommonJsExportRequireDependency.js +20 -14
- package/lib/dependencies/CommonJsExportsDependency.js +2 -1
- package/lib/dependencies/CommonJsExportsParserPlugin.js +20 -5
- package/lib/dependencies/CommonJsFullRequireDependency.js +6 -4
- package/lib/dependencies/CommonJsImportsParserPlugin.js +16 -7
- package/lib/dependencies/CommonJsRequireContextDependency.js +1 -1
- package/lib/dependencies/CommonJsSelfReferenceDependency.js +4 -4
- package/lib/dependencies/ConstDependency.js +2 -2
- package/lib/dependencies/ContextDependency.js +9 -4
- package/lib/dependencies/ContextDependencyHelpers.js +2 -2
- package/lib/dependencies/ContextDependencyTemplateAsId.js +9 -9
- package/lib/dependencies/ContextDependencyTemplateAsRequireCall.js +9 -9
- package/lib/dependencies/ContextElementDependency.js +22 -11
- package/lib/dependencies/CssIcssImportDependency.js +0 -2
- package/lib/dependencies/CssIcssSymbolDependency.js +2 -2
- package/lib/dependencies/CssImportDependency.js +0 -8
- package/lib/dependencies/CssLocalIdentifierDependency.js +4 -7
- package/lib/dependencies/CssSelfLocalIdentifierDependency.js +2 -2
- package/lib/dependencies/CssUrlDependency.js +0 -6
- package/lib/dependencies/ExportsInfoDependency.js +7 -9
- package/lib/dependencies/ExternalModuleDependency.js +0 -3
- package/lib/dependencies/ExternalModuleInitFragment.js +1 -1
- package/lib/dependencies/HarmonyAcceptDependency.js +1 -1
- package/lib/dependencies/HarmonyAcceptImportDependency.js +0 -4
- package/lib/dependencies/HarmonyCompatibilityDependency.js +0 -1
- package/lib/dependencies/HarmonyDetectionParserPlugin.js +0 -14
- package/lib/dependencies/HarmonyEvaluatedImportSpecifierDependency.js +3 -3
- package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +4 -1
- package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +29 -35
- package/lib/dependencies/HarmonyImportDependency.js +33 -14
- package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +20 -23
- package/lib/dependencies/HarmonyImportSideEffectDependency.js +0 -4
- package/lib/dependencies/HarmonyImportSpecifierDependency.js +46 -31
- package/lib/dependencies/HarmonyModulesPlugin.js +3 -3
- package/lib/dependencies/ImportContextDependency.js +13 -0
- package/lib/dependencies/ImportDependency.js +18 -6
- package/lib/dependencies/ImportEagerDependency.js +2 -3
- package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +8 -5
- package/lib/dependencies/ImportMetaContextPlugin.js +0 -1
- package/lib/dependencies/ImportMetaPlugin.js +3 -2
- package/lib/dependencies/ImportParserPlugin.js +288 -45
- package/lib/dependencies/ImportWeakDependency.js +2 -3
- package/lib/dependencies/JsonExportsDependency.js +0 -1
- package/lib/dependencies/LoaderDependency.js +0 -3
- package/lib/dependencies/LoaderImportDependency.js +0 -3
- package/lib/dependencies/LoaderPlugin.js +11 -5
- package/lib/dependencies/ModuleDecoratorDependency.js +2 -4
- package/lib/dependencies/ModuleDependency.js +3 -9
- package/lib/dependencies/NullDependency.js +2 -0
- package/lib/dependencies/ProvidedDependency.js +6 -8
- package/lib/dependencies/PureExpressionDependency.js +0 -1
- package/lib/dependencies/RequireEnsureDependenciesBlock.js +0 -1
- package/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin.js +1 -2
- package/lib/dependencies/RequireIncludeDependency.js +2 -2
- package/lib/dependencies/RequireResolveDependency.js +2 -2
- package/lib/dependencies/RuntimeRequirementsDependency.js +2 -3
- package/lib/dependencies/StaticExportsDependency.js +3 -5
- package/lib/dependencies/URLDependency.js +2 -7
- package/lib/dependencies/URLPlugin.js +1 -2
- package/lib/dependencies/WebAssemblyExportImportedDependency.js +2 -2
- package/lib/dependencies/WebAssemblyImportDependency.js +2 -2
- package/lib/dependencies/WebpackIsIncludedDependency.js +2 -3
- package/lib/dependencies/WorkerDependency.js +2 -3
- package/lib/dependencies/WorkerPlugin.js +4 -12
- package/lib/dependencies/processExportInfo.js +2 -3
- package/lib/esm/ModuleChunkFormatPlugin.js +0 -3
- package/lib/esm/ModuleChunkLoadingPlugin.js +2 -1
- package/lib/esm/ModuleChunkLoadingRuntimeModule.js +7 -7
- package/lib/hmr/LazyCompilationPlugin.js +6 -4
- package/lib/hmr/lazyCompilationBackend.js +13 -10
- package/lib/ids/DeterministicChunkIdsPlugin.js +0 -1
- package/lib/ids/HashedModuleIdsPlugin.js +5 -7
- package/lib/ids/IdHelpers.js +1 -1
- package/lib/ids/NamedChunkIdsPlugin.js +1 -6
- package/lib/ids/NamedModuleIdsPlugin.js +1 -5
- package/lib/ids/NaturalChunkIdsPlugin.js +0 -1
- package/lib/ids/NaturalModuleIdsPlugin.js +0 -1
- package/lib/ids/OccurrenceChunkIdsPlugin.js +0 -1
- package/lib/ids/OccurrenceModuleIdsPlugin.js +0 -1
- package/lib/ids/SyncModuleIdsPlugin.js +4 -3
- package/lib/index.js +8 -7
- package/lib/javascript/ArrayPushCallbackChunkFormatPlugin.js +4 -1
- package/lib/javascript/BasicEvaluatedExpression.js +13 -6
- package/lib/javascript/ChunkFormatHelpers.js +1 -1
- package/lib/javascript/CommonJsChunkFormatPlugin.js +0 -1
- package/lib/javascript/JavascriptGenerator.js +2 -3
- package/lib/javascript/JavascriptModulesPlugin.js +46 -24
- package/lib/javascript/JavascriptParser.js +120 -55
- package/lib/javascript/JavascriptParserHelpers.js +2 -2
- package/lib/javascript/StartupHelpers.js +2 -4
- package/lib/json/JsonData.js +1 -1
- package/lib/json/JsonGenerator.js +4 -5
- package/lib/json/JsonModulesPlugin.js +0 -3
- package/lib/json/JsonParser.js +4 -2
- package/lib/library/AbstractLibraryPlugin.js +2 -2
- package/lib/library/AmdLibraryPlugin.js +0 -1
- package/lib/library/AssignLibraryPlugin.js +23 -12
- package/lib/library/EnableLibraryPlugin.js +7 -11
- package/lib/library/ExportPropertyLibraryPlugin.js +8 -20
- package/lib/library/JsonpLibraryPlugin.js +5 -2
- package/lib/library/ModuleLibraryPlugin.js +88 -43
- package/lib/library/SystemLibraryPlugin.js +15 -6
- package/lib/library/UmdLibraryPlugin.js +12 -18
- package/lib/logging/Logger.js +12 -10
- package/lib/logging/createConsoleLogger.js +15 -14
- package/lib/logging/truncateArgs.js +1 -1
- package/lib/node/CommonJsChunkLoadingPlugin.js +2 -1
- package/lib/node/NodeWatchFileSystem.js +4 -4
- package/lib/node/ReadFileChunkLoadingRuntimeModule.js +2 -2
- package/lib/node/RequireChunkLoadingRuntimeModule.js +5 -2
- package/lib/node/nodeConsole.js +2 -2
- package/lib/optimize/AggressiveSplittingPlugin.js +2 -0
- package/lib/optimize/ConcatenatedModule.js +142 -100
- package/lib/optimize/InnerGraph.js +17 -11
- package/lib/optimize/InnerGraphPlugin.js +0 -3
- package/lib/optimize/ModuleConcatenationPlugin.js +3 -4
- package/lib/optimize/RealContentHashPlugin.js +5 -3
- package/lib/optimize/RuntimeChunkPlugin.js +0 -1
- package/lib/optimize/SideEffectsFlagPlugin.js +3 -10
- package/lib/optimize/SplitChunksPlugin.js +46 -40
- package/lib/performance/SizeLimitsPlugin.js +2 -1
- package/lib/prefetch/ChunkPrefetchFunctionRuntimeModule.js +5 -7
- package/lib/prefetch/ChunkPrefetchPreloadPlugin.js +0 -2
- package/lib/prefetch/ChunkPrefetchStartupRuntimeModule.js +0 -1
- package/lib/prefetch/ChunkPrefetchTriggerRuntimeModule.js +2 -2
- package/lib/prefetch/ChunkPreloadTriggerRuntimeModule.js +2 -2
- package/lib/rules/BasicMatcherRulePlugin.js +0 -2
- package/lib/rules/ObjectMatcherRulePlugin.js +0 -1
- package/lib/rules/RuleSetCompiler.js +8 -6
- package/lib/runtime/BaseUriRuntimeModule.js +2 -2
- package/lib/runtime/CompatRuntimeModule.js +0 -1
- package/lib/runtime/GetChunkFilenameRuntimeModule.js +8 -9
- package/lib/runtime/LoadScriptRuntimeModule.js +0 -2
- package/lib/runtime/MakeDeferredNamespaceObjectRuntime.js +1 -1
- package/lib/runtime/PublicPathRuntimeModule.js +2 -2
- package/lib/runtime/StartupEntrypointRuntimeModule.js +0 -1
- package/lib/runtime/SystemContextRuntimeModule.js +0 -2
- package/lib/runtime/ToBinaryRuntimeModule.js +64 -0
- package/lib/schemes/DataUriPlugin.js +2 -28
- package/lib/schemes/FileUriPlugin.js +5 -2
- package/lib/schemes/HttpUriPlugin.js +4 -2
- package/lib/schemes/VirtualUrlPlugin.js +11 -11
- package/lib/serialization/FileMiddleware.js +1 -1
- package/lib/serialization/NullPrototypeObjectSerializer.js +5 -3
- package/lib/serialization/ObjectMiddleware.js +31 -20
- package/lib/serialization/SerializerMiddleware.js +1 -3
- package/lib/serialization/types.js +1 -1
- package/lib/sharing/ConsumeSharedModule.js +3 -5
- package/lib/sharing/ConsumeSharedPlugin.js +2 -4
- package/lib/sharing/ConsumeSharedRuntimeModule.js +9 -6
- package/lib/sharing/ProvideSharedModule.js +3 -7
- package/lib/sharing/SharePlugin.js +0 -2
- package/lib/sharing/ShareRuntimeModule.js +4 -1
- package/lib/sharing/resolveMatchedConfigs.js +14 -6
- package/lib/sharing/utils.js +0 -6
- package/lib/stats/DefaultStatsFactoryPlugin.js +179 -95
- package/lib/stats/DefaultStatsPresetPlugin.js +15 -9
- package/lib/stats/DefaultStatsPrinterPlugin.js +77 -113
- package/lib/stats/StatsFactory.js +14 -11
- package/lib/url/URLParserPlugin.js +2 -4
- package/lib/util/ArrayHelpers.js +4 -4
- package/lib/util/AsyncQueue.js +1 -0
- package/lib/util/Hash.js +35 -5
- package/lib/util/LazySet.js +2 -2
- package/lib/util/StackedCacheMap.js +0 -2
- package/lib/util/TupleSet.js +9 -4
- package/lib/util/URLAbsoluteSpecifier.js +0 -1
- package/lib/util/WeakTupleMap.js +1 -1
- package/lib/util/chainedImports.js +3 -1
- package/lib/util/cleverMerge.js +15 -18
- package/lib/util/comparators.js +2 -4
- package/lib/util/compileBooleanMatcher.js +11 -9
- package/lib/util/concatenate.js +1 -2
- package/lib/util/create-schema-validation.js +1 -2
- package/lib/util/createHash.js +85 -15
- package/lib/util/dataURL.js +39 -0
- package/lib/util/deprecation.js +29 -31
- package/lib/util/deterministicGrouping.js +34 -30
- package/lib/util/extractSourceMap.js +319 -0
- package/lib/util/findGraphRoots.js +15 -5
- package/lib/util/fs.js +29 -8
- package/lib/util/hash/BatchedHash.js +47 -8
- package/lib/util/hash/wasm-hash.js +53 -13
- package/lib/util/semver.js +9 -8
- package/lib/util/smartGrouping.js +41 -26
- package/lib/util/traverseDestructuringAssignmentProperties.js +45 -0
- package/lib/wasm/EnableWasmLoadingPlugin.js +3 -2
- package/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js +5 -1
- package/lib/wasm-async/AsyncWebAssemblyJavascriptGenerator.js +2 -13
- package/lib/wasm-async/AsyncWebAssemblyModulesPlugin.js +2 -9
- package/lib/wasm-async/AsyncWebAssemblyParser.js +2 -10
- package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +6 -4
- package/lib/wasm-sync/WebAssemblyGenerator.js +1 -3
- package/lib/wasm-sync/WebAssemblyJavascriptGenerator.js +1 -4
- package/lib/wasm-sync/WebAssemblyModulesPlugin.js +2 -7
- package/lib/wasm-sync/WebAssemblyParser.js +1 -13
- package/lib/web/JsonpChunkLoadingPlugin.js +2 -1
- package/lib/web/JsonpChunkLoadingRuntimeModule.js +1 -1
- package/lib/web/JsonpTemplatePlugin.js +0 -1
- package/lib/webpack.js +21 -8
- package/lib/webworker/ImportScriptsChunkLoadingPlugin.js +2 -1
- package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +1 -1
- package/package.json +21 -21
- package/schemas/WebpackOptions.check.js +1 -1
- package/schemas/WebpackOptions.json +93 -96
- package/schemas/plugins/BannerPlugin.check.js +1 -1
- package/schemas/plugins/BannerPlugin.json +4 -0
- package/schemas/plugins/IgnorePlugin.json +1 -1
- package/schemas/plugins/ProgressPlugin.json +1 -1
- package/schemas/plugins/SourceMapDevToolPlugin.check.js +1 -1
- package/schemas/plugins/SourceMapDevToolPlugin.json +5 -1
- package/schemas/plugins/ids/HashedModuleIdsPlugin.check.d.ts +7 -0
- package/schemas/plugins/ids/HashedModuleIdsPlugin.check.js +6 -0
- package/schemas/plugins/{HashedModuleIdsPlugin.json → ids/HashedModuleIdsPlugin.json} +15 -2
- package/schemas/plugins/schemes/VirtualUrlPlugin.json +3 -3
- package/types.d.ts +1699 -706
- package/SECURITY.md +0 -9
- package/schemas/plugins/HashedModuleIdsPlugin.check.d.ts +0 -7
- package/schemas/plugins/HashedModuleIdsPlugin.check.js +0 -6
package/lib/logging/Logger.js
CHANGED
|
@@ -35,9 +35,11 @@ const LOG_SYMBOL = Symbol("webpack logger raw log method");
|
|
|
35
35
|
const TIMERS_SYMBOL = Symbol("webpack logger times");
|
|
36
36
|
const TIMERS_AGGREGATES_SYMBOL = Symbol("webpack logger aggregated times");
|
|
37
37
|
|
|
38
|
+
/** @typedef {EXPECTED_ANY[]} Args */
|
|
39
|
+
|
|
38
40
|
class WebpackLogger {
|
|
39
41
|
/**
|
|
40
|
-
* @param {(type: LogTypeEnum, args?:
|
|
42
|
+
* @param {(type: LogTypeEnum, args?: Args) => void} log log function
|
|
41
43
|
* @param {(name: string | (() => string)) => WebpackLogger} getChildLogger function to create child logger
|
|
42
44
|
*/
|
|
43
45
|
constructor(log, getChildLogger) {
|
|
@@ -46,35 +48,35 @@ class WebpackLogger {
|
|
|
46
48
|
}
|
|
47
49
|
|
|
48
50
|
/**
|
|
49
|
-
* @param {
|
|
51
|
+
* @param {Args} args args
|
|
50
52
|
*/
|
|
51
53
|
error(...args) {
|
|
52
54
|
this[LOG_SYMBOL](LogType.error, args);
|
|
53
55
|
}
|
|
54
56
|
|
|
55
57
|
/**
|
|
56
|
-
* @param {
|
|
58
|
+
* @param {Args} args args
|
|
57
59
|
*/
|
|
58
60
|
warn(...args) {
|
|
59
61
|
this[LOG_SYMBOL](LogType.warn, args);
|
|
60
62
|
}
|
|
61
63
|
|
|
62
64
|
/**
|
|
63
|
-
* @param {
|
|
65
|
+
* @param {Args} args args
|
|
64
66
|
*/
|
|
65
67
|
info(...args) {
|
|
66
68
|
this[LOG_SYMBOL](LogType.info, args);
|
|
67
69
|
}
|
|
68
70
|
|
|
69
71
|
/**
|
|
70
|
-
* @param {
|
|
72
|
+
* @param {Args} args args
|
|
71
73
|
*/
|
|
72
74
|
log(...args) {
|
|
73
75
|
this[LOG_SYMBOL](LogType.log, args);
|
|
74
76
|
}
|
|
75
77
|
|
|
76
78
|
/**
|
|
77
|
-
* @param {
|
|
79
|
+
* @param {Args} args args
|
|
78
80
|
*/
|
|
79
81
|
debug(...args) {
|
|
80
82
|
this[LOG_SYMBOL](LogType.debug, args);
|
|
@@ -82,7 +84,7 @@ class WebpackLogger {
|
|
|
82
84
|
|
|
83
85
|
/**
|
|
84
86
|
* @param {EXPECTED_ANY} assertion assertion
|
|
85
|
-
* @param {
|
|
87
|
+
* @param {Args} args args
|
|
86
88
|
*/
|
|
87
89
|
assert(assertion, ...args) {
|
|
88
90
|
if (!assertion) {
|
|
@@ -99,21 +101,21 @@ class WebpackLogger {
|
|
|
99
101
|
}
|
|
100
102
|
|
|
101
103
|
/**
|
|
102
|
-
* @param {
|
|
104
|
+
* @param {Args} args args
|
|
103
105
|
*/
|
|
104
106
|
status(...args) {
|
|
105
107
|
this[LOG_SYMBOL](LogType.status, args);
|
|
106
108
|
}
|
|
107
109
|
|
|
108
110
|
/**
|
|
109
|
-
* @param {
|
|
111
|
+
* @param {Args} args args
|
|
110
112
|
*/
|
|
111
113
|
group(...args) {
|
|
112
114
|
this[LOG_SYMBOL](LogType.group, args);
|
|
113
115
|
}
|
|
114
116
|
|
|
115
117
|
/**
|
|
116
|
-
* @param {
|
|
118
|
+
* @param {Args} args args
|
|
117
119
|
*/
|
|
118
120
|
groupCollapsed(...args) {
|
|
119
121
|
this[LOG_SYMBOL](LogType.groupCollapsed, args);
|
|
@@ -10,26 +10,27 @@ const { LogType } = require("./Logger");
|
|
|
10
10
|
/** @typedef {import("../../declarations/WebpackOptions").FilterItemTypes} FilterItemTypes */
|
|
11
11
|
/** @typedef {import("../../declarations/WebpackOptions").FilterTypes} FilterTypes */
|
|
12
12
|
/** @typedef {import("./Logger").LogTypeEnum} LogTypeEnum */
|
|
13
|
+
/** @typedef {import("./Logger").Args} Args */
|
|
13
14
|
|
|
14
15
|
/** @typedef {(item: string) => boolean} FilterFunction */
|
|
15
|
-
/** @typedef {(value: string, type: LogTypeEnum, args?:
|
|
16
|
+
/** @typedef {(value: string, type: LogTypeEnum, args?: Args) => void} LoggingFunction */
|
|
16
17
|
|
|
17
18
|
/**
|
|
18
19
|
* @typedef {object} LoggerConsole
|
|
19
20
|
* @property {() => void} clear
|
|
20
21
|
* @property {() => void} trace
|
|
21
|
-
* @property {(...args:
|
|
22
|
-
* @property {(...args:
|
|
23
|
-
* @property {(...args:
|
|
24
|
-
* @property {(...args:
|
|
25
|
-
* @property {(...args:
|
|
26
|
-
* @property {(...args:
|
|
27
|
-
* @property {(...args:
|
|
28
|
-
* @property {(...args:
|
|
29
|
-
* @property {(...args:
|
|
30
|
-
* @property {(...args:
|
|
31
|
-
* @property {(...args:
|
|
32
|
-
* @property {(...args:
|
|
22
|
+
* @property {(...args: Args) => void} info
|
|
23
|
+
* @property {(...args: Args) => void} log
|
|
24
|
+
* @property {(...args: Args) => void} warn
|
|
25
|
+
* @property {(...args: Args) => void} error
|
|
26
|
+
* @property {(...args: Args) => void=} debug
|
|
27
|
+
* @property {(...args: Args) => void=} group
|
|
28
|
+
* @property {(...args: Args) => void=} groupCollapsed
|
|
29
|
+
* @property {(...args: Args) => void=} groupEnd
|
|
30
|
+
* @property {(...args: Args) => void=} status
|
|
31
|
+
* @property {(...args: Args) => void=} profile
|
|
32
|
+
* @property {(...args: Args) => void=} profileEnd
|
|
33
|
+
* @property {(...args: Args) => void=} logTime
|
|
33
34
|
*/
|
|
34
35
|
|
|
35
36
|
/**
|
|
@@ -94,7 +95,7 @@ module.exports = ({ level = "info", debug = false, console }) => {
|
|
|
94
95
|
/**
|
|
95
96
|
* @param {string} name name of the logger
|
|
96
97
|
* @param {LogTypeEnum} type type of the log entry
|
|
97
|
-
* @param {
|
|
98
|
+
* @param {Args=} args arguments of the log entry
|
|
98
99
|
* @returns {void}
|
|
99
100
|
*/
|
|
100
101
|
const logger = (name, type, args) => {
|
|
@@ -10,6 +10,7 @@ const StartupChunkDependenciesPlugin = require("../runtime/StartupChunkDependenc
|
|
|
10
10
|
|
|
11
11
|
/** @typedef {import("../Chunk")} Chunk */
|
|
12
12
|
/** @typedef {import("../Compiler")} Compiler */
|
|
13
|
+
/** @typedef {import("../Module").RuntimeRequirements} RuntimeRequirements */
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* @typedef {object} CommonJsChunkLoadingPluginOptions
|
|
@@ -59,7 +60,7 @@ class CommonJsChunkLoadingPlugin {
|
|
|
59
60
|
const onceForChunkSet = new WeakSet();
|
|
60
61
|
/**
|
|
61
62
|
* @param {Chunk} chunk chunk
|
|
62
|
-
* @param {
|
|
63
|
+
* @param {RuntimeRequirements} set runtime requirements
|
|
63
64
|
*/
|
|
64
65
|
const handler = (chunk, set) => {
|
|
65
66
|
if (onceForChunkSet.has(chunk)) return;
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
const util = require("util");
|
|
9
9
|
const Watchpack = require("watchpack");
|
|
10
10
|
|
|
11
|
-
/** @typedef {import("../../declarations/WebpackOptions").WatchOptions} WatchOptions */
|
|
12
|
-
/** @typedef {import("../FileSystemInfo").FileSystemInfoEntry} FileSystemInfoEntry */
|
|
13
11
|
/** @typedef {import("../util/fs").InputFileSystem} InputFileSystem */
|
|
14
12
|
/** @typedef {import("../util/fs").WatchMethod} WatchMethod */
|
|
13
|
+
/** @typedef {import("../util/fs").Changes} Changes */
|
|
14
|
+
/** @typedef {import("../util/fs").Removals} Removals */
|
|
15
15
|
|
|
16
16
|
class NodeWatchFileSystem {
|
|
17
17
|
/**
|
|
@@ -78,8 +78,8 @@ class NodeWatchFileSystem {
|
|
|
78
78
|
this.watcher.once(
|
|
79
79
|
"aggregated",
|
|
80
80
|
/**
|
|
81
|
-
* @param {
|
|
82
|
-
* @param {
|
|
81
|
+
* @param {Changes} changes changes
|
|
82
|
+
* @param {Removals} removals removals
|
|
83
83
|
*/
|
|
84
84
|
(changes, removals) => {
|
|
85
85
|
// pause emitting events (avoids clearing aggregated changes and removals on timeout)
|
|
@@ -91,7 +91,7 @@ class ReadFileChunkLoadingRuntimeModule extends RuntimeModule {
|
|
|
91
91
|
);
|
|
92
92
|
const rootOutputDir = getUndoPath(
|
|
93
93
|
outputName,
|
|
94
|
-
|
|
94
|
+
compilation.outputOptions.path,
|
|
95
95
|
false
|
|
96
96
|
);
|
|
97
97
|
|
|
@@ -264,7 +264,7 @@ class ReadFileChunkLoadingRuntimeModule extends RuntimeModule {
|
|
|
264
264
|
Template.indent([
|
|
265
265
|
"if(err) {",
|
|
266
266
|
Template.indent([
|
|
267
|
-
'if(
|
|
267
|
+
'if(["MODULE_NOT_FOUND", "ENOENT"].includes(err.code)) return resolve();',
|
|
268
268
|
"return reject(err);"
|
|
269
269
|
]),
|
|
270
270
|
"}",
|
|
@@ -91,7 +91,7 @@ class RequireChunkLoadingRuntimeModule extends RuntimeModule {
|
|
|
91
91
|
);
|
|
92
92
|
const rootOutputDir = getUndoPath(
|
|
93
93
|
outputName,
|
|
94
|
-
|
|
94
|
+
compilation.outputOptions.path,
|
|
95
95
|
true
|
|
96
96
|
);
|
|
97
97
|
|
|
@@ -223,7 +223,10 @@ class RequireChunkLoadingRuntimeModule extends RuntimeModule {
|
|
|
223
223
|
RuntimeGlobals.getUpdateManifestFilename
|
|
224
224
|
}());`
|
|
225
225
|
]),
|
|
226
|
-
|
|
226
|
+
`}).catch(${runtimeTemplate.basicFunction("err", [
|
|
227
|
+
"if(['MODULE_NOT_FOUND', 'ENOENT'].includes(err.code)) return;",
|
|
228
|
+
"throw err;"
|
|
229
|
+
])});`
|
|
227
230
|
]),
|
|
228
231
|
"}"
|
|
229
232
|
])
|
package/lib/node/nodeConsole.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
const util = require("util");
|
|
9
9
|
const truncateArgs = require("../logging/truncateArgs");
|
|
10
10
|
|
|
11
|
-
/** @typedef {import("
|
|
11
|
+
/** @typedef {import("../config/defaults").InfrastructureLoggingNormalizedWithDefaults} InfrastructureLoggingNormalizedWithDefaults */
|
|
12
12
|
/** @typedef {import("../logging/createConsoleLogger").LoggerConsole} LoggerConsole */
|
|
13
13
|
|
|
14
14
|
/* eslint-disable no-console */
|
|
@@ -17,7 +17,7 @@ const truncateArgs = require("../logging/truncateArgs");
|
|
|
17
17
|
* @param {object} options options
|
|
18
18
|
* @param {boolean=} options.colors colors
|
|
19
19
|
* @param {boolean=} options.appendOnly append only
|
|
20
|
-
* @param {
|
|
20
|
+
* @param {InfrastructureLoggingNormalizedWithDefaults["stream"]} options.stream stream
|
|
21
21
|
* @returns {LoggerConsole} logger function
|
|
22
22
|
*/
|
|
23
23
|
module.exports = ({ colors, appendOnly, stream }) => {
|
|
@@ -16,6 +16,7 @@ const identifierUtils = require("../util/identifier");
|
|
|
16
16
|
|
|
17
17
|
/** @typedef {import("../../declarations/plugins/optimize/AggressiveSplittingPlugin").AggressiveSplittingPluginOptions} AggressiveSplittingPluginOptions */
|
|
18
18
|
/** @typedef {import("../Chunk")} Chunk */
|
|
19
|
+
/** @typedef {import("../Chunk").ChunkId} ChunkId */
|
|
19
20
|
/** @typedef {import("../ChunkGraph")} ChunkGraph */
|
|
20
21
|
/** @typedef {import("../Compiler")} Compiler */
|
|
21
22
|
/** @typedef {import("../Module")} Module */
|
|
@@ -127,6 +128,7 @@ class AggressiveSplittingPlugin {
|
|
|
127
128
|
}
|
|
128
129
|
|
|
129
130
|
// Check used chunk ids
|
|
131
|
+
/** @typedef {Set<ChunkId>} */
|
|
130
132
|
const usedIds = new Set();
|
|
131
133
|
for (const chunk of chunks) {
|
|
132
134
|
usedIds.add(chunk.id);
|