diff --git a/schemas/webpackOptionsSchema.json b/schemas/webpackOptionsSchema.json index ada46dd6f..2979f89e8 100644 --- a/schemas/webpackOptionsSchema.json +++ b/schemas/webpackOptionsSchema.json @@ -975,6 +975,7 @@ "anyOf": [ { "type": "object", + "additionalProperties": false, "properties": { "context": { "type": "string", @@ -997,6 +998,46 @@ "type": "boolean", "description": "add assets information" }, + "env": { + "type": "boolean", + "description": "add --env information" + }, + "colors": { + "oneOf": [ + { + "type": "boolean", + "description": "`webpack --colors` equivalent" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "bold": { + "type": "string" + }, + "red": { + "type": "string" + }, + "green": { + "type": "string" + }, + "cyan": { + "type": "string" + }, + "magenta": { + "type": "string" + }, + "yellow": { + "type": "string" + } + } + } + ] + }, + "maxModules": { + "type": "number", + "description": "Set the maximum number of modules to be shown" + }, "chunks": { "type": "boolean", "description": "add chunk information" @@ -1017,6 +1058,10 @@ "type": "boolean", "description": "add also information about cached (not built) modules" }, + "cachedAssets": { + "type": "boolean", + "description": "Show cached assets (setting this to `false` only shows emitted files)" + }, "reasons": { "type": "boolean", "description": "add information about the reasons why modules are included" @@ -1041,6 +1086,10 @@ "description": "Please use excludeModules instead.", "$ref": "#/definitions/filter-types" }, + "entrypoints": { + "type": "boolean", + "description": "Display the entry points with the corresponding bundles" + }, "errorDetails": { "type": "boolean", "description": "add details to errors (like resolving log)" @@ -1065,6 +1114,10 @@ "type": "string", "description": "sort the assets by that field" }, + "publicPath": { + "type": "boolean", + "description": "Add public path information" + }, "providedExports": { "type": "boolean", "description": "show exports provided by modules" diff --git a/test/Validation.test.js b/test/Validation.test.js index 0c65c1fcd..23b9bbd59 100644 --- a/test/Validation.test.js +++ b/test/Validation.test.js @@ -199,6 +199,20 @@ describe("Validation", () => { message: [ " - configuration.context: The provided value \"baz\" is not an absolute path!", ] + }, { + name: "missing stats option", + config: { + entry: "foo.js", + stats: { + foobar: true + } + }, + test(e) { + e.message.should.startWith("Invalid configuration object."); + e.message.split("\n").slice(1)[0].should.be.eql( + " - configuration.stats should be one of these:" + ); + } }]; testCases.forEach((testCase) => { it("should fail validation for " + testCase.name, () => { @@ -207,6 +221,12 @@ describe("Validation", () => { } catch(e) { if(!(e instanceof WebpackOptionsValidationError)) throw e; + + if(testCase.test) { + testCase.test(e); + return; + } + e.message.should.startWith("Invalid configuration object."); e.message.split("\n").slice(1).should.be.eql(testCase.message); return; diff --git a/test/statsCases/module-deduplication-named/webpack.config.js b/test/statsCases/module-deduplication-named/webpack.config.js index 4036423e4..3e899e781 100644 --- a/test/statsCases/module-deduplication-named/webpack.config.js +++ b/test/statsCases/module-deduplication-named/webpack.config.js @@ -9,7 +9,7 @@ module.exports = { }, stats: { hash: false, - timing: false, + timings: true, chunks: true, chunkModules: true, modules: false diff --git a/test/statsCases/module-deduplication/webpack.config.js b/test/statsCases/module-deduplication/webpack.config.js index 4036423e4..3e899e781 100644 --- a/test/statsCases/module-deduplication/webpack.config.js +++ b/test/statsCases/module-deduplication/webpack.config.js @@ -9,7 +9,7 @@ module.exports = { }, stats: { hash: false, - timing: false, + timings: true, chunks: true, chunkModules: true, modules: false