diff --git a/lib/utils/createConfig.js b/lib/utils/createConfig.js index e7f9bf799e..c16a95138b 100644 --- a/lib/utils/createConfig.js +++ b/lib/utils/createConfig.js @@ -50,6 +50,10 @@ function createConfig(config, argv, { port }) { options.progress = argv.progress; } + if (argv.overlay) { + options.overlay = argv.overlay; + } + if (!options.publicPath) { // eslint-disable-next-line options.publicPath = diff --git a/test/CreateConfig.test.js b/test/CreateConfig.test.js index 3c00c90dd1..a0b99047e2 100644 --- a/test/CreateConfig.test.js +++ b/test/CreateConfig.test.js @@ -979,4 +979,16 @@ describe('createConfig', () => { expect(config).toMatchSnapshot(); }); + + it('overlay', () => { + const config = createConfig( + Object.assign({}, webpackConfig, { + devServer: { overlay: true }, + }), + argv, + { port: 8080 } + ); + + expect(config).toMatchSnapshot(); + }); }); diff --git a/test/__snapshots__/CreateConfig.test.js.snap b/test/__snapshots__/CreateConfig.test.js.snap index 8cf61a8f6d..5549367189 100644 --- a/test/__snapshots__/CreateConfig.test.js.snap +++ b/test/__snapshots__/CreateConfig.test.js.snap @@ -835,6 +835,21 @@ Object { } `; +exports[`createConfig overlay 1`] = ` +Object { + "hot": true, + "hotOnly": false, + "noInfo": true, + "overlay": true, + "port": 8080, + "publicPath": "/", + "stats": Object { + "cached": false, + "cachedAssets": false, + }, +} +`; + exports[`createConfig pfx option (in devServer config) 1`] = ` Object { "hot": true,