Webpack launch browser automatically

前端 未结 9 944
遥遥无期
遥遥无期 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:13

    To launch the browser, one can add --open to CLI command as the accepted answer points it out

    npm start --open
    

    or

    ng serve --open
    

    To avoid doing it all the time: there is a simple change to make in package.json

    "scripts": {
        "ng": "ng",
        "start": "ng serve --open",
        ...
      },
    

提交回复
热议问题