add externalsType option

fix a few edge cases in ExternalModule
This commit is contained in:
Tobias Koppers 2020-02-18 10:44:55 +01:00
parent e63c73cc90
commit e5b51235d7
7 changed files with 150 additions and 81 deletions

View File

@ -100,6 +100,26 @@ export type ExternalItem =
* Array of strings
*/
export type ArrayOfStringValues = string[];
/**
* Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value)
*/
export type ExternalsType =
| "var"
| "module"
| "assign"
| "this"
| "window"
| "self"
| "global"
| "commonjs"
| "commonjs2"
| "commonjs-module"
| "amd"
| "amd-require"
| "umd"
| "umd2"
| "jsonp"
| "system";
/**
* Filtering values
*/
@ -426,6 +446,10 @@ export interface WebpackOptions {
* Specify dependencies that shouldn't be resolved by webpack, but should become dependencies of the resulting bundle. The kind of the dependency depends on `output.libraryTarget`.
*/
externals?: Externals;
/**
* Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value)
*/
externalsType?: ExternalsType;
/**
* Options for infrastructure level logging
*/
@ -1804,6 +1828,10 @@ export interface WebpackOptionsNormalized {
* Specify dependencies that shouldn't be resolved by webpack, but should become dependencies of the resulting bundle. The kind of the dependency depends on `output.libraryTarget`.
*/
externals: Externals;
/**
* Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value)
*/
externalsType?: ExternalsType;
/**
* Options for infrastructure level logging
*/

View File

@ -10,6 +10,7 @@ const Module = require("./Module");
const RuntimeGlobals = require("./RuntimeGlobals");
const Template = require("./Template");
const makeSerializable = require("./util/makeSerializable");
const propertyAccess = require("./util/propertyAccess");
/** @typedef {import("webpack-sources").Source} Source */
/** @typedef {import("../declarations/WebpackOptions").WebpackOptionsNormalized} WebpackOptions */
@ -116,10 +117,7 @@ const getSourceForDefaultCase = (optional, request, runtimeTemplate) => {
const missingModuleError = optional
? checkExternalVariable(variableName, request.join("."), runtimeTemplate)
: "";
const objectLookup = request
.slice(1)
.map(r => `[${JSON.stringify(r)}]`)
.join("");
const objectLookup = propertyAccess(request, 1);
return `${missingModuleError}module.exports = ${variableName}${objectLookup};`;
};
@ -220,18 +218,24 @@ class ExternalModule extends Module {
);
case "commonjs":
case "commonjs2":
case "commonjs-module":
return getSourceForCommonJsExternal(request);
case "amd":
case "amd-require":
case "umd":
case "umd2":
case "system":
case "jsonp":
return getSourceForAmdOrUmdExternal(
chunkGraph.getModuleId(this),
this.isOptional(moduleGraph),
request,
runtimeTemplate
);
case "module":
throw new Error("Module external type is not implemented yet");
case "var":
case "assign":
default:
return getSourceForDefaultCase(
this.isOptional(moduleGraph),

View File

@ -227,10 +227,9 @@ class WebpackOptionsApply extends OptionsApply {
}
if (options.externals) {
const ExternalsPlugin = require("./ExternalsPlugin");
new ExternalsPlugin(
options.output.libraryTarget,
options.externals
).apply(compiler);
new ExternalsPlugin(options.externalsType, options.externals).apply(
compiler
);
}
if (options.output.pathinfo) {
@ -283,6 +282,11 @@ class WebpackOptionsApply extends OptionsApply {
"'output.libraryTarget: \"module\"' is only allowed when 'experiments.outputModule' is enabled"
);
}
if (options.externalsType === "module") {
throw new Error(
"'externalsType: \"module\"' is only allowed when 'experiments.outputModule' is enabled"
);
}
}
if (options.experiments.asset) {

View File

@ -118,6 +118,8 @@ const applyWebpackOptionsDefaults = options => {
development
});
D(options, "externalsType", options.output.libraryTarget);
applyNodeDefaults(options.node, { target });
F(options, "performance", () => (production && webTarget ? {} : false));

View File

@ -363,6 +363,27 @@
}
]
},
"ExternalsType": {
"description": "Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value)",
"enum": [
"var",
"module",
"assign",
"this",
"window",
"self",
"global",
"commonjs",
"commonjs2",
"commonjs-module",
"amd",
"amd-require",
"umd",
"umd2",
"jsonp",
"system"
]
},
"FileCacheOptions": {
"description": "Options object for persistent file-based caching",
"type": "object",
@ -2752,6 +2773,9 @@
"externals": {
"$ref": "#/definitions/Externals"
},
"externalsType": {
"$ref": "#/definitions/ExternalsType"
},
"infrastructureLogging": {
"$ref": "#/definitions/InfrastructureLogging"
},
@ -2883,6 +2907,9 @@
"externals": {
"$ref": "#/definitions/Externals"
},
"externalsType": {
"$ref": "#/definitions/ExternalsType"
},
"infrastructureLogging": {
"$ref": "#/definitions/InfrastructureLogging"
},

View File

@ -98,6 +98,7 @@ describe("Defaults", () => {
"topLevelAwait": false,
},
"externals": undefined,
"externalsType": "var",
"infrastructureLogging": Object {
"debug": false,
"level": "info",
@ -291,10 +292,10 @@ describe("Defaults", () => {
- Expected
+ Received
@@ -32,1 +32,1 @@
@@ -33,1 +33,1 @@
- "mode": "none",
+ "mode": undefined,
@@ -67,4 +67,4 @@
@@ -68,4 +68,4 @@
- "checkWasmTypes": false,
- "chunkIds": "natural",
- "concatenateModules": false,
@ -303,30 +304,30 @@ describe("Defaults", () => {
+ "chunkIds": "deterministic",
+ "concatenateModules": true,
+ "flagIncludedChunks": true,
@@ -72,1 +72,1 @@
@@ -73,1 +73,1 @@
- "mangleExports": false,
+ "mangleExports": true,
@@ -75,1 +75,1 @@
@@ -76,1 +76,1 @@
- "minimize": false,
+ "minimize": true,
@@ -81,3 +81,3 @@
@@ -82,3 +82,3 @@
- "moduleIds": "natural",
- "noEmitOnErrors": false,
- "nodeEnv": false,
+ "moduleIds": "deterministic",
+ "noEmitOnErrors": true,
+ "nodeEnv": "production",
@@ -107,3 +107,3 @@
@@ -108,3 +108,3 @@
- "hidePathInfo": false,
- "maxAsyncRequests": Infinity,
- "maxInitialRequests": Infinity,
+ "hidePathInfo": true,
+ "maxAsyncRequests": 6,
+ "maxInitialRequests": 4,
@@ -112,1 +112,1 @@
@@ -113,1 +113,1 @@
- "minSize": 10000,
+ "minSize": 30000,
@@ -148,1 +148,5 @@
@@ -149,1 +149,5 @@
- "performance": false,
+ "performance": Object {
+ "hints": "warning",
@ -340,10 +341,10 @@ describe("Defaults", () => {
- Expected
+ Received
@@ -32,1 +32,1 @@
@@ -33,1 +33,1 @@
- "mode": "none",
+ "mode": "production",
@@ -67,4 +67,4 @@
@@ -68,4 +68,4 @@
- "checkWasmTypes": false,
- "chunkIds": "natural",
- "concatenateModules": false,
@ -352,30 +353,30 @@ describe("Defaults", () => {
+ "chunkIds": "deterministic",
+ "concatenateModules": true,
+ "flagIncludedChunks": true,
@@ -72,1 +72,1 @@
@@ -73,1 +73,1 @@
- "mangleExports": false,
+ "mangleExports": true,
@@ -75,1 +75,1 @@
@@ -76,1 +76,1 @@
- "minimize": false,
+ "minimize": true,
@@ -81,3 +81,3 @@
@@ -82,3 +82,3 @@
- "moduleIds": "natural",
- "noEmitOnErrors": false,
- "nodeEnv": false,
+ "moduleIds": "deterministic",
+ "noEmitOnErrors": true,
+ "nodeEnv": "production",
@@ -107,3 +107,3 @@
@@ -108,3 +108,3 @@
- "hidePathInfo": false,
- "maxAsyncRequests": Infinity,
- "maxInitialRequests": Infinity,
+ "hidePathInfo": true,
+ "maxAsyncRequests": 6,
+ "maxInitialRequests": 4,
@@ -112,1 +112,1 @@
@@ -113,1 +113,1 @@
- "minSize": 10000,
+ "minSize": 30000,
@@ -148,1 +148,5 @@
@@ -149,1 +149,5 @@
- "performance": false,
+ "performance": Object {
+ "hints": "warning",
@ -401,31 +402,31 @@ describe("Defaults", () => {
@@ -8,1 +14,1 @@
- "devtool": false,
+ "devtool": "eval",
@@ -32,1 +38,1 @@
@@ -33,1 +39,1 @@
- "mode": "none",
+ "mode": "development",
@@ -55,1 +61,1 @@
@@ -56,1 +62,1 @@
- "unsafeCache": false,
+ "unsafeCache": [Function anonymous],
@@ -68,1 +74,1 @@
@@ -69,1 +75,1 @@
- "chunkIds": "natural",
+ "chunkIds": "named",
@@ -81,1 +87,1 @@
@@ -82,1 +88,1 @@
- "moduleIds": "natural",
+ "moduleIds": "named",
@@ -83,1 +89,1 @@
@@ -84,1 +90,1 @@
- "nodeEnv": false,
+ "nodeEnv": "development",
@@ -111,1 +117,1 @@
@@ -112,1 +118,1 @@
- "minRemainingSize": undefined,
+ "minRemainingSize": 0,
@@ -140,1 +146,1 @@
@@ -141,1 +147,1 @@
- "pathinfo": false,
+ "pathinfo": true,
@@ -157,1 +163,1 @@
@@ -158,1 +164,1 @@
- "cache": false,
+ "cache": true,
@@ -176,1 +182,1 @@
@@ -177,1 +183,1 @@
- "cache": false,
+ "cache": true,
`)
@ -438,7 +439,7 @@ describe("Defaults", () => {
@@ -23,1 +23,1 @@
- "syncWebAssembly": false,
+ "syncWebAssembly": true,
@@ -42,0 +42,4 @@
@@ -43,0 +43,4 @@
+ },
+ Object {
+ "test": /\\.wasm$/i,
@ -453,19 +454,19 @@ describe("Defaults", () => {
@@ -21,1 +21,1 @@
- "mjs": false,
+ "mjs": true,
@@ -43,0 +43,5 @@
@@ -44,0 +44,5 @@
+ Object {
+ "resolve": Object {
+ "mainFields": Array [
+ "browser",
+ "main",
@@ -44,0 +49,5 @@
@@ -45,0 +50,5 @@
+ },
+ "test": /\\.mjs$/i,
+ "type": "javascript/esm",
+ },
+ ],
@@ -159,0 +169,1 @@
@@ -160,0 +170,1 @@
+ ".mjs",
`)
);
@ -477,13 +478,16 @@ describe("Defaults", () => {
@@ -22,1 +22,1 @@
- "outputModule": false,
+ "outputModule": true,
@@ -133,1 +133,1 @@
@@ -27,1 +27,1 @@
- "externalsType": "var",
+ "externalsType": "module",
@@ -134,1 +134,1 @@
- "iife": true,
+ "iife": false,
@@ -135,1 +135,1 @@
@@ -136,1 +136,1 @@
- "jsonpScriptType": false,
+ "jsonpScriptType": "module",
@@ -137,2 +137,2 @@
@@ -138,2 +138,2 @@
- "libraryTarget": "var",
- "module": false,
+ "libraryTarget": "module",
@ -498,7 +502,7 @@ describe("Defaults", () => {
@@ -18,1 +18,1 @@
- "asyncWebAssembly": false,
+ "asyncWebAssembly": true,
@@ -42,0 +42,4 @@
@@ -43,0 +43,4 @@
+ },
+ Object {
+ "test": /\\.wasm$/i,
@ -519,7 +523,7 @@ describe("Defaults", () => {
@@ -23,1 +23,1 @@
- "syncWebAssembly": false,
+ "syncWebAssembly": true,
@@ -42,0 +42,4 @@
@@ -43,0 +43,4 @@
+ },
+ Object {
+ "test": /\\.wasm$/i,
@ -531,10 +535,10 @@ describe("Defaults", () => {
- Expected
+ Received
@@ -119,1 +119,1 @@
@@ -120,1 +120,1 @@
- "chunkFilename": "[name].js",
+ "chunkFilename": "[id].bundle.js",
@@ -125,1 +125,1 @@
@@ -126,1 +126,1 @@
- "filename": "[name].js",
+ "filename": "bundle.js",
`)
@ -544,10 +548,10 @@ describe("Defaults", () => {
- Expected
+ Received
@@ -119,1 +119,1 @@
@@ -120,1 +120,1 @@
- "chunkFilename": "[name].js",
+ "chunkFilename": "[id].js",
@@ -125,1 +125,1 @@
@@ -126,1 +126,1 @@
- "filename": "[name].js",
+ "filename": [Function filename],
`)
@ -557,25 +561,25 @@ describe("Defaults", () => {
- Expected
+ Received
@@ -118,1 +118,1 @@
@@ -119,1 +119,1 @@
- "chunkCallbackName": "webpackChunkwebpack",
+ "chunkCallbackName": "webpackChunkmyLib_awesome",
@@ -123,1 +123,1 @@
@@ -124,1 +124,1 @@
- "devtoolNamespace": "webpack",
+ "devtoolNamespace": "myLib.awesome",
@@ -131,1 +131,1 @@
@@ -132,1 +132,1 @@
- "hotUpdateFunction": "webpackHotUpdatewebpack",
+ "hotUpdateFunction": "webpackHotUpdatemyLib_awesome",
@@ -134,1 +134,1 @@
@@ -135,1 +135,1 @@
- "jsonpFunction": "webpackJsonpwebpack",
+ "jsonpFunction": "webpackJsonpmyLib_awesome",
@@ -136,1 +136,4 @@
@@ -137,1 +137,4 @@
- "library": "",
+ "library": Array [
+ "myLib",
+ "awesome",
+ ],
@@ -144,1 +147,1 @@
@@ -145,1 +148,1 @@
- "uniqueName": "webpack",
+ "uniqueName": "myLib.awesome",
`)
@ -585,24 +589,24 @@ describe("Defaults", () => {
- Expected
+ Received
@@ -62,3 +62,3 @@
@@ -63,3 +63,3 @@
- "__dirname": "mock",
- "__filename": "mock",
- "global": true,
+ "__dirname": false,
+ "__filename": false,
+ "global": false,
@@ -126,1 +126,1 @@
@@ -127,1 +127,1 @@
- "globalObject": "window",
+ "globalObject": "global",
@@ -154,3 +154,1 @@
@@ -155,3 +155,1 @@
- "aliasFields": Array [
- "browser",
- ],
+ "aliasFields": Array [],
@@ -164,1 +162,0 @@
@@ -165,1 +163,0 @@
- "browser",
@@ -189,1 +186,1 @@
@@ -190,1 +187,1 @@
- "target": "web",
+ "target": "node",
`)
@ -612,10 +616,10 @@ describe("Defaults", () => {
- Expected
+ Received
@@ -126,1 +126,1 @@
@@ -127,1 +127,1 @@
- "globalObject": "window",
+ "globalObject": "self",
@@ -189,1 +189,1 @@
@@ -190,1 +190,1 @@
- "target": "web",
+ "target": "webworker",
`)
@ -625,10 +629,10 @@ describe("Defaults", () => {
- Expected
+ Received
@@ -84,1 +84,1 @@
@@ -85,1 +85,1 @@
- "portableRecords": false,
+ "portableRecords": true,
@@ -151,2 +151,2 @@
@@ -152,2 +152,2 @@
- "recordsInputPath": false,
- "recordsOutputPath": false,
+ "recordsInputPath": "some-path",
@ -640,7 +644,7 @@ describe("Defaults", () => {
- Expected
+ Received
@@ -124,1 +124,1 @@
@@ -125,1 +125,1 @@
- "ecmaVersion": 6,
+ "ecmaVersion": 11,
`)
@ -650,7 +654,7 @@ describe("Defaults", () => {
- Expected
+ Received
@@ -88,1 +88,3 @@
@@ -89,1 +89,3 @@
- "runtimeChunk": false,
+ "runtimeChunk": Object {
+ "name": [Function name],
@ -665,7 +669,7 @@ describe("Defaults", () => {
- Expected
+ Received
@@ -88,1 +88,3 @@
@@ -89,1 +89,3 @@
- "runtimeChunk": false,
+ "runtimeChunk": Object {
+ "name": [Function name],
@ -677,7 +681,7 @@ describe("Defaults", () => {
- Expected
+ Received
@@ -88,1 +88,3 @@
@@ -89,1 +89,3 @@
- "runtimeChunk": false,
+ "runtimeChunk": Object {
+ "name": [Function name],
@ -698,13 +702,13 @@ describe("Defaults", () => {
+ ],
+ "type": "memory",
+ },
@@ -55,1 +61,1 @@
@@ -56,1 +62,1 @@
- "unsafeCache": false,
+ "unsafeCache": [Function anonymous],
@@ -157,1 +163,1 @@
@@ -158,1 +164,1 @@
- "cache": false,
+ "cache": true,
@@ -176,1 +182,1 @@
@@ -177,1 +183,1 @@
- "cache": false,
+ "cache": true,
`)
@ -736,13 +740,13 @@ describe("Defaults", () => {
+ "type": "filesystem",
+ "version": "",
+ },
@@ -55,1 +74,1 @@
@@ -56,1 +75,1 @@
- "unsafeCache": false,
+ "unsafeCache": [Function anonymous],
@@ -157,1 +176,1 @@
@@ -158,1 +177,1 @@
- "cache": false,
+ "cache": true,
@@ -176,1 +195,1 @@
@@ -177,1 +196,1 @@
- "cache": false,
+ "cache": true,
`)
@ -764,14 +768,14 @@ describe("Defaults", () => {
@@ -2,1 +2,1 @@
- "amd": undefined,
+ "amd": false,
@@ -61,5 +61,1 @@
@@ -62,5 +62,1 @@
- "node": Object {
- "__dirname": "mock",
- "__filename": "mock",
- "global": true,
- },
+ "node": false,
@@ -90,24 +86,1 @@
@@ -91,24 +87,1 @@
- "splitChunks": Object {
- "automaticNameDelimiter": "-",
- "cacheGroups": Object {

View File

@ -24,7 +24,7 @@ describe("Validation", () => {
expect(msg).toMatchInlineSnapshot(`
"Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
- configuration should be an object:
object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry?, experiments?, externals?, infrastructureLogging?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, stats?, target?, watch?, watchOptions? }
object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry?, experiments?, externals?, externalsType?, infrastructureLogging?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, stats?, target?, watch?, watchOptions? }
-> webpack options object as provided by the user"
`)
);
@ -33,7 +33,7 @@ describe("Validation", () => {
expect(msg).toMatchInlineSnapshot(`
"Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
- configuration should be an object:
object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry?, experiments?, externals?, infrastructureLogging?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, stats?, target?, watch?, watchOptions? }
object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry?, experiments?, externals?, externalsType?, infrastructureLogging?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, stats?, target?, watch?, watchOptions? }
-> webpack options object as provided by the user"
`)
);
@ -196,7 +196,7 @@ describe("Validation", () => {
expect(msg).toMatchInlineSnapshot(`
"Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
- configuration has an unknown property 'postcss'. These properties are valid:
object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry?, experiments?, externals?, infrastructureLogging?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, stats?, target?, watch?, watchOptions? }
object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry?, experiments?, externals?, externalsType?, infrastructureLogging?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, stats?, target?, watch?, watchOptions? }
-> webpack options object as provided by the user
For typos: please correct them.
For loader options: webpack >= v2.0.0 no longer allows custom properties in configuration.
@ -426,7 +426,7 @@ describe("Validation", () => {
expect(msg).toMatchInlineSnapshot(`
"Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
- configuration has an unknown property 'debug'. These properties are valid:
object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry?, experiments?, externals?, infrastructureLogging?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, stats?, target?, watch?, watchOptions? }
object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry?, experiments?, externals?, externalsType?, infrastructureLogging?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, stats?, target?, watch?, watchOptions? }
-> webpack options object as provided by the user
The 'debug' property was removed in webpack 2.0.0.
Loaders should be updated to allow passing this option via loader options in module.rules.
@ -482,7 +482,7 @@ describe("Validation", () => {
expect(msg).toMatchInlineSnapshot(`
"Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
- configuration[1] should be an object:
object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry?, experiments?, externals?, infrastructureLogging?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, stats?, target?, watch?, watchOptions? }
object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry?, experiments?, externals?, externalsType?, infrastructureLogging?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, stats?, target?, watch?, watchOptions? }
-> webpack options object as provided by the user"
`)
);
@ -621,7 +621,7 @@ describe("Validation", () => {
expect(msg).toMatchInlineSnapshot(`
"Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
- configuration has an unknown property 'rules'. These properties are valid:
object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry?, experiments?, externals?, infrastructureLogging?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, stats?, target?, watch?, watchOptions? }
object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry?, experiments?, externals?, externalsType?, infrastructureLogging?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, stats?, target?, watch?, watchOptions? }
-> webpack options object as provided by the user
Did you mean module.rules?"
`)
@ -635,7 +635,7 @@ describe("Validation", () => {
expect(msg).toMatchInlineSnapshot(`
"Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
- configuration has an unknown property 'splitChunks'. These properties are valid:
object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry?, experiments?, externals?, infrastructureLogging?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, stats?, target?, watch?, watchOptions? }
object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry?, experiments?, externals?, externalsType?, infrastructureLogging?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, stats?, target?, watch?, watchOptions? }
-> webpack options object as provided by the user
Did you mean optimization.splitChunks?"
`)
@ -649,7 +649,7 @@ describe("Validation", () => {
expect(msg).toMatchInlineSnapshot(`
"Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
- configuration has an unknown property 'noParse'. These properties are valid:
object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry?, experiments?, externals?, infrastructureLogging?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, stats?, target?, watch?, watchOptions? }
object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry?, experiments?, externals?, externalsType?, infrastructureLogging?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, stats?, target?, watch?, watchOptions? }
-> webpack options object as provided by the user
Did you mean module.noParse?"
`)