Ng Build an Angular 7 Project in IntelliJ Webstorm or IDEA

北战南征 提交于 2021-02-19 05:27:11

问题


How do I build an Angular CLI project in IntelliJ IDEA or Webstorm? I want an option to run ng build command for my Angular 7 Project, instead of running it through the command prompt.


回答1:


To run ng build, open your package.json in IDEA (WebStorm) editor and press the run icon in the gutter to the left of the 'build" script:

To run ng serve, run "start" script. Note that the IDE auto-creates the Angular CLI Server run configuration for running ng serve, you can use it to start the app.

See also https://blog.jetbrains.com/webstorm/2017/01/debugging-angular-apps/ - you may find this blog post helpful




回答2:


If you open up Webstorm and have alook at the top right hand side of the page you will find a dropdown saying, Angular CLI Server. Click on the dropdown and click on Edit Configuration.

Once you have done the above you are going to end up at this window.

Once you have that window open change the Scripts to build. Once you have done that you can run the Angular application normally with the green Run button at the top right of your screen



来源:https://stackoverflow.com/questions/55721508/ng-build-an-angular-7-project-in-intellij-webstorm-or-idea

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