webpack 4.41.5 → 4.41.6
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/declarations/WebpackOptions.d.ts +2 -2
- package/lib/FlagDependencyExportsPlugin.js +33 -7
- package/lib/HotModuleReplacement.runtime.js +11 -2
- package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +5 -1
- package/lib/node/NodeMainTemplate.runtime.js +6 -1
- package/lib/node/NodeMainTemplateAsync.runtime.js +7 -1
- package/lib/web/JsonpMainTemplate.runtime.js +8 -1
- package/lib/webworker/WebWorkerMainTemplate.runtime.js +9 -1
- package/package.json +1 -1
- package/schemas/WebpackOptions.json +2 -4
- package/schemas/ajv.absolutePath.js +6 -4
@@ -132,7 +132,7 @@ export type RuleSetCondition =
|
|
132
132
|
* This interface was referenced by `WebpackOptions`'s JSON-Schema
|
133
133
|
* via the `definition` "RuleSetConditions".
|
134
134
|
*/
|
135
|
-
export type RuleSetConditions =
|
135
|
+
export type RuleSetConditions = RuleSetCondition[];
|
136
136
|
/**
|
137
137
|
* One or multiple rule conditions
|
138
138
|
*
|
@@ -181,7 +181,7 @@ export type RuleSetConditionAbsolute =
|
|
181
181
|
* This interface was referenced by `WebpackOptions`'s JSON-Schema
|
182
182
|
* via the `definition` "RuleSetConditionsAbsolute".
|
183
183
|
*/
|
184
|
-
export type RuleSetConditionsAbsolute =
|
184
|
+
export type RuleSetConditionsAbsolute = RuleSetConditionAbsolute[];
|
185
185
|
/**
|
186
186
|
* This interface was referenced by `WebpackOptions`'s JSON-Schema
|
187
187
|
* via the `definition` "RuleSetLoader".
|
@@ -7,11 +7,9 @@
|
|
7
7
|
const Queue = require("./util/Queue");
|
8
8
|
|
9
9
|
const addToSet = (a, b) => {
|
10
|
-
const size = a.size;
|
11
10
|
for (const item of b) {
|
12
11
|
a.add(item);
|
13
12
|
}
|
14
|
-
return a.size !== size;
|
15
13
|
};
|
16
14
|
|
17
15
|
class FlagDependencyExportsPlugin {
|
@@ -58,14 +56,11 @@ class FlagDependencyExportsPlugin {
|
|
58
56
|
// break if it should move to the worst state
|
59
57
|
if (exports === true) {
|
60
58
|
module.buildMeta.providedExports = true;
|
61
|
-
notifyDependencies();
|
62
59
|
return true;
|
63
60
|
}
|
64
61
|
// merge in new exports
|
65
62
|
if (Array.isArray(exports)) {
|
66
|
-
|
67
|
-
notifyDependencies();
|
68
|
-
}
|
63
|
+
addToSet(moduleProvidedExports, exports);
|
69
64
|
}
|
70
65
|
// store dependencies
|
71
66
|
const exportDeps = exportDesc.dependencies;
|
@@ -93,6 +88,26 @@ class FlagDependencyExportsPlugin {
|
|
93
88
|
}
|
94
89
|
};
|
95
90
|
|
91
|
+
const notifyDependenciesIfDifferent = (set, array) => {
|
92
|
+
const deps = dependencies.get(module);
|
93
|
+
if (deps !== undefined) {
|
94
|
+
if (set.size === array.length) {
|
95
|
+
let i = 0;
|
96
|
+
let different = false;
|
97
|
+
for (const item of set) {
|
98
|
+
if (item !== array[i++]) {
|
99
|
+
different = true;
|
100
|
+
break;
|
101
|
+
}
|
102
|
+
}
|
103
|
+
if (!different) return;
|
104
|
+
}
|
105
|
+
for (const dep of deps) {
|
106
|
+
queue.enqueue(dep);
|
107
|
+
}
|
108
|
+
}
|
109
|
+
};
|
110
|
+
|
96
111
|
// Start with all modules without provided exports
|
97
112
|
for (const module of modules) {
|
98
113
|
if (module.buildInfo.temporaryProvidedExports) {
|
@@ -116,9 +131,20 @@ class FlagDependencyExportsPlugin {
|
|
116
131
|
processDependenciesBlock(module);
|
117
132
|
module.buildInfo.temporaryProvidedExports = providedExportsAreTemporary;
|
118
133
|
if (!moduleWithExports) {
|
134
|
+
notifyDependencies();
|
119
135
|
module.buildMeta.providedExports = true;
|
136
|
+
} else if (module.buildMeta.providedExports === true) {
|
137
|
+
notifyDependencies();
|
138
|
+
} else if (!module.buildMeta.providedExports) {
|
120
139
|
notifyDependencies();
|
121
|
-
|
140
|
+
module.buildMeta.providedExports = Array.from(
|
141
|
+
moduleProvidedExports
|
142
|
+
);
|
143
|
+
} else {
|
144
|
+
notifyDependenciesIfDifferent(
|
145
|
+
moduleProvidedExports,
|
146
|
+
module.buildMeta.providedExports
|
147
|
+
);
|
122
148
|
module.buildMeta.providedExports = Array.from(
|
123
149
|
moduleProvidedExports
|
124
150
|
);
|
@@ -2,7 +2,17 @@
|
|
2
2
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
3
|
Author Tobias Koppers @sokra
|
4
4
|
*/
|
5
|
-
|
5
|
+
// eslint-disable no-unused-vars
|
6
|
+
var $hash$ = undefined;
|
7
|
+
var $requestTimeout$ = undefined;
|
8
|
+
var installedModules = undefined;
|
9
|
+
var $require$ = undefined;
|
10
|
+
var hotDownloadManifest = undefined;
|
11
|
+
var hotDownloadUpdateChunk = undefined;
|
12
|
+
var hotDisposeChunk = undefined;
|
13
|
+
var modules = undefined;
|
14
|
+
var chunkId = undefined;
|
15
|
+
|
6
16
|
module.exports = function() {
|
7
17
|
var hotApplyOnUpdate = true;
|
8
18
|
// eslint-disable-next-line no-unused-vars
|
@@ -204,7 +214,6 @@ module.exports = function() {
|
|
204
214
|
/*foreachInstalledChunks*/
|
205
215
|
// eslint-disable-next-line no-lone-blocks
|
206
216
|
{
|
207
|
-
/*globals chunkId */
|
208
217
|
hotEnsureUpdateChunk(chunkId);
|
209
218
|
}
|
210
219
|
if (
|
@@ -304,9 +304,13 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency {
|
|
304
304
|
}
|
305
305
|
|
306
306
|
if (Array.isArray(importedModule.buildMeta.providedExports)) {
|
307
|
+
const activeFromOtherStarExports = this._discoverActiveExportsFromOtherStartExports();
|
307
308
|
return {
|
308
309
|
exports: importedModule.buildMeta.providedExports.filter(
|
309
|
-
id =>
|
310
|
+
id =>
|
311
|
+
id !== "default" &&
|
312
|
+
!activeFromOtherStarExports.has(id) &&
|
313
|
+
!this.activeExports.has(id)
|
310
314
|
),
|
311
315
|
dependencies: [importedModule]
|
312
316
|
};
|
@@ -2,7 +2,12 @@
|
|
2
2
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
3
|
Author Tobias Koppers @sokra
|
4
4
|
*/
|
5
|
-
|
5
|
+
// eslint-disable-next-line no-unused-vars
|
6
|
+
var $hotChunkFilename$ = undefined;
|
7
|
+
var hotAddUpdateChunk = undefined;
|
8
|
+
var installedChunks = undefined;
|
9
|
+
var $hotMainFilename$ = undefined;
|
10
|
+
|
6
11
|
module.exports = function() {
|
7
12
|
// eslint-disable-next-line no-unused-vars
|
8
13
|
function hotDownloadUpdateChunk(chunkId) {
|
@@ -2,7 +2,13 @@
|
|
2
2
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
3
|
Author Tobias Koppers @sokra
|
4
4
|
*/
|
5
|
-
|
5
|
+
// eslint-disable-next-line no-unused-vars
|
6
|
+
var $hotChunkFilename$ = undefined;
|
7
|
+
var $require$ = undefined;
|
8
|
+
var hotAddUpdateChunk = undefined;
|
9
|
+
var $hotMainFilename$ = undefined;
|
10
|
+
var installedChunks = undefined;
|
11
|
+
|
6
12
|
module.exports = function() {
|
7
13
|
// eslint-disable-next-line no-unused-vars
|
8
14
|
function hotDownloadUpdateChunk(chunkId) {
|
@@ -2,7 +2,14 @@
|
|
2
2
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
3
|
Author Tobias Koppers @sokra
|
4
4
|
*/
|
5
|
-
|
5
|
+
// eslint-disable-next-line no-unused-vars
|
6
|
+
var hotAddUpdateChunk = undefined;
|
7
|
+
var parentHotUpdateCallback = undefined;
|
8
|
+
var $require$ = undefined;
|
9
|
+
var $hotMainFilename$ = undefined;
|
10
|
+
var $hotChunkFilename$ = undefined;
|
11
|
+
var $crossOriginLoading$ = undefined;
|
12
|
+
|
6
13
|
module.exports = function() {
|
7
14
|
// eslint-disable-next-line no-unused-vars
|
8
15
|
function webpackHotUpdateCallback(chunkId, moreModules) {
|
@@ -2,7 +2,15 @@
|
|
2
2
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
3
|
Author Tobias Koppers @sokra
|
4
4
|
*/
|
5
|
-
|
5
|
+
// eslint-disable-next-line no-unused-vars
|
6
|
+
var hotAddUpdateChunk = undefined;
|
7
|
+
var parentHotUpdateCallback = undefined;
|
8
|
+
var $require$ = undefined;
|
9
|
+
var $hotChunkFilename$ = undefined;
|
10
|
+
var $hotMainFilename$ = undefined;
|
11
|
+
var installedChunks = undefined;
|
12
|
+
var importScripts = undefined;
|
13
|
+
|
6
14
|
module.exports = function() {
|
7
15
|
// eslint-disable-next-line no-unused-vars
|
8
16
|
function webpackHotUpdateCallback(chunkId, moreModules) {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "webpack",
|
3
|
-
"version": "4.41.
|
3
|
+
"version": "4.41.6",
|
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",
|
@@ -1428,8 +1428,7 @@
|
|
1428
1428
|
"$ref": "#/definitions/RuleSetCondition"
|
1429
1429
|
}
|
1430
1430
|
]
|
1431
|
-
}
|
1432
|
-
"tsType": "RuleSetConditionsRecursive"
|
1431
|
+
}
|
1433
1432
|
},
|
1434
1433
|
"RuleSetConditionsAbsolute": {
|
1435
1434
|
"type": "array",
|
@@ -1440,8 +1439,7 @@
|
|
1440
1439
|
"$ref": "#/definitions/RuleSetConditionAbsolute"
|
1441
1440
|
}
|
1442
1441
|
]
|
1443
|
-
}
|
1444
|
-
"tsType": "RuleSetConditionsAbsoluteRecursive"
|
1442
|
+
}
|
1445
1443
|
},
|
1446
1444
|
"RuleSetLoader": {
|
1447
1445
|
"type": "string",
|
@@ -25,8 +25,6 @@ module.exports = ajv =>
|
|
25
25
|
function callback(data) {
|
26
26
|
let passes = true;
|
27
27
|
const isExclamationMarkPresent = data.includes("!");
|
28
|
-
const isCorrectAbsoluteOrRelativePath =
|
29
|
-
expected === /^(?:[A-Za-z]:\\|\/)/.test(data);
|
30
28
|
|
31
29
|
if (isExclamationMarkPresent) {
|
32
30
|
callback.errors = [
|
@@ -40,8 +38,12 @@ module.exports = ajv =>
|
|
40
38
|
];
|
41
39
|
passes = false;
|
42
40
|
}
|
43
|
-
|
44
|
-
|
41
|
+
// ?:[A-Za-z]:\\ - Windows absolute path
|
42
|
+
// \\\\ - Windows network absolute path
|
43
|
+
// \/ - Unix-like OS absolute path
|
44
|
+
const isCorrectAbsolutePath =
|
45
|
+
expected === /^(?:[A-Za-z]:\\|\\\\|\/)/.test(data);
|
46
|
+
if (!isCorrectAbsolutePath) {
|
45
47
|
callback.errors = [getErrorFor(expected, data, schema)];
|
46
48
|
passes = false;
|
47
49
|
}
|