I have an
angular-cli based project in Visual Studio 2017. I followed the below link for this setup and it works.
I have the following in my Pre-Build events:
echo "cd $(SolutionDir)" &&^ cd "$(SolutionDir)" &&^ echo "Building Project" &&^ ng build &&^ echo 'copy files' &&^
This works fine when I Build or Rebuild the project in Visual Studio. It generates the bundle files in my output directory based in angular-cli.json.
But I need a way to watch for changes in
ng build from inside Visual Studio. I tried
ng build --watch in Pre Build events, but after making this change, my Build process stucks. I can see the output directory getting generated with all the correct bundle files, but the build process never completes in Visual Studio 2017.
As a work around, I am not running
ng build --watch in a separate command window. This works and watch for TypeScript, HTML, CSS changes and rebuilds (as expected). But would like to integrate this inside Visual Studio 2017.
Note: I already have
"compileOnSave": true in my tsconfig.json, but its not same as