webpack 5.43.0 → 5.46.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.

@@ -0,0 +1,110 @@
1
+ /*
2
+ MIT License http://www.opensource.org/licenses/mit-license.php
3
+ Author Tobias Koppers @sokra
4
+ */
5
+
6
+ "use strict";
7
+
8
+ /**
9
+ * @template K
10
+ * @template V
11
+ */
12
+ class StackedCacheMap {
13
+ constructor() {
14
+ /** @type {Map<K, V>} */
15
+ this.map = new Map();
16
+ /** @type {ReadonlyMap<K, V>[]} */
17
+ this.stack = [];
18
+ }
19
+
20
+ /**
21
+ * @param {ReadonlyMap<K, V>} map map to add
22
+ * @param {boolean} immutable if 'map' is immutable and StackedCacheMap can keep referencing it
23
+ */
24
+ addAll(map, immutable) {
25
+ if (immutable) {
26
+ this.stack.push(map);
27
+
28
+ // largest map should go first
29
+ for (let i = this.stack.length - 1; i > 0; i--) {
30
+ const beforeLast = this.stack[i - 1];
31
+ if (beforeLast.size >= map.size) break;
32
+ this.stack[i] = beforeLast;
33
+ this.stack[i - 1] = map;
34
+ }
35
+ } else {
36
+ for (const [key, value] of map) {
37
+ this.map.set(key, value);
38
+ }
39
+ }
40
+ }
41
+
42
+ /**
43
+ * @param {K} item the key of the element to add
44
+ * @param {V} value the value of the element to add
45
+ * @returns {void}
46
+ */
47
+ set(item, value) {
48
+ this.map.set(item, value);
49
+ }
50
+
51
+ /**
52
+ * @param {K} item the item to delete
53
+ * @returns {void}
54
+ */
55
+ delete(item) {
56
+ throw new Error("Items can't be deleted from a StackedCacheMap");
57
+ }
58
+
59
+ /**
60
+ * @param {K} item the item to test
61
+ * @returns {boolean} true if the item exists in this set
62
+ */
63
+ has(item) {
64
+ throw new Error(
65
+ "Checking StackedCacheMap.has before reading is inefficient, use StackedCacheMap.get and check for undefined"
66
+ );
67
+ }
68
+
69
+ /**
70
+ * @param {K} item the key of the element to return
71
+ * @returns {V} the value of the element
72
+ */
73
+ get(item) {
74
+ for (const map of this.stack) {
75
+ const value = map.get(item);
76
+ if (value !== undefined) return value;
77
+ }
78
+ return this.map.get(item);
79
+ }
80
+
81
+ clear() {
82
+ this.stack.length = 0;
83
+ this.map.clear();
84
+ }
85
+
86
+ get size() {
87
+ let size = this.map.size;
88
+ for (const map of this.stack) {
89
+ size += map.size;
90
+ }
91
+ return size;
92
+ }
93
+
94
+ [Symbol.iterator]() {
95
+ const iterators = this.stack.map(map => map[Symbol.iterator]());
96
+ let current = this.map[Symbol.iterator]();
97
+ return {
98
+ next() {
99
+ let result = current.next();
100
+ while (result.done && iterators.length > 0) {
101
+ current = iterators.pop();
102
+ result = current.next();
103
+ }
104
+ return result;
105
+ }
106
+ };
107
+ }
108
+ }
109
+
110
+ module.exports = StackedCacheMap;
package/lib/webpack.js CHANGED
@@ -152,7 +152,7 @@ const webpack = /** @type {WebpackFunctionSingle & WebpackFunctionMulti} */ (
152
152
  if (watch) {
153
153
  util.deprecate(
154
154
  () => {},
155
- "A 'callback' argument need to be provided to the 'webpack(options, callback)' function when the 'watch' option is set. There is no way to handle the 'watch' option without a callback.",
155
+ "A 'callback' argument needs to be provided to the 'webpack(options, callback)' function when the 'watch' option is set. There is no way to handle the 'watch' option without a callback.",
156
156
  "DEP_WEBPACK_WATCH_WITHOUT_CALLBACK"
157
157
  )();
158
158
  }
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "webpack",
3
- "version": "5.43.0",
3
+ "version": "5.46.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",
7
7
  "dependencies": {
8
8
  "@types/eslint-scope": "^3.7.0",
9
- "@types/estree": "^0.0.49",
9
+ "@types/estree": "^0.0.50",
10
10
  "@webassemblyjs/ast": "1.11.1",
11
11
  "@webassemblyjs/wasm-edit": "1.11.1",
12
12
  "@webassemblyjs/wasm-parser": "1.11.1",
@@ -23,11 +23,11 @@
23
23
  "loader-runner": "^4.2.0",
24
24
  "mime-types": "^2.1.27",
25
25
  "neo-async": "^2.6.2",
26
- "schema-utils": "^3.0.0",
26
+ "schema-utils": "^3.1.0",
27
27
  "tapable": "^2.1.1",
28
28
  "terser-webpack-plugin": "^5.1.3",
29
29
  "watchpack": "^2.2.0",
30
- "webpack-sources": "^2.3.0"
30
+ "webpack-sources": "^2.3.1"
31
31
  },
32
32
  "peerDependenciesMeta": {
33
33
  "webpack-cli": {
@@ -38,7 +38,7 @@
38
38
  "@babel/core": "^7.11.1",
39
39
  "@babel/preset-react": "^7.10.4",
40
40
  "@types/es-module-lexer": "^0.4.1",
41
- "@types/jest": "^26.0.15",
41
+ "@types/jest": "^26.0.24",
42
42
  "@types/node": "^15.0.1",
43
43
  "babel-loader": "^8.1.0",
44
44
  "benchmark": "^2.1.4",
@@ -54,7 +54,7 @@
54
54
  "es6-promise-polyfill": "^1.2.0",
55
55
  "eslint": "^7.14.0",
56
56
  "eslint-config-prettier": "^8.1.0",
57
- "eslint-plugin-jest": "^24.1.3",
57
+ "eslint-plugin-jest": "^24.3.6",
58
58
  "eslint-plugin-jsdoc": "^33.0.0",
59
59
  "eslint-plugin-node": "^11.0.0",
60
60
  "eslint-plugin-prettier": "^3.1.4",
@@ -63,7 +63,8 @@
63
63
  "husky": "^6.0.0",
64
64
  "is-ci": "^3.0.0",
65
65
  "istanbul": "^0.4.5",
66
- "jest": "^26.6.3",
66
+ "jest": "^27.0.6",
67
+ "jest-circus": "^27.0.6",
67
68
  "jest-diff": "^27.0.2",
68
69
  "jest-junit": "^12.0.0",
69
70
  "json-loader": "^0.5.7",
@@ -75,7 +76,7 @@
75
76
  "lodash": "^4.17.19",
76
77
  "lodash-es": "^4.17.15",
77
78
  "memfs": "^3.2.0",
78
- "mini-css-extract-plugin": "^1.0.0",
79
+ "mini-css-extract-plugin": "^1.6.1",
79
80
  "mini-svg-data-uri": "^1.2.3",
80
81
  "nyc": "^15.1.0",
81
82
  "open-cli": "^6.0.1",
@@ -131,10 +132,11 @@
131
132
  ],
132
133
  "scripts": {
133
134
  "setup": "node ./setup/setup.js",
134
- "test": "node --max-old-space-size=4096 --experimental-vm-modules --trace-deprecation node_modules/jest-cli/bin/jest",
135
+ "jest": "node --expose-gc --max-old-space-size=4096 --experimental-vm-modules --trace-deprecation node_modules/jest-cli/bin/jest --logHeapUsage",
136
+ "test": "node --expose-gc --max-old-space-size=4096 --experimental-vm-modules --trace-deprecation node_modules/jest-cli/bin/jest --logHeapUsage",
135
137
  "test:update-snapshots": "yarn jest -u",
136
- "test:integration": "node --max-old-space-size=4096 --experimental-vm-modules --trace-deprecation node_modules/jest-cli/bin/jest --testMatch \"<rootDir>/test/*.test.js\"",
137
- "test:basic": "node --max-old-space-size=4096 --experimental-vm-modules --trace-deprecation node_modules/jest-cli/bin/jest --testMatch \"<rootDir>/te{st/TestCasesNormal,st/StatsTestCases,st/ConfigTestCases}.test.js\"",
138
+ "test:integration": "node --expose-gc --max-old-space-size=4096 --experimental-vm-modules --trace-deprecation node_modules/jest-cli/bin/jest --logHeapUsage --testMatch \"<rootDir>/test/*.{basictest,longtest,test}.js\"",
139
+ "test:basic": "node --expose-gc --max-old-space-size=4096 --experimental-vm-modules --trace-deprecation node_modules/jest-cli/bin/jest --logHeapUsage --testMatch \"<rootDir>/test/*.basictest.js\"",
138
140
  "test:unit": "node --max-old-space-size=4096 --experimental-vm-modules --trace-deprecation node_modules/jest-cli/bin/jest --testMatch \"<rootDir>/test/*.unittest.js\"",
139
141
  "travis:integration": "yarn cover:integration --ci $JEST",
140
142
  "travis:basic": "yarn cover:basic --ci $JEST",
@@ -165,12 +167,14 @@
165
167
  "benchmark": "node --max-old-space-size=4096 --experimental-vm-modules --trace-deprecation node_modules/jest-cli/bin/jest --testMatch \"<rootDir>/test/*.benchmark.js\" --runInBand",
166
168
  "cover": "yarn cover:all && yarn cover:report",
167
169
  "cover:clean": "rimraf .nyc_output coverage",
168
- "cover:all": "node --max-old-space-size=4096 --experimental-vm-modules node_modules/jest-cli/bin/jest --coverage",
169
- "cover:basic": "node --max-old-space-size=4096 --experimental-vm-modules node_modules/jest-cli/bin/jest --testMatch \"<rootDir>/te{st/TestCasesNormal,st/StatsTestCases,st/ConfigTestCases}.test.js\" --coverage",
170
- "cover:integration": "node --max-old-space-size=4096 --experimental-vm-modules node_modules/jest-cli/bin/jest --testMatch \"<rootDir>/test/*.test.js\" --coverage",
170
+ "cover:all": "node --expose-gc --max-old-space-size=4096 --experimental-vm-modules node_modules/jest-cli/bin/jest --logHeapUsage --coverage",
171
+ "cover:basic": "node --expose-gc --max-old-space-size=4096 --experimental-vm-modules node_modules/jest-cli/bin/jest --logHeapUsage --testMatch \"<rootDir>/test/*.basictest.js\" --coverage",
172
+ "cover:integration": "node --expose-gc --max-old-space-size=4096 --experimental-vm-modules node_modules/jest-cli/bin/jest --logHeapUsage --testMatch \"<rootDir>/test/*.{basictest,longtest,test}.js\" --coverage",
173
+ "cover:integration:a": "node --expose-gc --max-old-space-size=4096 --experimental-vm-modules node_modules/jest-cli/bin/jest --logHeapUsage --testMatch \"<rootDir>/test/*.{basictest,test}.js\" --coverage",
174
+ "cover:integration:b": "node --expose-gc --max-old-space-size=4096 --experimental-vm-modules node_modules/jest-cli/bin/jest --logHeapUsage --testMatch \"<rootDir>/test/*.longtest.js\" --coverage",
171
175
  "cover:unit": "node --max-old-space-size=4096 --experimental-vm-modules node_modules/jest-cli/bin/jest --testMatch \"<rootDir>/test/*.unittest.js\" --coverage",
172
176
  "cover:types": "node node_modules/tooling/type-coverage",
173
- "cover:merge": "nyc merge .nyc_output coverage/coverage-nyc.json && rimraf .nyc_output",
177
+ "cover:merge": "yarn mkdirp .nyc_output && nyc merge .nyc_output coverage/coverage-nyc.json && rimraf .nyc_output",
174
178
  "cover:report": "nyc report -t coverage"
175
179
  },
176
180
  "lint-staged": {
@@ -191,6 +195,8 @@
191
195
  ],
192
196
  "testMatch": [
193
197
  "<rootDir>/test/*.test.js",
198
+ "<rootDir>/test/*.basictest.js",
199
+ "<rootDir>/test/*.longtest.js",
194
200
  "<rootDir>/test/*.unittest.js"
195
201
  ],
196
202
  "watchPathIgnorePatterns": [