What server does ng serve use when using Angular CLI 1.6.0?

感情迁移 提交于 2019-11-30 11:45:07

Try ng eject This command will override your package.json and also generates a file called webpack.config.js in your root directory.

That will give you all the current webpack configuration that your project is using.

When you do that, in your package.json, this is what you'll find :

"scripts": {
    "eject": "ddc eject",
    "build": "webpack",
    "start": "webpack-dev-server",
    "test": "karma start ./karma.conf.js",
    "pree2e": "webdriver-manager update --standalone false --gecko false --quiet",
    "e2e": "protractor ./protractor.conf.js"
  },

As you can see, npm start is using webpack-dev-server.

NOTE: To undo your changes, use git, otherwise AngularCli doesn't provide a way of undoing

Sonu Kapoor

Yup, its using webpack-dev-server. You can look at the source-code of the ng eject command:

https://github.com/angular/angular-cli/blob/6449a753641340d8fc19a752e1a1ced75f974efa/docs/documentation/1-x/eject.md

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!