Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix(config): enable --overlay (#1968)
  • Loading branch information
hiroppy committed Jun 4, 2019
1 parent 0783a4a commit dc81e23
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/utils/createConfig.js
Expand Up @@ -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 =
Expand Down
12 changes: 12 additions & 0 deletions test/CreateConfig.test.js
Expand Up @@ -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();
});
});
15 changes: 15 additions & 0 deletions test/__snapshots__/CreateConfig.test.js.snap
Expand Up @@ -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,
Expand Down

0 comments on commit dc81e23

Please sign in to comment.