webpack 5.99.9 → 5.100.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/bin/webpack.js +8 -2
- package/hot/log.js +15 -15
- package/hot/poll.js +1 -0
- package/lib/APIPlugin.js +3 -3
- package/lib/AbstractMethodError.js +1 -0
- package/lib/AutomaticPrefetchPlugin.js +1 -0
- package/lib/BannerPlugin.js +1 -1
- package/lib/CaseSensitiveModulesWarning.js +4 -4
- package/lib/Chunk.js +6 -6
- package/lib/ChunkGraph.js +37 -31
- package/lib/ChunkGroup.js +4 -4
- package/lib/ChunkTemplate.js +1 -1
- package/lib/CleanPlugin.js +94 -17
- package/lib/CodeGenerationResults.js +1 -1
- package/lib/CompatibilityPlugin.js +5 -2
- package/lib/Compilation.js +67 -45
- package/lib/Compiler.js +46 -16
- package/lib/ConcatenationScope.js +15 -6
- package/lib/ConstPlugin.js +5 -3
- package/lib/ContextModule.js +16 -12
- package/lib/ContextModuleFactory.js +4 -3
- package/lib/ContextReplacementPlugin.js +4 -2
- package/lib/CssModule.js +2 -2
- package/lib/DefinePlugin.js +111 -3
- package/lib/DelegatedModuleFactoryPlugin.js +18 -18
- package/lib/Dependency.js +11 -4
- package/lib/DependencyTemplate.js +1 -0
- package/lib/DllEntryPlugin.js +3 -1
- package/lib/DllPlugin.js +4 -3
- package/lib/DllReferencePlugin.js +2 -2
- package/lib/DynamicEntryPlugin.js +1 -1
- package/lib/EntryOptionPlugin.js +5 -0
- package/lib/ErrorHelpers.js +4 -4
- package/lib/EvalDevToolModulePlugin.js +3 -3
- package/lib/EvalSourceMapDevToolPlugin.js +7 -7
- package/lib/ExportsInfo.js +48 -39
- package/lib/ExternalModule.js +15 -11
- package/lib/ExternalModuleFactoryPlugin.js +5 -2
- package/lib/FileSystemInfo.js +51 -36
- package/lib/FlagDependencyExportsPlugin.js +14 -7
- package/lib/FlagDependencyUsagePlugin.js +1 -1
- package/lib/Generator.js +14 -1
- package/lib/HookWebpackError.js +1 -0
- package/lib/HotModuleReplacementPlugin.js +77 -50
- package/lib/IgnorePlugin.js +5 -2
- package/lib/InvalidDependenciesModuleWarning.js +1 -1
- package/lib/JavascriptMetaInfoPlugin.js +0 -1
- package/lib/LibManifestPlugin.js +4 -2
- package/lib/LoaderOptionsPlugin.js +6 -4
- package/lib/MainTemplate.js +2 -2
- package/lib/Module.js +21 -6
- package/lib/ModuleFactory.js +1 -0
- package/lib/ModuleGraph.js +24 -2
- package/lib/ModuleGraphConnection.js +5 -5
- package/lib/ModuleInfoHeaderPlugin.js +2 -1
- package/lib/ModuleParseError.js +1 -0
- package/lib/ModuleSourceTypesConstants.js +12 -12
- package/lib/ModuleTemplate.js +1 -1
- package/lib/ModuleTypeConstants.js +21 -21
- package/lib/MultiCompiler.js +6 -6
- package/lib/NormalModule.js +31 -44
- package/lib/NormalModuleFactory.js +34 -20
- package/lib/NormalModuleReplacementPlugin.js +1 -1
- package/lib/NullFactory.js +1 -0
- package/lib/OptimizationStages.js +1 -1
- package/lib/Parser.js +1 -0
- package/lib/ProgressPlugin.js +12 -5
- package/lib/ProvidePlugin.js +5 -1
- package/lib/RawModule.js +14 -0
- package/lib/RecordIdsPlugin.js +3 -3
- package/lib/RuntimeGlobals.js +175 -155
- package/lib/RuntimeModule.js +1 -0
- package/lib/RuntimePlugin.js +33 -7
- package/lib/RuntimeTemplate.js +111 -11
- package/lib/SourceMapDevToolModuleOptionsPlugin.js +15 -25
- package/lib/SourceMapDevToolPlugin.js +19 -17
- package/lib/Template.js +2 -2
- package/lib/TemplatedPathPlugin.js +1 -1
- package/lib/WarnDeprecatedOptionPlugin.js +7 -8
- package/lib/WatchIgnorePlugin.js +4 -3
- package/lib/WebpackIsIncludedPlugin.js +2 -1
- package/lib/WebpackOptionsApply.js +115 -27
- package/lib/asset/AssetGenerator.js +15 -11
- package/lib/asset/AssetModulesPlugin.js +19 -17
- package/lib/asset/AssetSourceGenerator.js +4 -4
- package/lib/asset/RawDataUrlModule.js +4 -2
- package/lib/async-modules/AwaitDependenciesInitFragment.js +1 -1
- package/lib/buildChunkGraph.js +6 -3
- package/lib/cache/AddBuildDependenciesPlugin.js +5 -6
- package/lib/cache/IdleFileCachePlugin.js +7 -4
- package/lib/cache/MemoryCachePlugin.js +1 -0
- package/lib/cache/MemoryWithGcCachePlugin.js +1 -0
- package/lib/cache/PackFileCacheStrategy.js +26 -20
- package/lib/cache/ResolverCachePlugin.js +16 -8
- package/lib/cli.js +15 -10
- package/lib/config/browserslistTargetHandler.js +3 -3
- package/lib/config/defaults.js +25 -17
- package/lib/config/normalization.js +2 -1
- package/lib/config/target.js +6 -5
- package/lib/container/ContainerPlugin.js +1 -1
- package/lib/container/ContainerReferencePlugin.js +1 -1
- package/lib/container/FallbackModule.js +2 -1
- package/lib/container/HoistContainerReferencesPlugin.js +1 -1
- package/lib/container/ModuleFederationPlugin.js +2 -2
- package/lib/container/RemoteModule.js +1 -1
- package/lib/css/CssGenerator.js +9 -6
- package/lib/css/CssModulesPlugin.js +44 -31
- package/lib/css/CssParser.js +6 -4
- package/lib/css/walkCssTokens.js +33 -37
- package/lib/debug/ProfilingPlugin.js +6 -6
- package/lib/dependencies/AMDDefineDependencyParserPlugin.js +8 -8
- package/lib/dependencies/AMDPlugin.js +12 -8
- package/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +28 -26
- package/lib/dependencies/CachedConstDependency.js +1 -5
- package/lib/dependencies/CommonJsExportRequireDependency.js +6 -4
- package/lib/dependencies/CommonJsExportsParserPlugin.js +22 -25
- package/lib/dependencies/CommonJsFullRequireDependency.js +1 -9
- package/lib/dependencies/CommonJsImportsParserPlugin.js +100 -114
- package/lib/dependencies/CommonJsPlugin.js +15 -16
- package/lib/dependencies/ContextDependencyHelpers.js +2 -1
- package/lib/dependencies/ContextDependencyTemplateAsId.js +1 -0
- package/lib/dependencies/ContextDependencyTemplateAsRequireCall.js +1 -0
- package/lib/dependencies/CssIcssExportDependency.js +1 -1
- package/lib/dependencies/CssLocalIdentifierDependency.js +2 -2
- package/lib/dependencies/CssSelfLocalIdentifierDependency.js +2 -1
- package/lib/dependencies/DynamicExports.js +9 -9
- package/lib/dependencies/ExportsInfoDependency.js +1 -1
- package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +122 -101
- package/lib/dependencies/HarmonyExportExpressionDependency.js +1 -1
- package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +95 -19
- package/lib/dependencies/HarmonyExportInitFragment.js +1 -1
- package/lib/dependencies/HarmonyImportDependency.js +11 -5
- package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +238 -162
- package/lib/dependencies/HarmonyImportSideEffectDependency.js +4 -1
- package/lib/dependencies/HarmonyImportSpecifierDependency.js +20 -9
- package/lib/dependencies/HarmonyModulesPlugin.js +23 -12
- package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +1 -0
- package/lib/dependencies/ImportMetaContextPlugin.js +2 -1
- package/lib/dependencies/ImportMetaPlugin.js +2 -2
- package/lib/dependencies/ImportParserPlugin.js +40 -9
- package/lib/dependencies/ImportPlugin.js +3 -1
- package/lib/dependencies/LoaderPlugin.js +1 -0
- package/lib/dependencies/ModuleDependency.js +3 -1
- package/lib/dependencies/ModuleDependencyTemplateAsRequireId.js +1 -0
- package/lib/dependencies/RequireContextPlugin.js +3 -1
- package/lib/dependencies/RequireEnsurePlugin.js +6 -6
- package/lib/dependencies/RequireIncludeDependencyParserPlugin.js +33 -34
- package/lib/dependencies/RequireIncludePlugin.js +1 -0
- package/lib/dependencies/RuntimeRequirementsDependency.js +1 -1
- package/lib/dependencies/SystemPlugin.js +1 -1
- package/lib/dependencies/URLContextDependency.js +65 -0
- package/lib/dependencies/URLPlugin.js +17 -157
- package/lib/dependencies/WorkerPlugin.js +23 -10
- package/lib/dependencies/processExportInfo.js +2 -1
- package/lib/esm/ModuleChunkFormatPlugin.js +269 -185
- package/lib/esm/ModuleChunkLoadingPlugin.js +39 -1
- package/lib/esm/ModuleChunkLoadingRuntimeModule.js +70 -3
- package/lib/hmr/HotModuleReplacement.runtime.js +0 -1
- package/lib/hmr/HotModuleReplacementRuntimeModule.js +1 -1
- package/lib/hmr/JavascriptHotModuleReplacementHelper.js +37 -0
- package/lib/hmr/LazyCompilationPlugin.js +4 -2
- package/lib/hmr/lazyCompilationBackend.js +4 -2
- package/lib/ids/ChunkModuleIdRangePlugin.js +6 -3
- package/lib/ids/DeterministicChunkIdsPlugin.js +30 -35
- package/lib/ids/DeterministicModuleIdsPlugin.js +4 -3
- package/lib/ids/HashedModuleIdsPlugin.js +5 -4
- package/lib/ids/IdHelpers.js +21 -17
- package/lib/ids/NamedChunkIdsPlugin.js +5 -5
- package/lib/ids/NamedModuleIdsPlugin.js +4 -4
- package/lib/ids/NaturalChunkIdsPlugin.js +2 -1
- package/lib/ids/NaturalModuleIdsPlugin.js +1 -1
- package/lib/ids/OccurrenceChunkIdsPlugin.js +3 -2
- package/lib/ids/OccurrenceModuleIdsPlugin.js +1 -1
- package/lib/ids/SyncModuleIdsPlugin.js +1 -1
- package/lib/index.js +13 -3
- package/lib/javascript/ArrayPushCallbackChunkFormatPlugin.js +113 -119
- package/lib/javascript/BasicEvaluatedExpression.js +2 -1
- package/lib/javascript/ChunkHelpers.js +1 -0
- package/lib/javascript/CommonJsChunkFormatPlugin.js +121 -136
- package/lib/javascript/EnableChunkLoadingPlugin.js +6 -3
- package/lib/javascript/JavascriptGenerator.js +14 -2
- package/lib/javascript/JavascriptModulesPlugin.js +68 -27
- package/lib/javascript/JavascriptParser.js +117 -76
- package/lib/javascript/JavascriptParserHelpers.js +41 -41
- package/lib/javascript/StartupHelpers.js +17 -17
- package/lib/json/JsonGenerator.js +4 -2
- package/lib/json/JsonModulesPlugin.js +2 -2
- package/lib/json/JsonParser.js +1 -1
- package/lib/library/AbstractLibraryPlugin.js +6 -2
- package/lib/library/AssignLibraryPlugin.js +21 -6
- package/lib/library/EnableLibraryPlugin.js +23 -3
- package/lib/library/UmdLibraryPlugin.js +15 -6
- package/lib/logging/createConsoleLogger.js +3 -3
- package/lib/logging/runtime.js +9 -9
- package/lib/node/ReadFileChunkLoadingRuntimeModule.js +4 -22
- package/lib/node/RequireChunkLoadingRuntimeModule.js +4 -22
- package/lib/node/nodeConsole.js +4 -2
- package/lib/optimize/AggressiveMergingPlugin.js +45 -46
- package/lib/optimize/AggressiveSplittingPlugin.js +13 -12
- package/lib/optimize/ConcatenatedModule.js +227 -57
- package/lib/optimize/EnsureChunkConditionsPlugin.js +58 -58
- package/lib/optimize/FlagIncludedChunksPlugin.js +3 -1
- package/lib/optimize/InnerGraph.js +115 -112
- package/lib/optimize/InnerGraphPlugin.js +2 -2
- package/lib/optimize/LimitChunkCountPlugin.js +4 -2
- package/lib/optimize/MangleExportsPlugin.js +4 -3
- package/lib/optimize/MergeDuplicateChunksPlugin.js +80 -81
- package/lib/optimize/MinChunkSizePlugin.js +6 -3
- package/lib/optimize/ModuleConcatenationPlugin.js +31 -22
- package/lib/optimize/RealContentHashPlugin.js +26 -20
- package/lib/optimize/RemoveEmptyChunksPlugin.js +2 -1
- package/lib/optimize/RemoveParentModulesPlugin.js +1 -0
- package/lib/optimize/SideEffectsFlagPlugin.js +3 -2
- package/lib/optimize/SplitChunksPlugin.js +16 -13
- package/lib/rules/BasicEffectRulePlugin.js +4 -2
- package/lib/rules/BasicMatcherRulePlugin.js +3 -1
- package/lib/rules/ObjectMatcherRulePlugin.js +3 -1
- package/lib/rules/RuleSetCompiler.js +19 -5
- package/lib/rules/UseEffectRulePlugin.js +17 -9
- package/lib/runtime/AsyncModuleRuntimeModule.js +64 -9
- package/lib/runtime/CreateFakeNamespaceObjectRuntimeModule.js +1 -1
- package/lib/runtime/MakeDeferredNamespaceObjectRuntime.js +214 -0
- package/lib/runtime/RuntimeIdRuntimeModule.js +2 -1
- package/lib/runtime/StartupChunkDependenciesRuntimeModule.js +8 -7
- package/lib/schemes/FileUriPlugin.js +1 -1
- package/lib/schemes/HttpUriPlugin.js +27 -19
- package/lib/schemes/VirtualUrlPlugin.js +222 -0
- package/lib/serialization/AggregateErrorSerializer.js +1 -1
- package/lib/serialization/BinaryMiddleware.js +5 -4
- package/lib/serialization/FileMiddleware.js +7 -4
- package/lib/serialization/ObjectMiddleware.js +14 -8
- package/lib/serialization/Serializer.js +5 -3
- package/lib/serialization/SerializerMiddleware.js +2 -0
- package/lib/sharing/ConsumeSharedModule.js +1 -1
- package/lib/sharing/ConsumeSharedPlugin.js +3 -3
- package/lib/sharing/ConsumeSharedRuntimeModule.js +2 -2
- package/lib/sharing/ProvideSharedModule.js +1 -1
- package/lib/sharing/ProvideSharedPlugin.js +3 -2
- package/lib/sharing/SharePlugin.js +2 -1
- package/lib/sharing/ShareRuntimeModule.js +3 -5
- package/lib/sharing/utils.js +34 -34
- package/lib/stats/DefaultStatsFactoryPlugin.js +49 -46
- package/lib/stats/DefaultStatsPresetPlugin.js +13 -13
- package/lib/stats/DefaultStatsPrinterPlugin.js +15 -9
- package/lib/stats/StatsFactory.js +6 -3
- package/lib/stats/StatsPrinter.js +6 -7
- package/lib/url/URLParserPlugin.js +266 -0
- package/lib/util/ArrayQueue.js +1 -1
- package/lib/util/AsyncQueue.js +1 -1
- package/lib/util/Hash.js +2 -0
- package/lib/util/IterableHelpers.js +1 -1
- package/lib/util/LazyBucketSortedSet.js +2 -1
- package/lib/util/LazySet.js +11 -6
- package/lib/util/ParallelismFactorCalculator.js +1 -1
- package/lib/util/SetHelpers.js +3 -3
- package/lib/util/SortableSet.js +2 -2
- package/lib/util/StackedCacheMap.js +3 -1
- package/lib/util/StackedMap.js +2 -2
- package/lib/util/StringXor.js +1 -0
- package/lib/util/TupleSet.js +1 -0
- package/lib/util/URLAbsoluteSpecifier.js +1 -1
- package/lib/util/cleverMerge.js +95 -58
- package/lib/util/comparators.js +154 -127
- package/lib/util/compileBooleanMatcher.js +8 -3
- package/lib/util/concatenate.js +8 -7
- package/lib/util/conventions.js +72 -73
- package/lib/util/create-schema-validation.js +2 -1
- package/lib/util/createHash.js +10 -4
- package/lib/util/deprecation.js +69 -66
- package/lib/util/deterministicGrouping.js +4 -2
- package/lib/util/extractUrlAndGlobal.js +1 -1
- package/lib/util/findGraphRoots.js +2 -2
- package/lib/util/fs.js +30 -23
- package/lib/util/hash/md4.js +2 -2
- package/lib/util/hash/wasm-hash.js +4 -2
- package/lib/util/identifier.js +13 -12
- package/lib/util/internalSerializables.js +2 -0
- package/lib/util/magicComment.js +5 -5
- package/lib/util/processAsyncTree.js +1 -1
- package/lib/util/propertyAccess.js +1 -1
- package/lib/util/propertyName.js +1 -1
- package/lib/util/registerExternalSerializer.js +1 -2
- package/lib/util/removeBOM.js +1 -1
- package/lib/util/runtime.js +29 -21
- package/lib/util/semver.js +1 -1
- package/lib/util/serialization.js +3 -0
- package/lib/util/source.js +3 -2
- package/lib/validateSchema.js +1 -0
- package/lib/wasm/EnableWasmLoadingPlugin.js +6 -3
- package/lib/wasm-async/AsyncWebAssemblyJavascriptGenerator.js +4 -1
- package/lib/wasm-async/AsyncWebAssemblyModulesPlugin.js +46 -49
- package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +2 -2
- package/lib/wasm-sync/WebAssemblyGenerator.js +2 -3
- package/lib/wasm-sync/WebAssemblyInInitialChunkError.js +3 -2
- package/lib/wasm-sync/WebAssemblyJavascriptGenerator.js +3 -0
- package/lib/wasm-sync/WebAssemblyUtils.js +1 -1
- package/lib/web/JsonpChunkLoadingRuntimeModule.js +4 -22
- package/lib/webpack.js +4 -5
- package/lib/webworker/ImportScriptsChunkLoadingPlugin.js +1 -0
- package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +6 -24
- package/lib/webworker/WebWorkerTemplatePlugin.js +1 -0
- package/package.json +119 -113
- package/schemas/WebpackOptions.check.js +1 -1
- package/schemas/WebpackOptions.json +17 -0
- package/schemas/plugins/schemes/VirtualUrlPlugin.check.d.ts +7 -0
- package/schemas/plugins/schemes/VirtualUrlPlugin.check.js +6 -0
- package/schemas/plugins/schemes/VirtualUrlPlugin.json +77 -0
- package/types.d.ts +1243 -409
package/bin/webpack.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
3
5
|
/**
|
|
4
6
|
* @param {string} command process to run
|
|
5
7
|
* @param {string[]} args command line arguments
|
|
@@ -7,6 +9,7 @@
|
|
|
7
9
|
*/
|
|
8
10
|
const runCommand = (command, args) => {
|
|
9
11
|
const cp = require("child_process");
|
|
12
|
+
|
|
10
13
|
return new Promise((resolve, reject) => {
|
|
11
14
|
const executedCommand = cp.spawn(command, args, {
|
|
12
15
|
stdio: "inherit",
|
|
@@ -75,7 +78,9 @@ const isInstalled = packageName => {
|
|
|
75
78
|
*/
|
|
76
79
|
const runCli = cli => {
|
|
77
80
|
const path = require("path");
|
|
81
|
+
|
|
78
82
|
const pkgPath = require.resolve(`${cli.package}/package.json`);
|
|
83
|
+
|
|
79
84
|
const pkg = require(pkgPath);
|
|
80
85
|
|
|
81
86
|
if (pkg.type === "module" || /\.mjs/i.test(pkg.bin[cli.binName])) {
|
|
@@ -171,8 +176,9 @@ if (!cli.installed) {
|
|
|
171
176
|
);
|
|
172
177
|
|
|
173
178
|
runCommand(
|
|
174
|
-
/** @type {string} */
|
|
175
|
-
|
|
179
|
+
/** @type {string} */
|
|
180
|
+
(packageManager),
|
|
181
|
+
[...installOptions, cli.package]
|
|
176
182
|
)
|
|
177
183
|
.then(() => {
|
|
178
184
|
runCli(cli);
|
package/hot/log.js
CHANGED
|
@@ -45,6 +45,21 @@ module.exports = function (level, msg) {
|
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
+
/**
|
|
49
|
+
* @param {Error} err error
|
|
50
|
+
* @returns {string} formatted error
|
|
51
|
+
*/
|
|
52
|
+
module.exports.formatError = function (err) {
|
|
53
|
+
var message = err.message;
|
|
54
|
+
var stack = err.stack;
|
|
55
|
+
if (!stack) {
|
|
56
|
+
return message;
|
|
57
|
+
} else if (stack.indexOf(message) < 0) {
|
|
58
|
+
return message + "\n" + stack;
|
|
59
|
+
}
|
|
60
|
+
return stack;
|
|
61
|
+
};
|
|
62
|
+
|
|
48
63
|
var group = console.group || dummy;
|
|
49
64
|
var groupCollapsed = console.groupCollapsed || dummy;
|
|
50
65
|
var groupEnd = console.groupEnd || dummy;
|
|
@@ -61,18 +76,3 @@ module.exports.groupEnd = logGroup(groupEnd);
|
|
|
61
76
|
module.exports.setLogLevel = function (level) {
|
|
62
77
|
logLevel = level;
|
|
63
78
|
};
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* @param {Error} err error
|
|
67
|
-
* @returns {string} formatted error
|
|
68
|
-
*/
|
|
69
|
-
module.exports.formatError = function (err) {
|
|
70
|
-
var message = err.message;
|
|
71
|
-
var stack = err.stack;
|
|
72
|
-
if (!stack) {
|
|
73
|
-
return message;
|
|
74
|
-
} else if (stack.indexOf(message) < 0) {
|
|
75
|
-
return message + "\n" + stack;
|
|
76
|
-
}
|
|
77
|
-
return stack;
|
|
78
|
-
};
|
package/hot/poll.js
CHANGED
package/lib/APIPlugin.js
CHANGED
|
@@ -17,8 +17,8 @@ const ConstDependency = require("./dependencies/ConstDependency");
|
|
|
17
17
|
const BasicEvaluatedExpression = require("./javascript/BasicEvaluatedExpression");
|
|
18
18
|
const JavascriptModulesPlugin = require("./javascript/JavascriptModulesPlugin");
|
|
19
19
|
const {
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
evaluateToString,
|
|
21
|
+
toConstantDependency
|
|
22
22
|
} = require("./javascript/JavascriptParserHelpers");
|
|
23
23
|
const ChunkNameRuntimeModule = require("./runtime/ChunkNameRuntimeModule");
|
|
24
24
|
const GetFullHashRuntimeModule = require("./runtime/GetFullHashRuntimeModule");
|
|
@@ -179,7 +179,7 @@ class APIPlugin {
|
|
|
179
179
|
|
|
180
180
|
compilation.hooks.runtimeRequirementInTree
|
|
181
181
|
.for(RuntimeGlobals.getFullHash)
|
|
182
|
-
.tap(PLUGIN_NAME, (chunk,
|
|
182
|
+
.tap(PLUGIN_NAME, (chunk, _set) => {
|
|
183
183
|
compilation.addRuntimeModule(chunk, new GetFullHashRuntimeModule());
|
|
184
184
|
return true;
|
|
185
185
|
});
|
package/lib/BannerPlugin.js
CHANGED
|
@@ -20,7 +20,7 @@ const createSchemaValidation = require("./util/create-schema-validation");
|
|
|
20
20
|
|
|
21
21
|
const validate = createSchemaValidation(
|
|
22
22
|
/** @type {((value: typeof import("../schemas/plugins/BannerPlugin.json")) => boolean)} */
|
|
23
|
-
(require("../schemas/plugins/BannerPlugin.check
|
|
23
|
+
(require("../schemas/plugins/BannerPlugin.check")),
|
|
24
24
|
() => require("../schemas/plugins/BannerPlugin.json"),
|
|
25
25
|
{
|
|
26
26
|
name: "Banner Plugin",
|
|
@@ -35,9 +35,9 @@ const createModulesListMessage = (modules, moduleGraph) =>
|
|
|
35
35
|
modules
|
|
36
36
|
.map(m => {
|
|
37
37
|
let message = `* ${m.identifier()}`;
|
|
38
|
-
const validReasons =
|
|
39
|
-
moduleGraph.getIncomingConnectionsByOriginModule(m).keys()
|
|
40
|
-
|
|
38
|
+
const validReasons = [
|
|
39
|
+
...moduleGraph.getIncomingConnectionsByOriginModule(m).keys()
|
|
40
|
+
].filter(Boolean);
|
|
41
41
|
|
|
42
42
|
if (validReasons.length > 0) {
|
|
43
43
|
message += `\n Used by ${validReasons.length} module(s), i. e.`;
|
|
@@ -56,7 +56,7 @@ class CaseSensitiveModulesWarning extends WebpackError {
|
|
|
56
56
|
* @param {ModuleGraph} moduleGraph the module graph
|
|
57
57
|
*/
|
|
58
58
|
constructor(modules, moduleGraph) {
|
|
59
|
-
const sortedModules = sortModules(
|
|
59
|
+
const sortedModules = sortModules([...modules]);
|
|
60
60
|
const modulesList = createModulesListMessage(sortedModules, moduleGraph);
|
|
61
61
|
super(`There are multiple modules with names that only differ in casing.
|
|
62
62
|
This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
|
package/lib/Chunk.js
CHANGED
|
@@ -11,9 +11,9 @@ const { intersect } = require("./util/SetHelpers");
|
|
|
11
11
|
const SortableSet = require("./util/SortableSet");
|
|
12
12
|
const StringXor = require("./util/StringXor");
|
|
13
13
|
const {
|
|
14
|
-
compareModulesByIdentifier,
|
|
15
14
|
compareChunkGroupsByIndex,
|
|
16
|
-
compareModulesById
|
|
15
|
+
compareModulesById,
|
|
16
|
+
compareModulesByIdentifier
|
|
17
17
|
} = require("./util/comparators");
|
|
18
18
|
const { createArrayToSetDeprecationSet } = require("./util/deprecation");
|
|
19
19
|
const { mergeRuntime } = require("./util/runtime");
|
|
@@ -116,13 +116,13 @@ class Chunk {
|
|
|
116
116
|
// TODO remove in webpack 6
|
|
117
117
|
// BACKWARD-COMPAT START
|
|
118
118
|
get entryModule() {
|
|
119
|
-
const entryModules =
|
|
120
|
-
ChunkGraph.getChunkGraphForChunk(
|
|
119
|
+
const entryModules = [
|
|
120
|
+
...ChunkGraph.getChunkGraphForChunk(
|
|
121
121
|
this,
|
|
122
122
|
"Chunk.entryModule",
|
|
123
123
|
"DEP_WEBPACK_CHUNK_ENTRY_MODULE"
|
|
124
124
|
).getChunkEntryModulesIterable(this)
|
|
125
|
-
|
|
125
|
+
];
|
|
126
126
|
if (entryModules.length === 0) {
|
|
127
127
|
return undefined;
|
|
128
128
|
} else if (entryModules.length === 1) {
|
|
@@ -747,7 +747,7 @@ class Chunk {
|
|
|
747
747
|
}
|
|
748
748
|
}
|
|
749
749
|
if (chunkIdSet.size > 0) {
|
|
750
|
-
result[name] =
|
|
750
|
+
result[name] = [...chunkIdSet];
|
|
751
751
|
}
|
|
752
752
|
}
|
|
753
753
|
return result;
|
package/lib/ChunkGraph.js
CHANGED
|
@@ -12,21 +12,21 @@ const { DEFAULTS } = require("./config/defaults");
|
|
|
12
12
|
const { first } = require("./util/SetHelpers");
|
|
13
13
|
const SortableSet = require("./util/SortableSet");
|
|
14
14
|
const {
|
|
15
|
-
|
|
15
|
+
compareIds,
|
|
16
16
|
compareIterables,
|
|
17
|
+
compareModulesById,
|
|
17
18
|
compareModulesByIdentifier,
|
|
18
|
-
concatComparators,
|
|
19
19
|
compareSelect,
|
|
20
|
-
|
|
20
|
+
concatComparators
|
|
21
21
|
} = require("./util/comparators");
|
|
22
22
|
const createHash = require("./util/createHash");
|
|
23
23
|
const findGraphRoots = require("./util/findGraphRoots");
|
|
24
24
|
const {
|
|
25
25
|
RuntimeSpecMap,
|
|
26
26
|
RuntimeSpecSet,
|
|
27
|
-
|
|
27
|
+
forEachRuntime,
|
|
28
28
|
mergeRuntime,
|
|
29
|
-
|
|
29
|
+
runtimeToString
|
|
30
30
|
} = require("./util/runtime");
|
|
31
31
|
|
|
32
32
|
/** @typedef {import("./AsyncDependenciesBlock")} AsyncDependenciesBlock */
|
|
@@ -76,7 +76,7 @@ class ModuleHashInfo {
|
|
|
76
76
|
* @param {SortableSet<T>} set the set
|
|
77
77
|
* @returns {T[]} set as array
|
|
78
78
|
*/
|
|
79
|
-
const getArray = set =>
|
|
79
|
+
const getArray = set => [...set];
|
|
80
80
|
|
|
81
81
|
/**
|
|
82
82
|
* @param {SortableSet<Chunk>} chunks the chunks
|
|
@@ -141,7 +141,7 @@ const createOrderedArrayFunction = comparator => {
|
|
|
141
141
|
if (fn !== undefined) return fn;
|
|
142
142
|
fn = set => {
|
|
143
143
|
set.sortWith(comparator);
|
|
144
|
-
return
|
|
144
|
+
return [...set];
|
|
145
145
|
};
|
|
146
146
|
createOrderedArrayFunctionMap.set(comparator, fn);
|
|
147
147
|
return fn;
|
|
@@ -310,8 +310,8 @@ class ChunkGraph {
|
|
|
310
310
|
*/
|
|
311
311
|
_getGraphRoots(set) {
|
|
312
312
|
const { moduleGraph } = this;
|
|
313
|
-
return
|
|
314
|
-
findGraphRoots(set, module => {
|
|
313
|
+
return [
|
|
314
|
+
...findGraphRoots(set, module => {
|
|
315
315
|
/** @type {Set<Module>} */
|
|
316
316
|
const set = new Set();
|
|
317
317
|
/**
|
|
@@ -332,7 +332,7 @@ class ChunkGraph {
|
|
|
332
332
|
addDependencies(module);
|
|
333
333
|
return set;
|
|
334
334
|
})
|
|
335
|
-
|
|
335
|
+
].sort(compareModulesByIdentifier);
|
|
336
336
|
}
|
|
337
337
|
|
|
338
338
|
/**
|
|
@@ -420,8 +420,9 @@ class ChunkGraph {
|
|
|
420
420
|
*/
|
|
421
421
|
attachDependentHashModules(chunk, modules) {
|
|
422
422
|
const cgc = this._getChunkGraphChunk(chunk);
|
|
423
|
-
if (cgc.dependentHashModules === undefined)
|
|
423
|
+
if (cgc.dependentHashModules === undefined) {
|
|
424
424
|
cgc.dependentHashModules = new Set();
|
|
425
|
+
}
|
|
425
426
|
for (const module of modules) {
|
|
426
427
|
cgc.dependentHashModules.add(module);
|
|
427
428
|
}
|
|
@@ -1021,9 +1022,10 @@ class ChunkGraph {
|
|
|
1021
1022
|
this.connectChunkAndModule(chunkA, module);
|
|
1022
1023
|
}
|
|
1023
1024
|
|
|
1024
|
-
for (const [
|
|
1025
|
-
|
|
1026
|
-
|
|
1025
|
+
for (const [
|
|
1026
|
+
module,
|
|
1027
|
+
chunkGroup
|
|
1028
|
+
] of this.getChunkEntryModulesWithChunkGroupIterable(chunkB)) {
|
|
1027
1029
|
this.disconnectChunkAndEntryModule(chunkB, module);
|
|
1028
1030
|
this.connectChunkAndEntryModule(
|
|
1029
1031
|
chunkA,
|
|
@@ -1117,8 +1119,9 @@ class ChunkGraph {
|
|
|
1117
1119
|
*/
|
|
1118
1120
|
addDependentHashModuleToChunk(chunk, module) {
|
|
1119
1121
|
const cgc = this._getChunkGraphChunk(chunk);
|
|
1120
|
-
if (cgc.dependentHashModules === undefined)
|
|
1122
|
+
if (cgc.dependentHashModules === undefined) {
|
|
1121
1123
|
cgc.dependentHashModules = new Set();
|
|
1124
|
+
}
|
|
1122
1125
|
cgc.dependentHashModules.add(module);
|
|
1123
1126
|
}
|
|
1124
1127
|
|
|
@@ -1266,7 +1269,7 @@ class ChunkGraph {
|
|
|
1266
1269
|
*/
|
|
1267
1270
|
getChunkRuntimeModulesInOrder(chunk) {
|
|
1268
1271
|
const cgc = this._getChunkGraphChunk(chunk);
|
|
1269
|
-
const array =
|
|
1272
|
+
const array = [...cgc.runtimeModules];
|
|
1270
1273
|
array.sort(
|
|
1271
1274
|
concatComparators(
|
|
1272
1275
|
compareSelect(r => /** @type {RuntimeModule} */ (r).stage, compareIds),
|
|
@@ -1646,8 +1649,9 @@ Caller might not support runtime-dependent code generation (opt-out via optimiza
|
|
|
1646
1649
|
const module = connection.module;
|
|
1647
1650
|
stateInfo += module.getExportsType(this.moduleGraph, strict);
|
|
1648
1651
|
// cspell:word Tnamespace
|
|
1649
|
-
if (stateInfo === "Tnamespace")
|
|
1650
|
-
|
|
1652
|
+
if (stateInfo === "Tnamespace") {
|
|
1653
|
+
activeNamespaceModules.add(module);
|
|
1654
|
+
} else {
|
|
1651
1655
|
const oldModule = connectedModules.get(stateInfo);
|
|
1652
1656
|
if (oldModule === undefined) {
|
|
1653
1657
|
connectedModules.set(stateInfo, module);
|
|
@@ -1687,11 +1691,12 @@ Caller might not support runtime-dependent code generation (opt-out via optimiza
|
|
|
1687
1691
|
}
|
|
1688
1692
|
}
|
|
1689
1693
|
// cspell:word Tnamespace
|
|
1690
|
-
if (activeNamespaceModules.size === 0 && connectedModules.size === 0)
|
|
1694
|
+
if (activeNamespaceModules.size === 0 && connectedModules.size === 0) {
|
|
1691
1695
|
return graphHash;
|
|
1696
|
+
}
|
|
1692
1697
|
const connectedModulesInOrder =
|
|
1693
1698
|
connectedModules.size > 1
|
|
1694
|
-
?
|
|
1699
|
+
? [...connectedModules].sort(([a], [b]) => (a < b ? -1 : 1))
|
|
1695
1700
|
: connectedModules;
|
|
1696
1701
|
const hash = createHash(this._hashFunction);
|
|
1697
1702
|
/**
|
|
@@ -1712,22 +1717,21 @@ Caller might not support runtime-dependent code generation (opt-out via optimiza
|
|
|
1712
1717
|
const addModulesToHash = modules => {
|
|
1713
1718
|
let xor = ZERO_BIG_INT;
|
|
1714
1719
|
for (const m of modules) {
|
|
1715
|
-
xor
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
runtime
|
|
1721
|
-
);
|
|
1720
|
+
xor ^= this._getModuleGraphHashBigInt(
|
|
1721
|
+
this._getChunkGraphModule(m),
|
|
1722
|
+
m,
|
|
1723
|
+
runtime
|
|
1724
|
+
);
|
|
1722
1725
|
}
|
|
1723
1726
|
hash.update(xor.toString(16));
|
|
1724
1727
|
};
|
|
1725
|
-
if (activeNamespaceModules.size === 1)
|
|
1728
|
+
if (activeNamespaceModules.size === 1) {
|
|
1726
1729
|
addModuleToHash(
|
|
1727
1730
|
/** @type {Module} */ (activeNamespaceModules.values().next().value)
|
|
1728
1731
|
);
|
|
1729
|
-
else if (activeNamespaceModules.size > 1)
|
|
1732
|
+
} else if (activeNamespaceModules.size > 1) {
|
|
1730
1733
|
addModulesToHash(activeNamespaceModules);
|
|
1734
|
+
}
|
|
1731
1735
|
for (const [stateInfo, modules] of connectedModulesInOrder) {
|
|
1732
1736
|
hash.update(stateInfo);
|
|
1733
1737
|
if (modules instanceof Set) {
|
|
@@ -1767,12 +1771,13 @@ Caller might not support runtime-dependent code generation (opt-out via optimiza
|
|
|
1767
1771
|
*/
|
|
1768
1772
|
module => {
|
|
1769
1773
|
const chunkGraph = chunkGraphForModuleMap.get(module);
|
|
1770
|
-
if (!chunkGraph)
|
|
1774
|
+
if (!chunkGraph) {
|
|
1771
1775
|
throw new Error(
|
|
1772
1776
|
`${
|
|
1773
1777
|
deprecateMessage
|
|
1774
1778
|
}: There was no ChunkGraph assigned to the Module for backward-compat (Use the new API)`
|
|
1775
1779
|
);
|
|
1780
|
+
}
|
|
1776
1781
|
return chunkGraph;
|
|
1777
1782
|
},
|
|
1778
1783
|
`${deprecateMessage}: Use new ChunkGraph API`,
|
|
@@ -1818,12 +1823,13 @@ Caller might not support runtime-dependent code generation (opt-out via optimiza
|
|
|
1818
1823
|
*/
|
|
1819
1824
|
chunk => {
|
|
1820
1825
|
const chunkGraph = chunkGraphForChunkMap.get(chunk);
|
|
1821
|
-
if (!chunkGraph)
|
|
1826
|
+
if (!chunkGraph) {
|
|
1822
1827
|
throw new Error(
|
|
1823
1828
|
`${
|
|
1824
1829
|
deprecateMessage
|
|
1825
1830
|
}There was no ChunkGraph assigned to the Chunk for backward-compat (Use the new API)`
|
|
1826
1831
|
);
|
|
1832
|
+
}
|
|
1827
1833
|
return chunkGraph;
|
|
1828
1834
|
},
|
|
1829
1835
|
`${deprecateMessage}: Use new ChunkGraph API`,
|
package/lib/ChunkGroup.js
CHANGED
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
const util = require("util");
|
|
9
9
|
const SortableSet = require("./util/SortableSet");
|
|
10
10
|
const {
|
|
11
|
-
compareLocations,
|
|
12
11
|
compareChunks,
|
|
13
|
-
compareIterables
|
|
12
|
+
compareIterables,
|
|
13
|
+
compareLocations
|
|
14
14
|
} = require("./util/comparators");
|
|
15
15
|
|
|
16
16
|
/** @typedef {import("./AsyncDependenciesBlock")} AsyncDependenciesBlock */
|
|
@@ -40,7 +40,7 @@ let debugId = 5000;
|
|
|
40
40
|
* @param {SortableSet<T>} set set to convert to array.
|
|
41
41
|
* @returns {T[]} the array format of existing set
|
|
42
42
|
*/
|
|
43
|
-
const getArray = set =>
|
|
43
|
+
const getArray = set => [...set];
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
46
|
* A convenience method used to sort chunks based on their id's
|
|
@@ -436,7 +436,7 @@ class ChunkGroup {
|
|
|
436
436
|
}
|
|
437
437
|
}
|
|
438
438
|
|
|
439
|
-
return
|
|
439
|
+
return [...files];
|
|
440
440
|
}
|
|
441
441
|
|
|
442
442
|
/**
|
package/lib/ChunkTemplate.js
CHANGED
|
@@ -170,7 +170,7 @@ Object.defineProperty(ChunkTemplate.prototype, "outputOptions", {
|
|
|
170
170
|
* @this {ChunkTemplate}
|
|
171
171
|
* @returns {OutputOptions} output options
|
|
172
172
|
*/
|
|
173
|
-
function () {
|
|
173
|
+
function outputOptions() {
|
|
174
174
|
return this._outputOptions;
|
|
175
175
|
},
|
|
176
176
|
"ChunkTemplate.outputOptions is deprecated (use Compilation.outputOptions instead)",
|
package/lib/CleanPlugin.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
"use strict";
|
|
7
7
|
|
|
8
|
+
const path = require("path");
|
|
8
9
|
const asyncLib = require("neo-async");
|
|
9
10
|
const { SyncBailHook } = require("tapable");
|
|
10
11
|
const Compilation = require("./Compilation");
|
|
@@ -36,6 +37,7 @@ const validate = createSchemaValidation(
|
|
|
36
37
|
undefined,
|
|
37
38
|
() => {
|
|
38
39
|
const { definitions } = require("../schemas/WebpackOptions.json");
|
|
40
|
+
|
|
39
41
|
return {
|
|
40
42
|
definitions,
|
|
41
43
|
oneOf: [{ $ref: "#/definitions/CleanOptions" }]
|
|
@@ -61,6 +63,62 @@ const mergeAssets = (as1, as2) => {
|
|
|
61
63
|
}
|
|
62
64
|
};
|
|
63
65
|
|
|
66
|
+
/**
|
|
67
|
+
* @param {Map<string, number>} assets current assets
|
|
68
|
+
* @returns {Set<string>} Set of directory paths
|
|
69
|
+
*/
|
|
70
|
+
function getDirectories(assets) {
|
|
71
|
+
const directories = new Set();
|
|
72
|
+
/**
|
|
73
|
+
* @param {string} filename asset filename
|
|
74
|
+
*/
|
|
75
|
+
const addDirectory = filename => {
|
|
76
|
+
directories.add(path.dirname(filename));
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
// get directories of assets
|
|
80
|
+
for (const [asset] of assets) {
|
|
81
|
+
addDirectory(asset);
|
|
82
|
+
}
|
|
83
|
+
// and all parent directories
|
|
84
|
+
for (const directory of directories) {
|
|
85
|
+
addDirectory(directory);
|
|
86
|
+
}
|
|
87
|
+
return directories;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* @param {string} a First directory path to compare
|
|
92
|
+
* @param {string} b Second directory path to compare
|
|
93
|
+
* @returns {boolean} True if both paths have the same parent directory
|
|
94
|
+
*/
|
|
95
|
+
function isEqualPath(a, b) {
|
|
96
|
+
return path.normalize(a) === path.normalize(b);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* @param {Map<string, number>|Set<string>} files Collection of files to check against
|
|
101
|
+
* @param {string} file File path to check
|
|
102
|
+
* @returns {boolean} True if the file or its parent exists in the collection
|
|
103
|
+
*/
|
|
104
|
+
function hasFile(files, file) {
|
|
105
|
+
if (files instanceof Set) {
|
|
106
|
+
for (const dir of files) {
|
|
107
|
+
if (isEqualPath(dir, file)) {
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
if (files instanceof Map) {
|
|
113
|
+
for (const dir of files.keys()) {
|
|
114
|
+
if (isEqualPath(dir, file)) {
|
|
115
|
+
return true;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
|
|
64
122
|
/** @typedef {Set<string>} Diff */
|
|
65
123
|
|
|
66
124
|
/**
|
|
@@ -71,15 +129,7 @@ const mergeAssets = (as1, as2) => {
|
|
|
71
129
|
* @returns {void}
|
|
72
130
|
*/
|
|
73
131
|
const getDiffToFs = (fs, outputPath, currentAssets, callback) => {
|
|
74
|
-
const directories =
|
|
75
|
-
// get directories of assets
|
|
76
|
-
for (const [asset] of currentAssets) {
|
|
77
|
-
directories.add(asset.replace(/(^|\/)[^/]*$/, ""));
|
|
78
|
-
}
|
|
79
|
-
// and all parent directories
|
|
80
|
-
for (const directory of directories) {
|
|
81
|
-
directories.add(directory.replace(/(^|\/)[^/]*$/, ""));
|
|
82
|
-
}
|
|
132
|
+
const directories = getDirectories(currentAssets);
|
|
83
133
|
const diff = new Set();
|
|
84
134
|
asyncLib.forEachLimit(
|
|
85
135
|
directories,
|
|
@@ -98,7 +148,10 @@ const getDiffToFs = (fs, outputPath, currentAssets, callback) => {
|
|
|
98
148
|
for (const entry of /** @type {string[]} */ (entries)) {
|
|
99
149
|
const file = entry;
|
|
100
150
|
const filename = directory ? `${directory}/${file}` : file;
|
|
101
|
-
if (
|
|
151
|
+
if (
|
|
152
|
+
!hasFile(directories, filename) &&
|
|
153
|
+
!hasFile(currentAssets, filename)
|
|
154
|
+
) {
|
|
102
155
|
diff.add(filename);
|
|
103
156
|
}
|
|
104
157
|
}
|
|
@@ -177,22 +230,43 @@ const applyDiff = (fs, outputPath, dry, logger, diff, isKept, callback) => {
|
|
|
177
230
|
jobs,
|
|
178
231
|
10,
|
|
179
232
|
({ type, filename, parent }, push, callback) => {
|
|
233
|
+
const path = join(fs, outputPath, filename);
|
|
180
234
|
/**
|
|
181
235
|
* @param {Error & { code?: string }} err error
|
|
182
236
|
* @returns {void}
|
|
183
237
|
*/
|
|
184
238
|
const handleError = err => {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
239
|
+
const isAlreadyRemoved = () =>
|
|
240
|
+
new Promise(resolve => {
|
|
241
|
+
if (err.code === "ENOENT") {
|
|
242
|
+
resolve(true);
|
|
243
|
+
} else if (err.code === "EPERM") {
|
|
244
|
+
// https://github.com/isaacs/rimraf/blob/main/src/fix-eperm.ts#L37
|
|
245
|
+
// fs.existsSync(path) === false https://github.com/webpack/webpack/actions/runs/15493412975/job/43624272783?pr=19586
|
|
246
|
+
doStat(fs, path, err => {
|
|
247
|
+
if (err) {
|
|
248
|
+
resolve(err.code === "ENOENT");
|
|
249
|
+
} else {
|
|
250
|
+
resolve(false);
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
} else {
|
|
254
|
+
resolve(false);
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
isAlreadyRemoved().then(isRemoved => {
|
|
259
|
+
if (isRemoved) {
|
|
260
|
+
log(`${filename} was removed during cleaning by something else`);
|
|
261
|
+
handleParent();
|
|
262
|
+
return callback();
|
|
263
|
+
}
|
|
264
|
+
return callback(err);
|
|
265
|
+
});
|
|
191
266
|
};
|
|
192
267
|
const handleParent = () => {
|
|
193
268
|
if (parent && --parent.remaining === 0) push(parent.job);
|
|
194
269
|
};
|
|
195
|
-
const path = join(fs, outputPath, filename);
|
|
196
270
|
switch (type) {
|
|
197
271
|
case "check":
|
|
198
272
|
if (isKept(filename)) {
|
|
@@ -443,3 +517,6 @@ class CleanPlugin {
|
|
|
443
517
|
}
|
|
444
518
|
|
|
445
519
|
module.exports = CleanPlugin;
|
|
520
|
+
module.exports._getDirectories = getDirectories;
|
|
521
|
+
module.exports._hasFile = hasFile;
|
|
522
|
+
module.exports._isEqualPath = isEqualPath;
|
|
@@ -9,7 +9,7 @@ const { DEFAULTS } = require("./config/defaults");
|
|
|
9
9
|
const { getOrInsert } = require("./util/MapHelpers");
|
|
10
10
|
const { first } = require("./util/SetHelpers");
|
|
11
11
|
const createHash = require("./util/createHash");
|
|
12
|
-
const {
|
|
12
|
+
const { RuntimeSpecMap, runtimeToString } = require("./util/runtime");
|
|
13
13
|
|
|
14
14
|
/** @typedef {import("webpack-sources").Source} Source */
|
|
15
15
|
/** @typedef {import("./Module")} Module */
|
|
@@ -44,8 +44,9 @@ class CompatibilityPlugin {
|
|
|
44
44
|
if (
|
|
45
45
|
parserOptions.browserify !== undefined &&
|
|
46
46
|
!parserOptions.browserify
|
|
47
|
-
)
|
|
47
|
+
) {
|
|
48
48
|
return;
|
|
49
|
+
}
|
|
49
50
|
|
|
50
51
|
parser.hooks.call.for("require").tap(
|
|
51
52
|
PLUGIN_NAME,
|
|
@@ -75,8 +76,9 @@ class CompatibilityPlugin {
|
|
|
75
76
|
last.options.request === "." &&
|
|
76
77
|
last.userRequest === "." &&
|
|
77
78
|
last.options.recursive
|
|
78
|
-
)
|
|
79
|
+
) {
|
|
79
80
|
parser.state.current.dependencies.pop();
|
|
81
|
+
}
|
|
80
82
|
}
|
|
81
83
|
parser.state.module.addPresentationalDependency(dep);
|
|
82
84
|
return true;
|
|
@@ -191,4 +193,5 @@ class CompatibilityPlugin {
|
|
|
191
193
|
);
|
|
192
194
|
}
|
|
193
195
|
}
|
|
196
|
+
|
|
194
197
|
module.exports = CompatibilityPlugin;
|