webpack 5.64.1 → 5.65.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of webpack might be problematic. Click here for more details.
- package/README.md +0 -6
- package/lib/ExternalModule.js +1 -1
- package/lib/FileSystemInfo.js +6 -2
- package/lib/RuntimeTemplate.js +92 -2
- package/lib/WatchIgnorePlugin.js +14 -1
- package/lib/Watching.js +31 -17
- package/lib/asset/AssetGenerator.js +7 -6
- package/lib/config/browserslistTargetHandler.js +38 -1
- package/lib/config/defaults.js +1 -1
- package/lib/config/target.js +10 -0
- package/lib/container/ContainerEntryModule.js +4 -3
- package/lib/esm/ModuleChunkFormatPlugin.js +74 -49
- package/lib/index.js +3 -0
- package/lib/javascript/ArrayPushCallbackChunkFormatPlugin.js +2 -2
- package/lib/javascript/ChunkHelpers.js +33 -0
- package/lib/javascript/JavascriptParser.js +16 -8
- package/lib/javascript/StartupHelpers.js +1 -25
- package/lib/library/AssignLibraryPlugin.js +5 -10
- package/lib/node/NodeWatchFileSystem.js +85 -31
- package/lib/sharing/ConsumeSharedModule.js +4 -0
- package/lib/sharing/ConsumeSharedRuntimeModule.js +25 -4
- package/lib/stats/DefaultStatsPrinterPlugin.js +1 -1
- package/lib/util/create-schema-validation.js +9 -2
- package/lib/util/extractUrlAndGlobal.js +3 -0
- package/lib/util/fs.js +10 -0
- package/lib/web/JsonpChunkLoadingRuntimeModule.js +1 -1
- package/lib/webpack.js +9 -1
- package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +2 -1
- package/package.json +3 -3
- package/schemas/WebpackOptions.check.js +1 -1
- package/schemas/WebpackOptions.json +8 -0
- package/schemas/plugins/DllReferencePlugin.check.js +1 -1
- package/schemas/plugins/HashedModuleIdsPlugin.check.js +1 -1
- package/schemas/plugins/ProgressPlugin.check.js +1 -1
- package/schemas/plugins/asset/AssetParserOptions.check.js +1 -1
- package/schemas/plugins/optimize/AggressiveSplittingPlugin.check.js +1 -1
- package/schemas/plugins/optimize/LimitChunkCountPlugin.check.js +1 -1
- package/schemas/plugins/optimize/MinChunkSizePlugin.check.js +1 -1
- package/types.d.ts +61 -19
@@ -935,6 +935,13 @@ class JavascriptParser extends Parser {
|
|
935
935
|
.setString("undefined")
|
936
936
|
.setRange(expr.range);
|
937
937
|
});
|
938
|
+
this.hooks.evaluate.for("Identifier").tap("JavascriptParser", expr => {
|
939
|
+
if (/** @type {IdentifierNode} */ (expr).name === "undefined") {
|
940
|
+
return new BasicEvaluatedExpression()
|
941
|
+
.setUndefined()
|
942
|
+
.setRange(expr.range);
|
943
|
+
}
|
944
|
+
});
|
938
945
|
/**
|
939
946
|
* @param {string} exprType expression type name
|
940
947
|
* @param {function(ExpressionNode): GetInfoResult | undefined} getInfo get info
|
@@ -1189,14 +1196,15 @@ class JavascriptParser extends Parser {
|
|
1189
1196
|
const node = /** @type {TaggedTemplateExpressionNode} */ (_node);
|
1190
1197
|
const tag = this.evaluateExpression(node.tag);
|
1191
1198
|
|
1192
|
-
if (tag.isIdentifier() && tag.identifier
|
1193
|
-
|
1194
|
-
|
1195
|
-
|
1196
|
-
|
1197
|
-
|
1198
|
-
|
1199
|
-
|
1199
|
+
if (tag.isIdentifier() && tag.identifier === "String.raw") {
|
1200
|
+
const { quasis, parts } = getSimplifiedTemplateResult(
|
1201
|
+
"raw",
|
1202
|
+
node.quasi
|
1203
|
+
);
|
1204
|
+
return new BasicEvaluatedExpression()
|
1205
|
+
.setTemplateString(quasis, parts, "raw")
|
1206
|
+
.setRange(node.range);
|
1207
|
+
}
|
1200
1208
|
});
|
1201
1209
|
|
1202
1210
|
this.hooks.evaluateCallExpressionMember
|
@@ -5,10 +5,10 @@
|
|
5
5
|
|
6
6
|
"use strict";
|
7
7
|
|
8
|
-
const Entrypoint = require("../Entrypoint");
|
9
8
|
const RuntimeGlobals = require("../RuntimeGlobals");
|
10
9
|
const Template = require("../Template");
|
11
10
|
const { isSubset } = require("../util/SetHelpers");
|
11
|
+
const { getAllChunks } = require("./ChunkHelpers");
|
12
12
|
const { chunkHasJs } = require("./JavascriptModulesPlugin");
|
13
13
|
|
14
14
|
/** @typedef {import("../util/Hash")} Hash */
|
@@ -19,30 +19,6 @@ const { chunkHasJs } = require("./JavascriptModulesPlugin");
|
|
19
19
|
/** @typedef {import("../RuntimeTemplate")} RuntimeTemplate */
|
20
20
|
/** @typedef {(string|number)[]} EntryItem */
|
21
21
|
|
22
|
-
// TODO move to this file to ../javascript/ChunkHelpers.js
|
23
|
-
|
24
|
-
/**
|
25
|
-
* @param {Entrypoint} entrypoint a chunk group
|
26
|
-
* @param {Chunk} excludedChunk1 current chunk which is excluded
|
27
|
-
* @param {Chunk} excludedChunk2 runtime chunk which is excluded
|
28
|
-
* @returns {Set<Chunk>} chunks
|
29
|
-
*/
|
30
|
-
const getAllChunks = (entrypoint, excludedChunk1, excludedChunk2) => {
|
31
|
-
const queue = new Set([entrypoint]);
|
32
|
-
const chunks = new Set();
|
33
|
-
for (const entrypoint of queue) {
|
34
|
-
for (const chunk of entrypoint.chunks) {
|
35
|
-
if (chunk === excludedChunk1) continue;
|
36
|
-
if (chunk === excludedChunk2) continue;
|
37
|
-
chunks.add(chunk);
|
38
|
-
}
|
39
|
-
for (const parent of entrypoint.parentsIterable) {
|
40
|
-
if (parent instanceof Entrypoint) queue.add(parent);
|
41
|
-
}
|
42
|
-
}
|
43
|
-
return chunks;
|
44
|
-
};
|
45
|
-
|
46
22
|
const EXPORT_PREFIX = "var __webpack_exports__ = ";
|
47
23
|
|
48
24
|
/**
|
@@ -174,7 +174,7 @@ class AssignLibraryPlugin extends AbstractLibraryPlugin {
|
|
174
174
|
|
175
175
|
_getPrefix(compilation) {
|
176
176
|
return this.prefix === "global"
|
177
|
-
? [compilation.
|
177
|
+
? [compilation.runtimeTemplate.globalObject]
|
178
178
|
: this.prefix;
|
179
179
|
}
|
180
180
|
|
@@ -325,15 +325,10 @@ class AssignLibraryPlugin extends AbstractLibraryPlugin {
|
|
325
325
|
*/
|
326
326
|
chunkHash(chunk, hash, chunkHashContext, { options, compilation }) {
|
327
327
|
hash.update("AssignLibraryPlugin");
|
328
|
-
const
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
const fullName = options.name ? prefix.concat(options.name) : prefix;
|
333
|
-
const fullNameResolved = fullName.map(n =>
|
334
|
-
compilation.getPath(n, {
|
335
|
-
chunk
|
336
|
-
})
|
328
|
+
const fullNameResolved = this._getResolvedFullName(
|
329
|
+
options,
|
330
|
+
chunk,
|
331
|
+
compilation
|
337
332
|
);
|
338
333
|
if (options.name ? this.named === "copy" : this.unnamed === "copy") {
|
339
334
|
hash.update("copy");
|
@@ -5,6 +5,7 @@
|
|
5
5
|
|
6
6
|
"use strict";
|
7
7
|
|
8
|
+
const util = require("util");
|
8
9
|
const Watchpack = require("watchpack");
|
9
10
|
|
10
11
|
/** @typedef {import("../../declarations/WebpackOptions").WatchOptions} WatchOptions */
|
@@ -68,7 +69,22 @@ class NodeWatchFileSystem {
|
|
68
69
|
if (callbackUndelayed) {
|
69
70
|
this.watcher.once("change", callbackUndelayed);
|
70
71
|
}
|
72
|
+
|
73
|
+
const fetchTimeInfo = () => {
|
74
|
+
const fileTimeInfoEntries = new Map();
|
75
|
+
const contextTimeInfoEntries = new Map();
|
76
|
+
if (this.watcher) {
|
77
|
+
this.watcher.collectTimeInfoEntries(
|
78
|
+
fileTimeInfoEntries,
|
79
|
+
contextTimeInfoEntries
|
80
|
+
);
|
81
|
+
}
|
82
|
+
return { fileTimeInfoEntries, contextTimeInfoEntries };
|
83
|
+
};
|
71
84
|
this.watcher.once("aggregated", (changes, removals) => {
|
85
|
+
// pause emitting events (avoids clearing aggregated changes and removals on timeout)
|
86
|
+
this.watcher.pause();
|
87
|
+
|
72
88
|
if (this.inputFileSystem && this.inputFileSystem.purge) {
|
73
89
|
const fs = this.inputFileSystem;
|
74
90
|
for (const item of changes) {
|
@@ -78,8 +94,14 @@ class NodeWatchFileSystem {
|
|
78
94
|
fs.purge(item);
|
79
95
|
}
|
80
96
|
}
|
81
|
-
const
|
82
|
-
callback(
|
97
|
+
const { fileTimeInfoEntries, contextTimeInfoEntries } = fetchTimeInfo();
|
98
|
+
callback(
|
99
|
+
null,
|
100
|
+
fileTimeInfoEntries,
|
101
|
+
contextTimeInfoEntries,
|
102
|
+
changes,
|
103
|
+
removals
|
104
|
+
);
|
83
105
|
});
|
84
106
|
|
85
107
|
this.watcher.watch({ files, directories, missing, startTime });
|
@@ -99,39 +121,71 @@ class NodeWatchFileSystem {
|
|
99
121
|
this.watcher.pause();
|
100
122
|
}
|
101
123
|
},
|
102
|
-
getAggregatedRemovals: (
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
124
|
+
getAggregatedRemovals: util.deprecate(
|
125
|
+
() => {
|
126
|
+
const items = this.watcher && this.watcher.aggregatedRemovals;
|
127
|
+
if (items && this.inputFileSystem && this.inputFileSystem.purge) {
|
128
|
+
const fs = this.inputFileSystem;
|
129
|
+
for (const item of items) {
|
130
|
+
fs.purge(item);
|
131
|
+
}
|
108
132
|
}
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
133
|
+
return items;
|
134
|
+
},
|
135
|
+
"Watcher.getAggregatedRemovals is deprecated in favor of Watcher.getInfo since that's more performant.",
|
136
|
+
"DEP_WEBPACK_WATCHER_GET_AGGREGATED_REMOVALS"
|
137
|
+
),
|
138
|
+
getAggregatedChanges: util.deprecate(
|
139
|
+
() => {
|
140
|
+
const items = this.watcher && this.watcher.aggregatedChanges;
|
141
|
+
if (items && this.inputFileSystem && this.inputFileSystem.purge) {
|
142
|
+
const fs = this.inputFileSystem;
|
143
|
+
for (const item of items) {
|
144
|
+
fs.purge(item);
|
145
|
+
}
|
146
|
+
}
|
147
|
+
return items;
|
148
|
+
},
|
149
|
+
"Watcher.getAggregatedChanges is deprecated in favor of Watcher.getInfo since that's more performant.",
|
150
|
+
"DEP_WEBPACK_WATCHER_GET_AGGREGATED_CHANGES"
|
151
|
+
),
|
152
|
+
getFileTimeInfoEntries: util.deprecate(
|
153
|
+
() => {
|
154
|
+
return fetchTimeInfo().fileTimeInfoEntries;
|
155
|
+
},
|
156
|
+
"Watcher.getFileTimeInfoEntries is deprecated in favor of Watcher.getInfo since that's more performant.",
|
157
|
+
"DEP_WEBPACK_WATCHER_FILE_TIME_INFO_ENTRIES"
|
158
|
+
),
|
159
|
+
getContextTimeInfoEntries: util.deprecate(
|
160
|
+
() => {
|
161
|
+
return fetchTimeInfo().contextTimeInfoEntries;
|
162
|
+
},
|
163
|
+
"Watcher.getContextTimeInfoEntries is deprecated in favor of Watcher.getInfo since that's more performant.",
|
164
|
+
"DEP_WEBPACK_WATCHER_CONTEXT_TIME_INFO_ENTRIES"
|
165
|
+
),
|
166
|
+
getInfo: () => {
|
167
|
+
const removals = this.watcher && this.watcher.aggregatedRemovals;
|
168
|
+
const changes = this.watcher && this.watcher.aggregatedChanges;
|
169
|
+
if (this.inputFileSystem && this.inputFileSystem.purge) {
|
115
170
|
const fs = this.inputFileSystem;
|
116
|
-
|
117
|
-
|
171
|
+
if (removals) {
|
172
|
+
for (const item of removals) {
|
173
|
+
fs.purge(item);
|
174
|
+
}
|
175
|
+
}
|
176
|
+
if (changes) {
|
177
|
+
for (const item of changes) {
|
178
|
+
fs.purge(item);
|
179
|
+
}
|
118
180
|
}
|
119
181
|
}
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
}
|
128
|
-
},
|
129
|
-
getContextTimeInfoEntries: () => {
|
130
|
-
if (this.watcher) {
|
131
|
-
return this.watcher.getTimeInfoEntries();
|
132
|
-
} else {
|
133
|
-
return new Map();
|
134
|
-
}
|
182
|
+
const { fileTimeInfoEntries, contextTimeInfoEntries } = fetchTimeInfo();
|
183
|
+
return {
|
184
|
+
changes,
|
185
|
+
removals,
|
186
|
+
fileTimeInfoEntries,
|
187
|
+
contextTimeInfoEntries
|
188
|
+
};
|
135
189
|
}
|
136
190
|
};
|
137
191
|
}
|
@@ -103,9 +103,16 @@ class ConsumeSharedRuntimeModule extends RuntimeModule {
|
|
103
103
|
]
|
104
104
|
)};`,
|
105
105
|
`var getInvalidSingletonVersionMessage = ${runtimeTemplate.basicFunction(
|
106
|
-
"key, version, requiredVersion",
|
106
|
+
"scope, key, version, requiredVersion",
|
107
107
|
[
|
108
|
-
`return "Unsatisfied version " + version + " of shared singleton module " + key + " (required " + rangeToString(requiredVersion) + ")"`
|
108
|
+
`return "Unsatisfied version " + version + " from " + (version && scope[key][version].from) + " of shared singleton module " + key + " (required " + rangeToString(requiredVersion) + ")"`
|
109
|
+
]
|
110
|
+
)};`,
|
111
|
+
`var getSingleton = ${runtimeTemplate.basicFunction(
|
112
|
+
"scope, scopeName, key, requiredVersion",
|
113
|
+
[
|
114
|
+
"var version = findSingletonVersionKey(scope, key);",
|
115
|
+
"return get(scope[key][version]);"
|
109
116
|
]
|
110
117
|
)};`,
|
111
118
|
`var getSingletonVersion = ${runtimeTemplate.basicFunction(
|
@@ -113,7 +120,7 @@ class ConsumeSharedRuntimeModule extends RuntimeModule {
|
|
113
120
|
[
|
114
121
|
"var version = findSingletonVersionKey(scope, key);",
|
115
122
|
"if (!satisfy(requiredVersion, version)) " +
|
116
|
-
'typeof console !== "undefined" && console.warn && console.warn(getInvalidSingletonVersionMessage(key, version, requiredVersion));',
|
123
|
+
'typeof console !== "undefined" && console.warn && console.warn(getInvalidSingletonVersionMessage(scope, key, version, requiredVersion));',
|
117
124
|
"return get(scope[key][version]);"
|
118
125
|
]
|
119
126
|
)};`,
|
@@ -122,7 +129,7 @@ class ConsumeSharedRuntimeModule extends RuntimeModule {
|
|
122
129
|
[
|
123
130
|
"var version = findSingletonVersionKey(scope, key);",
|
124
131
|
"if (!satisfy(requiredVersion, version)) " +
|
125
|
-
"throw new Error(getInvalidSingletonVersionMessage(key, version, requiredVersion));",
|
132
|
+
"throw new Error(getInvalidSingletonVersionMessage(scope, key, version, requiredVersion));",
|
126
133
|
"return get(scope[key][version]);"
|
127
134
|
]
|
128
135
|
)};`,
|
@@ -202,6 +209,13 @@ class ConsumeSharedRuntimeModule extends RuntimeModule {
|
|
202
209
|
"return get(findValidVersion(scope, key, version) || warnInvalidVersion(scope, scopeName, key, version) || findVersion(scope, key));"
|
203
210
|
]
|
204
211
|
)});`,
|
212
|
+
`var loadSingleton = /*#__PURE__*/ init(${runtimeTemplate.basicFunction(
|
213
|
+
"scopeName, scope, key",
|
214
|
+
[
|
215
|
+
"ensureExistence(scopeName, key);",
|
216
|
+
"return getSingleton(scope, scopeName, key);"
|
217
|
+
]
|
218
|
+
)});`,
|
205
219
|
`var loadSingletonVersionCheck = /*#__PURE__*/ init(${runtimeTemplate.basicFunction(
|
206
220
|
"scopeName, scope, key, version",
|
207
221
|
[
|
@@ -230,6 +244,13 @@ class ConsumeSharedRuntimeModule extends RuntimeModule {
|
|
230
244
|
"return get(findValidVersion(scope, key, version) || warnInvalidVersion(scope, scopeName, key, version) || findVersion(scope, key));"
|
231
245
|
]
|
232
246
|
)});`,
|
247
|
+
`var loadSingletonFallback = /*#__PURE__*/ init(${runtimeTemplate.basicFunction(
|
248
|
+
"scopeName, scope, key, fallback",
|
249
|
+
[
|
250
|
+
`if(!scope || !${RuntimeGlobals.hasOwnProperty}(scope, key)) return fallback();`,
|
251
|
+
"return getSingleton(scope, scopeName, key);"
|
252
|
+
]
|
253
|
+
)});`,
|
233
254
|
`var loadSingletonVersionCheckFallback = /*#__PURE__*/ init(${runtimeTemplate.basicFunction(
|
234
255
|
"scopeName, scope, key, version, fallback",
|
235
256
|
[
|
@@ -1160,7 +1160,7 @@ const AVAILABLE_FORMATS = {
|
|
1160
1160
|
},
|
1161
1161
|
{ regExp: /(\(module has no exports\))/g, format: red },
|
1162
1162
|
{ regExp: /\(possible exports: (.+)\)/g, format: green },
|
1163
|
-
{ regExp:
|
1163
|
+
{ regExp: /(?:^|\n)(.* doesn't exist)/g, format: red },
|
1164
1164
|
{ regExp: /('\w+' option has not been set)/g, format: red },
|
1165
1165
|
{
|
1166
1166
|
regExp: /(Emitted value instead of an instance of Error)/g,
|
@@ -9,11 +9,18 @@ const memoize = require("./memoize");
|
|
9
9
|
|
10
10
|
const getValidate = memoize(() => require("schema-utils").validate);
|
11
11
|
|
12
|
-
const createSchemaValidation = (check
|
12
|
+
const createSchemaValidation = (check, getSchema, options) => {
|
13
13
|
getSchema = memoize(getSchema);
|
14
14
|
return value => {
|
15
|
-
if (!check(value)) {
|
15
|
+
if (check && !check(value)) {
|
16
16
|
getValidate()(getSchema(), value, options);
|
17
|
+
if (check) {
|
18
|
+
require("util").deprecate(
|
19
|
+
() => {},
|
20
|
+
"webpack bug: Pre-compiled schema reports error while real schema is happy. This has performance drawbacks.",
|
21
|
+
"DEP_WEBPACK_PRE_COMPILED_SCHEMA_INVALID"
|
22
|
+
)();
|
23
|
+
}
|
17
24
|
}
|
18
25
|
};
|
19
26
|
};
|
@@ -11,5 +11,8 @@
|
|
11
11
|
*/
|
12
12
|
module.exports = function extractUrlAndGlobal(urlAndGlobal) {
|
13
13
|
const index = urlAndGlobal.indexOf("@");
|
14
|
+
if (index <= 0 || index === urlAndGlobal.length - 1) {
|
15
|
+
throw new Error(`Invalid request "${urlAndGlobal}"`);
|
16
|
+
}
|
14
17
|
return [urlAndGlobal.substring(index + 1), urlAndGlobal.substring(0, index)];
|
15
18
|
};
|
package/lib/util/fs.js
CHANGED
@@ -61,6 +61,15 @@ const path = require("path");
|
|
61
61
|
/** @typedef {function((NodeJS.ErrnoException | Error | null)=, any=): void} ReadJsonCallback */
|
62
62
|
/** @typedef {function((NodeJS.ErrnoException | Error | null)=, IStats|string=): void} LstatReadlinkAbsoluteCallback */
|
63
63
|
|
64
|
+
/**
|
65
|
+
* @typedef {Object} WatcherInfo
|
66
|
+
* @property {Set<string>} changes get current aggregated changes that have not yet send to callback
|
67
|
+
* @property {Set<string>} removals get current aggregated removals that have not yet send to callback
|
68
|
+
* @property {Map<string, FileSystemInfoEntry | "ignore">} fileTimeInfoEntries get info about files
|
69
|
+
* @property {Map<string, FileSystemInfoEntry | "ignore">} contextTimeInfoEntries get info about directories
|
70
|
+
*/
|
71
|
+
|
72
|
+
// TODO webpack 6 deprecate missing getInfo
|
64
73
|
/**
|
65
74
|
* @typedef {Object} Watcher
|
66
75
|
* @property {function(): void} close closes the watcher and all underlying file watchers
|
@@ -69,6 +78,7 @@ const path = require("path");
|
|
69
78
|
* @property {function(): Set<string>=} getAggregatedRemovals get current aggregated removals that have not yet send to callback
|
70
79
|
* @property {function(): Map<string, FileSystemInfoEntry | "ignore">} getFileTimeInfoEntries get info about files
|
71
80
|
* @property {function(): Map<string, FileSystemInfoEntry | "ignore">} getContextTimeInfoEntries get info about directories
|
81
|
+
* @property {function(): WatcherInfo=} getInfo get info about timestamps and changes
|
72
82
|
*/
|
73
83
|
|
74
84
|
/**
|
@@ -59,13 +59,13 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule {
|
|
59
59
|
const {
|
60
60
|
runtimeTemplate,
|
61
61
|
outputOptions: {
|
62
|
-
globalObject,
|
63
62
|
chunkLoadingGlobal,
|
64
63
|
hotUpdateGlobal,
|
65
64
|
crossOriginLoading,
|
66
65
|
scriptType
|
67
66
|
}
|
68
67
|
} = compilation;
|
68
|
+
const globalObject = runtimeTemplate.globalObject;
|
69
69
|
const { linkPreload, linkPrefetch } =
|
70
70
|
JsonpChunkLoadingRuntimeModule.getCompilationHooks(compilation);
|
71
71
|
const fn = RuntimeGlobals.ensureChunkHandlers;
|
package/lib/webpack.js
CHANGED
@@ -96,6 +96,9 @@ const createCompiler = rawOptions => {
|
|
96
96
|
* @returns {MultiCompiler} the multi compiler object
|
97
97
|
*/
|
98
98
|
|
99
|
+
const asArray = options =>
|
100
|
+
Array.isArray(options) ? Array.from(options) : [options];
|
101
|
+
|
99
102
|
const webpack = /** @type {WebpackFunctionSingle & WebpackFunctionMulti} */ (
|
100
103
|
/**
|
101
104
|
* @param {WebpackOptions | (ReadonlyArray<WebpackOptions> & MultiCompilerOptions)} options options
|
@@ -104,8 +107,13 @@ const webpack = /** @type {WebpackFunctionSingle & WebpackFunctionMulti} */ (
|
|
104
107
|
*/
|
105
108
|
(options, callback) => {
|
106
109
|
const create = () => {
|
107
|
-
if (!
|
110
|
+
if (!asArray(options).every(webpackOptionsSchemaCheck)) {
|
108
111
|
getValidateSchema()(webpackOptionsSchema, options);
|
112
|
+
util.deprecate(
|
113
|
+
() => {},
|
114
|
+
"webpack bug: Pre-compiled schema reports error while real schema is happy. This has performance drawbacks.",
|
115
|
+
"DEP_WEBPACK_PRE_COMPILED_SCHEMA_INVALID"
|
116
|
+
)();
|
109
117
|
}
|
110
118
|
/** @type {MultiCompiler|Compiler} */
|
111
119
|
let compiler;
|
@@ -31,10 +31,11 @@ class ImportScriptsChunkLoadingRuntimeModule extends RuntimeModule {
|
|
31
31
|
chunkGraph,
|
32
32
|
compilation: {
|
33
33
|
runtimeTemplate,
|
34
|
-
outputOptions: {
|
34
|
+
outputOptions: { chunkLoadingGlobal, hotUpdateGlobal }
|
35
35
|
},
|
36
36
|
_withCreateScriptUrl: withCreateScriptUrl
|
37
37
|
} = this;
|
38
|
+
const globalObject = runtimeTemplate.globalObject;
|
38
39
|
const fn = RuntimeGlobals.ensureChunkHandlers;
|
39
40
|
const withBaseURI = this.runtimeRequirements.has(RuntimeGlobals.baseURI);
|
40
41
|
const withLoading = this.runtimeRequirements.has(
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "webpack",
|
3
|
-
"version": "5.
|
3
|
+
"version": "5.65.0",
|
4
4
|
"author": "Tobias Koppers @sokra",
|
5
5
|
"description": "Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.",
|
6
6
|
"license": "MIT",
|
@@ -27,7 +27,7 @@
|
|
27
27
|
"schema-utils": "^3.1.0",
|
28
28
|
"tapable": "^2.1.1",
|
29
29
|
"terser-webpack-plugin": "^5.1.3",
|
30
|
-
"watchpack": "^2.
|
30
|
+
"watchpack": "^2.3.1",
|
31
31
|
"webpack-sources": "^3.2.2"
|
32
32
|
},
|
33
33
|
"peerDependenciesMeta": {
|
@@ -98,7 +98,7 @@
|
|
98
98
|
"style-loader": "^2.0.0",
|
99
99
|
"terser": "^5.7.0",
|
100
100
|
"toml": "^3.0.0",
|
101
|
-
"tooling": "webpack/tooling#v1.20.
|
101
|
+
"tooling": "webpack/tooling#v1.20.1",
|
102
102
|
"ts-loader": "^8.0.2",
|
103
103
|
"typescript": "^4.2.0-beta",
|
104
104
|
"url-loader": "^4.1.0",
|