Rob Quincey
Rob Quincey

Reputation: 2896

Cancelling Webpack watch task in Visual Studio task runner

I have a Visual Studio project which uses Webpack to bundle the client side code up.

I use the NPM Task Runner extension to actually run the tasks.

Originally I had the Webpack build command bound to the Visual Studio 'Before Build' event, so every time I wanted to recompile the JS, I had to do a full build.

I have now attached webpack --watch to the Project Open event, as described in this answer, which works great and recompiles the scripts as I modify them, but there doesn't seem to be a way to cancel this if, for some reason, I don't want it watching any more.

In a 'normal' set up, you would simply Ctrl-C to cancel the task, but since this is being run by the NPM task runner, there doesn't seem to be a way to access the actual terminal in order to cancel it. You can see the output in Task Runner Explorer, but there is no way to interact with the window.

Screenshot of Visual Studio Task Runner Explorer with webpack watch output

Is there any way to cancel this task within Visual Studio?

Upvotes: 0

Views: 535

Answers (1)

Rob Quincey
Rob Quincey

Reputation: 2896

So I figured it out one way by chance. You can just close the window in Task Runner Explorer.

Screenshot of existing a process in task runner explorer

Not exactly a mind blowing answer, but it does what I want it to.

Still open to better/less destructive answers.

Upvotes: 0

Related Questions