Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular 5 WebStorm Run Configuration

I'm surprised to see Angular does not yet have an entry in Jet Brain's IDE, WebStorm, which run config do you guys use?

I want to execute: ng serve

but Maybe there's a better option?

one like vue's npm run dev which opens up a page in your default browser at the served address?

this page didn't hit run configs, https://www.jetbrains.com/help/webstorm/angular.html

UPDATE :

for clarification I'm talking about making a one click run button like you can for react and vue apps :

enter image description here

like image 405
tatsu Avatar asked Nov 16 '17 16:11

tatsu


People also ask

How do I run an angular project in WebStorm?

Generate code with Angular SchematicsSelect File | New from the main menu or press Alt+Insert in the Project tool window, and then select Angular Schematic. From the list, select the relevant schematic. In the dialog that opens, specify the name of the schematic to be generated and additional options, if necessary.

How do I add a configuration to WebStorm?

Add Run/Debug configurations to the Services windowSelect View | Tool Windows | Services from the main menu or press Alt+8 . In the Services tool window, click Add service, then select Run Configuration Type. Select a run/debug configuration type from the list to add all configurations of this type to the window.

How do I run a script in WebStorm?

To run a script, open it in the editor or select it in the Project tool window, and then select Run <script file name> from the context menu. WebStorm creates a temporary run/debug configuration of the type Node. js. To run a test, click the gutter icon next to it or press Ctrl+Shift+F10 .


Video Answer


1 Answers

Please see https://blog.jetbrains.com/webstorm/2017/01/debugging-angular-apps/ for instructions on debugging Angular apps in WebStorm.

  • right-click your package.json, choose Show NPM Scripts
  • in NPM tool window, click the start script to start the app
  • create a new JavaScript debug configuration (Run –> Edit configurations… –> Add –> JavaScript Debug), etter http://localhost:4200/ into the URL field, press Debug
like image 144
lena Avatar answered Oct 02 '22 20:10

lena