Webpack launch browser automatically

前端 未结 9 1078
遥遥无期
遥遥无期 2021-02-03 17:18

Gulp + live reload serves up my content on localhost and (here\'s what I\'m after) launches the browser automatically at the server url whenever i run the gulp

9条回答
  •  不要未来只要你来
    2021-02-03 18:11

    For webpack version 2.x, you just add --open open to the CLI as documented here:

    https://webpack.js.org/configuration/dev-server/#devserver-open

    Alternatively, add the following config to your webpack.config.js:

    devServer: {
      open: true
    }
    

提交回复
热议问题