I have a basic Asp.Net 5 site which used Gulp.JS tasks to clean, copy and minify CSS and JS files.
When running these tasks in the Task Runner Explorer - all is good and the old scripts are removed, new ones copied and files minified.
I wish to automate these tasks in VS2015 - so when I build the project the following will happen:
Now I may be completely off track here but I would have thought that in the project.json file I should be able to call these gulp tasks in the scripts config like so:
"scripts": {
"prebuild": [ "gulp clean" ],
"postbuild": ["gulp copy" , "gulp min" ],
"prepublish": [ "npm install", "bower install"]
}
The clean works perfectly - however the copy and min tasks do not run at all. Any ideas on how I could automate this behaviour please?
All you have to do is to add binding to build steps in your gulpfile.js (in the first line):
/// <binding Clean='clean' AfterBuild='postbuild' />
After that, you will have your steps in Task Runner Explorer:
The scripts section in project.json works only for building outside of Visual Studio, while using dnu command:
dnu build
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With