1

I have Angular 4 cli and net core 2.0 app up and running all good.

I use command ng build --watch to watch for angular changes, but when I run that in terminal as you can see on image below, I am unable to use any other command after that.

enter image description here

How can I run angular-cli watch and dotnet run watch simultaneously ? I want to make packages.json script maybe for that something like I used in older project with webpack:

  "scripts": {
    "start-local": "dotnet run && webpack --progress --color --env.local",
    "test": "karma start ClientApp/test/karma.conf.js",
    "debug": "webpack --progress --color --env.debug",
    "release": "webpack --progress --color --env.release",
    "start-debug": "npm run debug",
    "start-release": "npm run release"
  },

Is this possible? Something like dotnet run watch && ng build --watch

sensei
  • 7,044
  • 10
  • 57
  • 125

2 Answers2

0

Quick solution: you can use two terminal windows.

With the latest versions of Visual Studio Code you can do this by clicking the plus (+) sign to the right in the terminal window.

einord
  • 2,278
  • 2
  • 20
  • 26
  • Actually you don't need to run both. Whoever is new to this. Run ng build to build to wwwroot of net.core app. then run ng serve to run app. If you want to self host with dotnet, then run dotnet run (run ng build before, so wwwroot folder actually exists otherwise you will get not found error when you run dotnet run). If you just want to develop and see changes install watch for dotnet run and use dotnet run watch – sensei Oct 07 '17 at 19:40
  • Well, my answer was the quick solution. Probably not the best in long term. – einord Oct 12 '17 at 06:42
0

It looks like you are using VS Code? If so, see the "menu" at the top where it says "Problems Output ... Terminal"? Further to the right there is a + sign. Click it to create another Powershell terminal window. Then you can execute another command. Use the drop down to the left of the + sign to swap between the two (or more) terminal windows.

enter image description here

DeborahK
  • 57,520
  • 12
  • 104
  • 129