Skip to content

Commit

Permalink
feat: Add 'openBrowser' config option (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalduez authored and markdalgleish committed Nov 19, 2018
1 parent cd8ef1e commit b0b030f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/start.js
Expand Up @@ -17,12 +17,12 @@ module.exports = (config, callback) => {

const compiler = webpack(webpackConfig);
const devServer = new WebpackDevServer(compiler, webpackDevServerConfig);
const { port = 9000 } = config;
const { port = 9000, openBrowser = true } = config;

devServer.listen(port, 'localhost', (...args) => {
const [err] = args;

if (!err) {
if (!err && openBrowser) {
opn(`http://localhost:${port}`);
}

Expand Down

0 comments on commit b0b030f

Please sign in to comment.