Webpack-dev-server: Browser automatically open can't be disabled

Created on 12 Feb 2018  路  3Comments  路  Source: webpack/webpack-dev-server

  • Operating System: Windows 10
  • Node Version: 8.9.3
  • NPM Version: 4.5.0
  • webpack Version: 3.10.0
  • webpack-dev-server Version: 2.11.1

  • [x] This is a bug

  • [ ] This is a modification request

When I set the open flag to false, it does not prevent the browser from opening.
In my webpack.config.js:
devServer: { open: false }

Expected Behavior

I expect the browser NOT to open

Actual Behavior

The browser opens

For Bugs; How can we reproduce the behavior?

Self explanatory. Even a simple server with 'open:false' will still have this bug.

Most helpful comment

Ok turned out someone had altered the scripts to start the webserver with the --open option.

All 3 comments

Ok turned out someone had altered the scripts to start the webserver with the --open option.

I have webpack 4 but this is not working

@kasaiee try this

modify your package.json file, like below code shows

{
  "scripts": {
    "dev": "webpack-dev-server --open --config ./build/webpack.config.js",
  }
}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

antoinerousseau picture antoinerousseau  路  3Comments

hnqlvs picture hnqlvs  路  3Comments

daryn-k picture daryn-k  路  3Comments

MJ111 picture MJ111  路  3Comments

adiachenko picture adiachenko  路  3Comments