Skip to content

Commit dc81e23

Browse files
authored
fix(config): enable --overlay (#1968)
1 parent 0783a4a commit dc81e23

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

lib/utils/createConfig.js

+4
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ function createConfig(config, argv, { port }) {
5050
options.progress = argv.progress;
5151
}
5252

53+
if (argv.overlay) {
54+
options.overlay = argv.overlay;
55+
}
56+
5357
if (!options.publicPath) {
5458
// eslint-disable-next-line
5559
options.publicPath =

test/CreateConfig.test.js

+12
Original file line numberDiff line numberDiff line change
@@ -979,4 +979,16 @@ describe('createConfig', () => {
979979

980980
expect(config).toMatchSnapshot();
981981
});
982+
983+
it('overlay', () => {
984+
const config = createConfig(
985+
Object.assign({}, webpackConfig, {
986+
devServer: { overlay: true },
987+
}),
988+
argv,
989+
{ port: 8080 }
990+
);
991+
992+
expect(config).toMatchSnapshot();
993+
});
982994
});

test/__snapshots__/CreateConfig.test.js.snap

+15
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,21 @@ Object {
835835
}
836836
`;
837837

838+
exports[`createConfig overlay 1`] = `
839+
Object {
840+
"hot": true,
841+
"hotOnly": false,
842+
"noInfo": true,
843+
"overlay": true,
844+
"port": 8080,
845+
"publicPath": "/",
846+
"stats": Object {
847+
"cached": false,
848+
"cachedAssets": false,
849+
},
850+
}
851+
`;
852+
838853
exports[`createConfig pfx option (in devServer config) 1`] = `
839854
Object {
840855
"hot": true,

0 commit comments

Comments
 (0)