diff --git a/bin/webpack.js b/bin/webpack.js index 5564fab59c5..0d123a14b78 100755 --- a/bin/webpack.js +++ b/bin/webpack.js @@ -357,7 +357,7 @@ For more information, see https://webpack.js.org/api/cli/.`); }); ifArg("display-entrypoints", function(bool) { - if (bool) outputOptions.entrypoints = true; + outputOptions.entrypoints = bool; }); ifArg("display-reasons", function(bool) { diff --git a/test/binCases/entry/display-entrypoints/a.js b/test/binCases/entry/display-entrypoints/a.js new file mode 100644 index 00000000000..aa7a96ad992 --- /dev/null +++ b/test/binCases/entry/display-entrypoints/a.js @@ -0,0 +1 @@ +module.exports = "fileA"; diff --git a/test/binCases/entry/display-entrypoints/index.js b/test/binCases/entry/display-entrypoints/index.js new file mode 100644 index 00000000000..0d24e266fe2 --- /dev/null +++ b/test/binCases/entry/display-entrypoints/index.js @@ -0,0 +1 @@ +module.exports = "index"; diff --git a/test/binCases/entry/display-entrypoints/stdin.js b/test/binCases/entry/display-entrypoints/stdin.js new file mode 100644 index 00000000000..b95951ea0d9 --- /dev/null +++ b/test/binCases/entry/display-entrypoints/stdin.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function testAssertions(code, stdout, stderr) { + expect(stdout.join(' ')).not.toContain("Entrypoint"); + expect(stderr).toHaveLength(0); +}; diff --git a/test/binCases/entry/display-entrypoints/test.opts b/test/binCases/entry/display-entrypoints/test.opts new file mode 100644 index 00000000000..274606ca547 --- /dev/null +++ b/test/binCases/entry/display-entrypoints/test.opts @@ -0,0 +1 @@ +--display-entrypoints false diff --git a/test/binCases/entry/display-entrypoints/webpack.config.js b/test/binCases/entry/display-entrypoints/webpack.config.js new file mode 100644 index 00000000000..7ae59c51e2c --- /dev/null +++ b/test/binCases/entry/display-entrypoints/webpack.config.js @@ -0,0 +1,5 @@ +var path = require("path"); + +module.exports = { + entry: path.resolve(__dirname, "./index"), +};