webpack 5.64.2 → 5.64.3

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.

@@ -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 = v => false, getSchema, options) => {
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
  };
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 (!webpackOptionsSchemaCheck(options)) {
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webpack",
3
- "version": "5.64.2",
3
+ "version": "5.64.3",
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",
@@ -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.0",
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",