Running gulp watch in task runner explorer by setting bindings to 'After Build' in Visual Studio 2015
Asked Answered
E

1

9

I am trying to run gulp watch by setting bindings property of watch to 'After Build' in Task runner explorer. I tried to run application, during build it triggered my watch task from gulp and it's still running. But my application is not running in the browser, it just hangs on Visual Studio screen.

After I stopped the watch task my project runs and I could see my app in browser. I noticed that when you run project watch is triggered by one thread and until it is closed it not allowing my application to run and open in browser.

How can I fix it?

gulp.task('watch', ['compile', 'resources'], function () {
   gulp.watch(["src/**/*", "!**/*.ts"], ['resources']);
   gulp.watch("src/**/*.ts", ['compile']);
});

Above is my gulp watch and I set it to run after build in task runner explorer.

Edwin answered 14/7, 2016 at 18:1 Comment(1)
Although this question was asked a while ago, i am currently running against the same issue. It looks to me that VS is waiting for the gulp tasks to finish. The watcher will obviously not finish. I tried making it asynchronous and tried wrapping the tasks in other functions hoping that VS continues after hitting the task, but no success.Arroyo
E
0

@bob Meijwaard I changed to set the gulp watch to run on opening project or solution, which works just fine for my requirement. Now watch will be running when project is opened and I can run the project.

Edwin answered 15/1, 2018 at 13:51 Comment(1)
Does this solution works with VS 2022 and task runner; I cant get watch task to fire when binding to Open Project, /// <binding ProjectOpened='watch' />. And on before/after build project never opens as mentioned and aboveIntercollegiate

© 2022 - 2024 — McMap. All rights reserved.