Skip to content

Commit a68c2d2

Browse files
committed
Merge branch 'main' into markjm/context-timestamps
2 parents 5601c56 + c66e4ce commit a68c2d2

26 files changed

Lines changed: 138 additions & 21 deletions

lib/FileSystemInfo.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2256,7 +2256,9 @@ class FileSystemInfo {
22562256
for (const path of managedItems) {
22572257
const cache = this._managedItems.get(path);
22582258
if (cache !== undefined) {
2259-
managedFiles.add(join(this.fs, path, "package.json"));
2259+
if (cache !== "missing") {
2260+
managedFiles.add(join(this.fs, path, "package.json"));
2261+
}
22602262
managedItemInfo.set(path, cache);
22612263
} else {
22622264
jobs++;
@@ -2269,7 +2271,9 @@ class FileSystemInfo {
22692271
}
22702272
jobError();
22712273
} else if (entry) {
2272-
managedFiles.add(join(this.fs, path, "package.json"));
2274+
if (entry !== "missing") {
2275+
managedFiles.add(join(this.fs, path, "package.json"));
2276+
}
22732277
managedItemInfo.set(path, entry);
22742278
jobDone();
22752279
} else {

lib/util/create-schema-validation.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,18 @@ const memoize = require("./memoize");
99

1010
const getValidate = memoize(() => require("schema-utils").validate);
1111

12-
const createSchemaValidation = (check = v => false, getSchema, options) => {
12+
const createSchemaValidation = (check, getSchema, options) => {
1313
getSchema = memoize(getSchema);
1414
return value => {
15-
if (!check(value)) {
15+
if (check && !check(value)) {
1616
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+
}
1724
}
1825
};
1926
};

lib/webpack.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ const createCompiler = rawOptions => {
9696
* @returns {MultiCompiler} the multi compiler object
9797
*/
9898

99+
const asArray = options =>
100+
Array.isArray(options) ? Array.from(options) : [options];
101+
99102
const webpack = /** @type {WebpackFunctionSingle & WebpackFunctionMulti} */ (
100103
/**
101104
* @param {WebpackOptions | (ReadonlyArray<WebpackOptions> & MultiCompilerOptions)} options options
@@ -104,8 +107,13 @@ const webpack = /** @type {WebpackFunctionSingle & WebpackFunctionMulti} */ (
104107
*/
105108
(options, callback) => {
106109
const create = () => {
107-
if (!webpackOptionsSchemaCheck(options)) {
110+
if (!asArray(options).every(webpackOptionsSchemaCheck)) {
108111
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+
)();
109117
}
110118
/** @type {MultiCompiler|Compiler} */
111119
let compiler;

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "webpack",
3-
"version": "5.64.1",
3+
"version": "5.64.3",
44
"author": "Tobias Koppers @sokra",
55
"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.",
66
"license": "MIT",
@@ -98,7 +98,7 @@
9898
"style-loader": "^2.0.0",
9999
"terser": "^5.7.0",
100100
"toml": "^3.0.0",
101-
"tooling": "webpack/tooling#v1.20.0",
101+
"tooling": "webpack/tooling#v1.20.1",
102102
"ts-loader": "^8.0.2",
103103
"typescript": "^4.2.0-beta",
104104
"url-loader": "^4.1.0",

schemas/WebpackOptions.check.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

schemas/plugins/DllReferencePlugin.check.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

schemas/plugins/HashedModuleIdsPlugin.check.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

schemas/plugins/ProgressPlugin.check.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

schemas/plugins/asset/AssetParserOptions.check.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

schemas/plugins/optimize/AggressiveSplittingPlugin.check.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)