I\'ve set up an ASP.NET 5 project in Visual Studio and created a gulpfile.js which I use to build my typescript and less files.
For release builds, I want to uglify
Disclaimer: I am entirely new to npm, grunt or gulp. However, I think that I found a simple solution using pre-build events.
Add the following line to your pre-build event command line in the project that contains the grunt (or gulp) files:
npm update && grunt $(ConfigurationName)
Now as long as you have grunt tasks with the same name as your build configuration, you should be all set.
grunt.registerTask('Debug', ['sass', 'concat']);
grunt.registerTask('Release', ['sass', 'concat', 'cssmin', 'removelogging', 'uglify']);
You'll need the usual pre-requisites on the machine that is running the build. Remember to restart VS after installing all of this stuff. Visual Studio needs to be run as Administrator in order to execute all all grunt tasks
gem install sassnpm install -g grunt-cli