What would be the best way to execute Gulp tasks only when publishing an ASP.NET 5 web application? Do I need to [add a custom build event](https://msdn.microsoft.com/en-us/library/dd293663.aspx?f=255&MSPPError=-2147217396) that executes a Gulp command?

```
cmd.exe /c gulp -b "C:\Projects\ProjectName\Source\ProjectName.Web" --gulpfile "C:\Projects\ProjectName\Source\ProjectName.Web\Gulpfile.js" publish

```

Or, preferably, is there a way to bind a Gulp task to the `BeforePublish` target via the Task Runner Explorer?

Any suggestions would be very appreciated.