webpack 5.99.5 → 5.99.7
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 +1 -1
- package/lib/APIPlugin.js +2 -2
- package/lib/AutomaticPrefetchPlugin.js +21 -22
- package/lib/BannerPlugin.js +31 -35
- package/lib/Cache.js +1 -1
- package/lib/Chunk.js +12 -9
- package/lib/CleanPlugin.js +5 -3
- package/lib/Compilation.js +45 -35
- package/lib/Compiler.js +6 -4
- package/lib/ContextExclusionPlugin.js +4 -2
- package/lib/ContextModule.js +2 -1
- package/lib/ContextReplacementPlugin.js +5 -3
- package/lib/DelegatedPlugin.js +4 -2
- package/lib/DllEntryPlugin.js +4 -2
- package/lib/DllPlugin.js +5 -3
- package/lib/DllReferencePlugin.js +56 -60
- package/lib/DynamicEntryPlugin.js +4 -2
- package/lib/EntryOptionPlugin.js +3 -1
- package/lib/EntryPlugin.js +4 -2
- package/lib/EnvironmentPlugin.js +4 -2
- package/lib/EvalDevToolModulePlugin.js +9 -7
- package/lib/EvalSourceMapDevToolPlugin.js +137 -138
- package/lib/ExternalsPlugin.js +3 -1
- package/lib/FlagDependencyExportsPlugin.js +2 -1
- package/lib/HotModuleReplacementPlugin.js +3 -3
- package/lib/IgnorePlugin.js +6 -4
- package/lib/IgnoreWarningsPlugin.js +4 -2
- package/lib/LibManifestPlugin.js +3 -4
- package/lib/LoaderOptionsPlugin.js +4 -2
- package/lib/LoaderTargetPlugin.js +4 -2
- package/lib/Module.js +29 -14
- package/lib/ModuleFilenameHelpers.js +1 -1
- package/lib/ModuleGraph.js +15 -10
- package/lib/ModuleInfoHeaderPlugin.js +11 -12
- package/lib/MultiCompiler.js +5 -3
- package/lib/NoEmitOnErrorsPlugin.js +5 -3
- package/lib/NormalModule.js +6 -2
- package/lib/NormalModuleReplacementPlugin.js +33 -36
- package/lib/PlatformPlugin.js +3 -1
- package/lib/PrefetchPlugin.js +5 -3
- package/lib/ProgressPlugin.js +23 -26
- package/lib/RecordIdsPlugin.js +73 -103
- package/lib/RuntimePlugin.js +34 -32
- package/lib/SourceMapDevToolPlugin.js +8 -6
- package/lib/Template.js +1 -1
- package/lib/WarnCaseSensitiveModulesPlugin.js +36 -37
- package/lib/WarnNoModeSetPlugin.js +3 -1
- package/lib/WatchIgnorePlugin.js +3 -1
- package/lib/WebpackError.js +11 -3
- package/lib/WebpackOptionsApply.js +22 -5
- package/lib/async-modules/InferAsyncModulesPlugin.js +25 -26
- package/lib/buildChunkGraph.js +7 -2
- package/lib/cache/IdleFileCachePlugin.js +12 -13
- package/lib/cache/MemoryCachePlugin.js +2 -1
- package/lib/cache/MemoryWithGcCachePlugin.js +10 -7
- package/lib/cache/PackFileCacheStrategy.js +13 -21
- package/lib/cache/ResolverCachePlugin.js +22 -22
- package/lib/cli.js +8 -4
- package/lib/config/defaults.js +2 -2
- package/lib/config/normalization.js +9 -3
- package/lib/config/target.js +6 -6
- package/lib/container/ContainerReferencePlugin.js +24 -26
- package/lib/container/ModuleFederationPlugin.js +2 -1
- package/lib/css/CssGenerator.js +1 -1
- package/lib/css/CssModulesPlugin.js +6 -4
- package/lib/css/CssParser.js +1 -1
- package/lib/debug/ProfilingPlugin.js +1 -1
- package/lib/dependencies/ContextDependencyHelpers.js +1 -1
- package/lib/dependencies/CssIcssImportDependency.js +3 -2
- package/lib/dependencies/HarmonyDetectionParserPlugin.js +9 -15
- package/lib/dependencies/HarmonyExportExpressionDependency.js +1 -1
- package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +2 -1
- package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +1 -1
- package/lib/dependencies/HarmonyTopLevelThisParserPlugin.js +15 -15
- package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +4 -2
- package/lib/dependencies/JsonExportsDependency.js +1 -1
- package/lib/dependencies/LoaderPlugin.js +5 -3
- package/lib/dependencies/LocalModulesHelpers.js +1 -1
- package/lib/dependencies/RequireContextDependencyParserPlugin.js +46 -46
- package/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin.js +94 -100
- package/lib/dependencies/RequireResolveDependency.js +1 -1
- package/lib/dependencies/WorkerPlugin.js +2 -2
- package/lib/esm/ModuleChunkLoadingPlugin.js +76 -57
- package/lib/esm/ModuleChunkLoadingRuntimeModule.js +11 -9
- package/lib/hmr/HotModuleReplacement.runtime.js +0 -1
- package/lib/hmr/JavascriptHotModuleReplacement.runtime.js +0 -1
- package/lib/hmr/LazyCompilationPlugin.js +17 -18
- package/lib/ids/ChunkModuleIdRangePlugin.js +6 -6
- package/lib/ids/DeterministicChunkIdsPlugin.js +1 -1
- package/lib/ids/DeterministicModuleIdsPlugin.js +48 -49
- package/lib/ids/HashedModuleIdsPlugin.js +4 -2
- package/lib/ids/NamedChunkIdsPlugin.js +6 -4
- package/lib/ids/NamedModuleIdsPlugin.js +6 -4
- package/lib/ids/NaturalChunkIdsPlugin.js +4 -2
- package/lib/ids/NaturalModuleIdsPlugin.js +4 -2
- package/lib/ids/OccurrenceChunkIdsPlugin.js +4 -2
- package/lib/ids/OccurrenceModuleIdsPlugin.js +4 -2
- package/lib/index.js +1 -1
- package/lib/javascript/BasicEvaluatedExpression.js +2 -2
- package/lib/javascript/JavascriptParser.js +670 -688
- package/lib/library/EnableLibraryPlugin.js +15 -2
- package/lib/library/ModuleLibraryPlugin.js +66 -43
- package/lib/logging/createConsoleLogger.js +0 -1
- package/lib/node/CommonJsChunkLoadingPlugin.js +71 -75
- package/lib/node/NodeEnvironmentPlugin.js +3 -1
- package/lib/node/NodeTemplatePlugin.js +2 -2
- package/lib/node/ReadFileCompileAsyncWasmPlugin.js +2 -2
- package/lib/node/ReadFileCompileWasmPlugin.js +3 -3
- package/lib/optimize/AggressiveMergingPlugin.js +1 -1
- package/lib/optimize/AggressiveSplittingPlugin.js +224 -232
- package/lib/optimize/ConcatenatedModule.js +12 -15
- package/lib/optimize/FlagIncludedChunksPlugin.js +92 -97
- package/lib/optimize/LimitChunkCountPlugin.js +4 -2
- package/lib/optimize/MangleExportsPlugin.js +15 -16
- package/lib/optimize/MinChunkSizePlugin.js +4 -2
- package/lib/optimize/ModuleConcatenationPlugin.js +4 -2
- package/lib/optimize/RealContentHashPlugin.js +4 -2
- package/lib/optimize/RemoveEmptyChunksPlugin.js +5 -3
- package/lib/optimize/RemoveParentModulesPlugin.js +4 -2
- package/lib/optimize/RuntimeChunkPlugin.js +17 -18
- package/lib/optimize/SplitChunksPlugin.js +9 -6
- package/lib/performance/SizeLimitsPlugin.js +3 -1
- package/lib/prefetch/ChunkPrefetchPreloadPlugin.js +61 -62
- package/lib/runtime/GetChunkFilenameRuntimeModule.js +3 -4
- package/lib/runtime/StartupChunkDependenciesPlugin.js +39 -42
- package/lib/schemes/DataUriPlugin.js +5 -3
- package/lib/schemes/FileUriPlugin.js +5 -3
- package/lib/schemes/HttpUriPlugin.js +32 -39
- package/lib/serialization/AggregateErrorSerializer.js +42 -0
- package/lib/serialization/BinaryMiddleware.js +22 -38
- package/lib/serialization/ErrorObjectSerializer.js +7 -2
- package/lib/serialization/FileMiddleware.js +29 -33
- package/lib/serialization/ObjectMiddleware.js +42 -30
- package/lib/serialization/Serializer.js +29 -18
- package/lib/serialization/SerializerMiddleware.js +105 -72
- package/lib/serialization/SingleItemMiddleware.js +4 -5
- package/lib/sharing/ProvideSharedPlugin.js +6 -4
- package/lib/stats/DefaultStatsFactoryPlugin.js +128 -57
- package/lib/stats/DefaultStatsPresetPlugin.js +25 -20
- package/lib/stats/DefaultStatsPrinterPlugin.js +486 -334
- package/lib/stats/StatsFactory.js +47 -10
- package/lib/stats/StatsPrinter.js +52 -31
- package/lib/util/ArrayQueue.js +1 -1
- package/lib/util/AsyncQueue.js +1 -1
- package/lib/util/TupleQueue.js +9 -7
- package/lib/util/TupleSet.js +37 -18
- package/lib/util/WeakTupleMap.js +50 -37
- package/lib/util/cleverMerge.js +2 -2
- package/lib/util/comparators.js +1 -1
- package/lib/util/concatenate.js +4 -2
- package/lib/util/createHash.js +1 -1
- package/lib/util/fs.js +1 -1
- package/lib/util/makeSerializable.js +1 -1
- package/lib/util/runtime.js +1 -0
- package/lib/util/serialization.js +50 -42
- package/lib/wasm-async/AsyncWebAssemblyGenerator.js +1 -1
- package/lib/wasm-async/AsyncWebAssemblyModulesPlugin.js +1 -1
- package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +2 -2
- package/lib/wasm-sync/WasmFinalizeExportsPlugin.js +55 -57
- package/lib/wasm-sync/WebAssemblyGenerator.js +1 -1
- package/lib/wasm-sync/WebAssemblyModulesPlugin.js +1 -1
- package/lib/web/FetchCompileWasmPlugin.js +2 -2
- package/lib/web/JsonpChunkLoadingPlugin.js +73 -74
- package/lib/webpack.js +1 -1
- package/lib/webworker/ImportScriptsChunkLoadingPlugin.js +77 -78
- package/package.json +4 -3
- package/schemas/WebpackOptions.check.js +1 -1
- package/schemas/WebpackOptions.json +24 -2
- package/types.d.ts +273 -128
@@ -11,6 +11,8 @@ const JsonpChunkLoadingRuntimeModule = require("./JsonpChunkLoadingRuntimeModule
|
|
11
11
|
/** @typedef {import("../Chunk")} Chunk */
|
12
12
|
/** @typedef {import("../Compiler")} Compiler */
|
13
13
|
|
14
|
+
const PLUGIN_NAME = "JsonpChunkLoadingPlugin";
|
15
|
+
|
14
16
|
class JsonpChunkLoadingPlugin {
|
15
17
|
/**
|
16
18
|
* Apply the plugin
|
@@ -18,82 +20,79 @@ class JsonpChunkLoadingPlugin {
|
|
18
20
|
* @returns {void}
|
19
21
|
*/
|
20
22
|
apply(compiler) {
|
21
|
-
compiler.hooks.thisCompilation.tap(
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
const
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
23
|
+
compiler.hooks.thisCompilation.tap(PLUGIN_NAME, compilation => {
|
24
|
+
const globalChunkLoading = compilation.outputOptions.chunkLoading;
|
25
|
+
/**
|
26
|
+
* @param {Chunk} chunk chunk
|
27
|
+
* @returns {boolean} true, if wasm loading is enabled for the chunk
|
28
|
+
*/
|
29
|
+
const isEnabledForChunk = chunk => {
|
30
|
+
const options = chunk.getEntryOptions();
|
31
|
+
const chunkLoading =
|
32
|
+
options && options.chunkLoading !== undefined
|
33
|
+
? options.chunkLoading
|
34
|
+
: globalChunkLoading;
|
35
|
+
return chunkLoading === "jsonp";
|
36
|
+
};
|
37
|
+
const onceForChunkSet = new WeakSet();
|
38
|
+
/**
|
39
|
+
* @param {Chunk} chunk chunk
|
40
|
+
* @param {Set<string>} set runtime requirements
|
41
|
+
*/
|
42
|
+
const handler = (chunk, set) => {
|
43
|
+
if (onceForChunkSet.has(chunk)) return;
|
44
|
+
onceForChunkSet.add(chunk);
|
45
|
+
if (!isEnabledForChunk(chunk)) return;
|
46
|
+
set.add(RuntimeGlobals.moduleFactoriesAddOnly);
|
47
|
+
set.add(RuntimeGlobals.hasOwnProperty);
|
48
|
+
compilation.addRuntimeModule(
|
49
|
+
chunk,
|
50
|
+
new JsonpChunkLoadingRuntimeModule(set)
|
51
|
+
);
|
52
|
+
};
|
53
|
+
compilation.hooks.runtimeRequirementInTree
|
54
|
+
.for(RuntimeGlobals.ensureChunkHandlers)
|
55
|
+
.tap(PLUGIN_NAME, handler);
|
56
|
+
compilation.hooks.runtimeRequirementInTree
|
57
|
+
.for(RuntimeGlobals.hmrDownloadUpdateHandlers)
|
58
|
+
.tap(PLUGIN_NAME, handler);
|
59
|
+
compilation.hooks.runtimeRequirementInTree
|
60
|
+
.for(RuntimeGlobals.hmrDownloadManifest)
|
61
|
+
.tap(PLUGIN_NAME, handler);
|
62
|
+
compilation.hooks.runtimeRequirementInTree
|
63
|
+
.for(RuntimeGlobals.baseURI)
|
64
|
+
.tap(PLUGIN_NAME, handler);
|
65
|
+
compilation.hooks.runtimeRequirementInTree
|
66
|
+
.for(RuntimeGlobals.onChunksLoaded)
|
67
|
+
.tap(PLUGIN_NAME, handler);
|
68
|
+
|
69
|
+
compilation.hooks.runtimeRequirementInTree
|
70
|
+
.for(RuntimeGlobals.ensureChunkHandlers)
|
71
|
+
.tap(PLUGIN_NAME, (chunk, set) => {
|
72
|
+
if (!isEnabledForChunk(chunk)) return;
|
73
|
+
set.add(RuntimeGlobals.publicPath);
|
74
|
+
set.add(RuntimeGlobals.loadScript);
|
75
|
+
set.add(RuntimeGlobals.getChunkScriptFilename);
|
76
|
+
});
|
77
|
+
compilation.hooks.runtimeRequirementInTree
|
78
|
+
.for(RuntimeGlobals.hmrDownloadUpdateHandlers)
|
79
|
+
.tap(PLUGIN_NAME, (chunk, set) => {
|
45
80
|
if (!isEnabledForChunk(chunk)) return;
|
81
|
+
set.add(RuntimeGlobals.publicPath);
|
82
|
+
set.add(RuntimeGlobals.loadScript);
|
83
|
+
set.add(RuntimeGlobals.getChunkUpdateScriptFilename);
|
84
|
+
set.add(RuntimeGlobals.moduleCache);
|
85
|
+
set.add(RuntimeGlobals.hmrModuleData);
|
46
86
|
set.add(RuntimeGlobals.moduleFactoriesAddOnly);
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
);
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
compilation.hooks.runtimeRequirementInTree
|
57
|
-
.for(RuntimeGlobals.hmrDownloadUpdateHandlers)
|
58
|
-
.tap("JsonpChunkLoadingPlugin", handler);
|
59
|
-
compilation.hooks.runtimeRequirementInTree
|
60
|
-
.for(RuntimeGlobals.hmrDownloadManifest)
|
61
|
-
.tap("JsonpChunkLoadingPlugin", handler);
|
62
|
-
compilation.hooks.runtimeRequirementInTree
|
63
|
-
.for(RuntimeGlobals.baseURI)
|
64
|
-
.tap("JsonpChunkLoadingPlugin", handler);
|
65
|
-
compilation.hooks.runtimeRequirementInTree
|
66
|
-
.for(RuntimeGlobals.onChunksLoaded)
|
67
|
-
.tap("JsonpChunkLoadingPlugin", handler);
|
68
|
-
|
69
|
-
compilation.hooks.runtimeRequirementInTree
|
70
|
-
.for(RuntimeGlobals.ensureChunkHandlers)
|
71
|
-
.tap("JsonpChunkLoadingPlugin", (chunk, set) => {
|
72
|
-
if (!isEnabledForChunk(chunk)) return;
|
73
|
-
set.add(RuntimeGlobals.publicPath);
|
74
|
-
set.add(RuntimeGlobals.loadScript);
|
75
|
-
set.add(RuntimeGlobals.getChunkScriptFilename);
|
76
|
-
});
|
77
|
-
compilation.hooks.runtimeRequirementInTree
|
78
|
-
.for(RuntimeGlobals.hmrDownloadUpdateHandlers)
|
79
|
-
.tap("JsonpChunkLoadingPlugin", (chunk, set) => {
|
80
|
-
if (!isEnabledForChunk(chunk)) return;
|
81
|
-
set.add(RuntimeGlobals.publicPath);
|
82
|
-
set.add(RuntimeGlobals.loadScript);
|
83
|
-
set.add(RuntimeGlobals.getChunkUpdateScriptFilename);
|
84
|
-
set.add(RuntimeGlobals.moduleCache);
|
85
|
-
set.add(RuntimeGlobals.hmrModuleData);
|
86
|
-
set.add(RuntimeGlobals.moduleFactoriesAddOnly);
|
87
|
-
});
|
88
|
-
compilation.hooks.runtimeRequirementInTree
|
89
|
-
.for(RuntimeGlobals.hmrDownloadManifest)
|
90
|
-
.tap("JsonpChunkLoadingPlugin", (chunk, set) => {
|
91
|
-
if (!isEnabledForChunk(chunk)) return;
|
92
|
-
set.add(RuntimeGlobals.publicPath);
|
93
|
-
set.add(RuntimeGlobals.getUpdateManifestFilename);
|
94
|
-
});
|
95
|
-
}
|
96
|
-
);
|
87
|
+
});
|
88
|
+
compilation.hooks.runtimeRequirementInTree
|
89
|
+
.for(RuntimeGlobals.hmrDownloadManifest)
|
90
|
+
.tap(PLUGIN_NAME, (chunk, set) => {
|
91
|
+
if (!isEnabledForChunk(chunk)) return;
|
92
|
+
set.add(RuntimeGlobals.publicPath);
|
93
|
+
set.add(RuntimeGlobals.getUpdateManifestFilename);
|
94
|
+
});
|
95
|
+
});
|
97
96
|
}
|
98
97
|
}
|
99
98
|
|
package/lib/webpack.js
CHANGED
@@ -59,7 +59,7 @@ const createMultiCompiler = (childOptions, options) => {
|
|
59
59
|
|
60
60
|
/**
|
61
61
|
* @param {WebpackOptions} rawOptions options object
|
62
|
-
* @param {number}
|
62
|
+
* @param {number=} compilerIndex index of compiler
|
63
63
|
* @returns {Compiler} a compiler
|
64
64
|
*/
|
65
65
|
const createCompiler = (rawOptions, compilerIndex) => {
|
@@ -12,6 +12,8 @@ const ImportScriptsChunkLoadingRuntimeModule = require("./ImportScriptsChunkLoad
|
|
12
12
|
/** @typedef {import("../Chunk")} Chunk */
|
13
13
|
/** @typedef {import("../Compiler")} Compiler */
|
14
14
|
|
15
|
+
const PLUGIN_NAME = "ImportScriptsChunkLoadingPlugin";
|
16
|
+
|
15
17
|
class ImportScriptsChunkLoadingPlugin {
|
16
18
|
/**
|
17
19
|
* Apply the plugin
|
@@ -23,86 +25,83 @@ class ImportScriptsChunkLoadingPlugin {
|
|
23
25
|
chunkLoading: "import-scripts",
|
24
26
|
asyncChunkLoading: true
|
25
27
|
}).apply(compiler);
|
26
|
-
compiler.hooks.thisCompilation.tap(
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
const
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
28
|
+
compiler.hooks.thisCompilation.tap(PLUGIN_NAME, compilation => {
|
29
|
+
const globalChunkLoading = compilation.outputOptions.chunkLoading;
|
30
|
+
/**
|
31
|
+
* @param {Chunk} chunk chunk
|
32
|
+
* @returns {boolean} true, if wasm loading is enabled for the chunk
|
33
|
+
*/
|
34
|
+
const isEnabledForChunk = chunk => {
|
35
|
+
const options = chunk.getEntryOptions();
|
36
|
+
const chunkLoading =
|
37
|
+
options && options.chunkLoading !== undefined
|
38
|
+
? options.chunkLoading
|
39
|
+
: globalChunkLoading;
|
40
|
+
return chunkLoading === "import-scripts";
|
41
|
+
};
|
42
|
+
const onceForChunkSet = new WeakSet();
|
43
|
+
/**
|
44
|
+
* @param {Chunk} chunk chunk
|
45
|
+
* @param {Set<string>} set runtime requirements
|
46
|
+
*/
|
47
|
+
const handler = (chunk, set) => {
|
48
|
+
if (onceForChunkSet.has(chunk)) return;
|
49
|
+
onceForChunkSet.add(chunk);
|
50
|
+
if (!isEnabledForChunk(chunk)) return;
|
51
|
+
const withCreateScriptUrl = Boolean(
|
52
|
+
compilation.outputOptions.trustedTypes
|
53
|
+
);
|
54
|
+
set.add(RuntimeGlobals.moduleFactoriesAddOnly);
|
55
|
+
set.add(RuntimeGlobals.hasOwnProperty);
|
56
|
+
if (withCreateScriptUrl) {
|
57
|
+
set.add(RuntimeGlobals.createScriptUrl);
|
58
|
+
}
|
59
|
+
compilation.addRuntimeModule(
|
60
|
+
chunk,
|
61
|
+
new ImportScriptsChunkLoadingRuntimeModule(set, withCreateScriptUrl)
|
62
|
+
);
|
63
|
+
};
|
64
|
+
compilation.hooks.runtimeRequirementInTree
|
65
|
+
.for(RuntimeGlobals.ensureChunkHandlers)
|
66
|
+
.tap(PLUGIN_NAME, handler);
|
67
|
+
compilation.hooks.runtimeRequirementInTree
|
68
|
+
.for(RuntimeGlobals.hmrDownloadUpdateHandlers)
|
69
|
+
.tap(PLUGIN_NAME, handler);
|
70
|
+
compilation.hooks.runtimeRequirementInTree
|
71
|
+
.for(RuntimeGlobals.hmrDownloadManifest)
|
72
|
+
.tap(PLUGIN_NAME, handler);
|
73
|
+
compilation.hooks.runtimeRequirementInTree
|
74
|
+
.for(RuntimeGlobals.baseURI)
|
75
|
+
.tap(PLUGIN_NAME, handler);
|
76
|
+
compilation.hooks.runtimeRequirementInTree
|
77
|
+
.for(RuntimeGlobals.onChunksLoaded)
|
78
|
+
.tap(PLUGIN_NAME, handler);
|
79
|
+
|
80
|
+
compilation.hooks.runtimeRequirementInTree
|
81
|
+
.for(RuntimeGlobals.ensureChunkHandlers)
|
82
|
+
.tap(PLUGIN_NAME, (chunk, set) => {
|
83
|
+
if (!isEnabledForChunk(chunk)) return;
|
84
|
+
set.add(RuntimeGlobals.publicPath);
|
85
|
+
set.add(RuntimeGlobals.getChunkScriptFilename);
|
86
|
+
});
|
87
|
+
compilation.hooks.runtimeRequirementInTree
|
88
|
+
.for(RuntimeGlobals.hmrDownloadUpdateHandlers)
|
89
|
+
.tap(PLUGIN_NAME, (chunk, set) => {
|
50
90
|
if (!isEnabledForChunk(chunk)) return;
|
51
|
-
|
52
|
-
|
53
|
-
);
|
91
|
+
set.add(RuntimeGlobals.publicPath);
|
92
|
+
set.add(RuntimeGlobals.getChunkUpdateScriptFilename);
|
93
|
+
set.add(RuntimeGlobals.moduleCache);
|
94
|
+
set.add(RuntimeGlobals.hmrModuleData);
|
54
95
|
set.add(RuntimeGlobals.moduleFactoriesAddOnly);
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
compilation.hooks.runtimeRequirementInTree
|
65
|
-
.for(RuntimeGlobals.ensureChunkHandlers)
|
66
|
-
.tap("ImportScriptsChunkLoadingPlugin", handler);
|
67
|
-
compilation.hooks.runtimeRequirementInTree
|
68
|
-
.for(RuntimeGlobals.hmrDownloadUpdateHandlers)
|
69
|
-
.tap("ImportScriptsChunkLoadingPlugin", handler);
|
70
|
-
compilation.hooks.runtimeRequirementInTree
|
71
|
-
.for(RuntimeGlobals.hmrDownloadManifest)
|
72
|
-
.tap("ImportScriptsChunkLoadingPlugin", handler);
|
73
|
-
compilation.hooks.runtimeRequirementInTree
|
74
|
-
.for(RuntimeGlobals.baseURI)
|
75
|
-
.tap("ImportScriptsChunkLoadingPlugin", handler);
|
76
|
-
compilation.hooks.runtimeRequirementInTree
|
77
|
-
.for(RuntimeGlobals.onChunksLoaded)
|
78
|
-
.tap("ImportScriptsChunkLoadingPlugin", handler);
|
79
|
-
|
80
|
-
compilation.hooks.runtimeRequirementInTree
|
81
|
-
.for(RuntimeGlobals.ensureChunkHandlers)
|
82
|
-
.tap("ImportScriptsChunkLoadingPlugin", (chunk, set) => {
|
83
|
-
if (!isEnabledForChunk(chunk)) return;
|
84
|
-
set.add(RuntimeGlobals.publicPath);
|
85
|
-
set.add(RuntimeGlobals.getChunkScriptFilename);
|
86
|
-
});
|
87
|
-
compilation.hooks.runtimeRequirementInTree
|
88
|
-
.for(RuntimeGlobals.hmrDownloadUpdateHandlers)
|
89
|
-
.tap("ImportScriptsChunkLoadingPlugin", (chunk, set) => {
|
90
|
-
if (!isEnabledForChunk(chunk)) return;
|
91
|
-
set.add(RuntimeGlobals.publicPath);
|
92
|
-
set.add(RuntimeGlobals.getChunkUpdateScriptFilename);
|
93
|
-
set.add(RuntimeGlobals.moduleCache);
|
94
|
-
set.add(RuntimeGlobals.hmrModuleData);
|
95
|
-
set.add(RuntimeGlobals.moduleFactoriesAddOnly);
|
96
|
-
});
|
97
|
-
compilation.hooks.runtimeRequirementInTree
|
98
|
-
.for(RuntimeGlobals.hmrDownloadManifest)
|
99
|
-
.tap("ImportScriptsChunkLoadingPlugin", (chunk, set) => {
|
100
|
-
if (!isEnabledForChunk(chunk)) return;
|
101
|
-
set.add(RuntimeGlobals.publicPath);
|
102
|
-
set.add(RuntimeGlobals.getUpdateManifestFilename);
|
103
|
-
});
|
104
|
-
}
|
105
|
-
);
|
96
|
+
});
|
97
|
+
compilation.hooks.runtimeRequirementInTree
|
98
|
+
.for(RuntimeGlobals.hmrDownloadManifest)
|
99
|
+
.tap(PLUGIN_NAME, (chunk, set) => {
|
100
|
+
if (!isEnabledForChunk(chunk)) return;
|
101
|
+
set.add(RuntimeGlobals.publicPath);
|
102
|
+
set.add(RuntimeGlobals.getUpdateManifestFilename);
|
103
|
+
});
|
104
|
+
});
|
106
105
|
}
|
107
106
|
}
|
108
107
|
module.exports = ImportScriptsChunkLoadingPlugin;
|
package/package.json
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
{
|
2
2
|
"name": "webpack",
|
3
|
-
"version": "5.99.
|
3
|
+
"version": "5.99.7",
|
4
4
|
"author": "Tobias Koppers @sokra",
|
5
5
|
"description": "Packs ECMAScript/CommonJs/AMD modules for the browser. Allows you to split your codebase into multiple bundles, which can be loaded on demand. Supports loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.",
|
6
6
|
"license": "MIT",
|
7
7
|
"dependencies": {
|
8
8
|
"@types/eslint-scope": "^3.7.7",
|
9
9
|
"@types/estree": "^1.0.6",
|
10
|
+
"@types/json-schema": "^7.0.15",
|
10
11
|
"@webassemblyjs/ast": "^1.14.1",
|
11
12
|
"@webassemblyjs/wasm-edit": "^1.14.1",
|
12
13
|
"@webassemblyjs/wasm-parser": "^1.14.1",
|
@@ -23,7 +24,7 @@
|
|
23
24
|
"loader-runner": "^4.2.0",
|
24
25
|
"mime-types": "^2.1.27",
|
25
26
|
"neo-async": "^2.6.2",
|
26
|
-
"schema-utils": "^4.3.
|
27
|
+
"schema-utils": "^4.3.2",
|
27
28
|
"tapable": "^2.1.1",
|
28
29
|
"terser-webpack-plugin": "^5.3.11",
|
29
30
|
"watchpack": "^2.4.1",
|
@@ -167,7 +168,7 @@
|
|
167
168
|
"pretty-lint": "yarn pretty-lint-base --check",
|
168
169
|
"yarn-lint": "yarn-deduplicate --fail --list -s highest yarn.lock",
|
169
170
|
"yarn-lint-fix": "yarn-deduplicate -s highest yarn.lock",
|
170
|
-
"benchmark": "node --max-old-space-size=4096 --experimental-vm-modules --trace-deprecation node_modules/jest-cli/bin/jest --testMatch \"<rootDir>/test/*.benchmark.
|
171
|
+
"benchmark": "node --max-old-space-size=4096 --experimental-vm-modules --trace-deprecation node_modules/jest-cli/bin/jest --testMatch \"<rootDir>/test/*.benchmark.mjs\" --runInBand",
|
171
172
|
"cover": "yarn cover:all && yarn cover:report",
|
172
173
|
"cover:clean": "rimraf .nyc_output coverage",
|
173
174
|
"cover:all": "node --expose-gc --max-old-space-size=4096 --experimental-vm-modules node_modules/jest-cli/bin/jest --logHeapUsage --coverage",
|