set NODE_ENV=$(ConfigurationName) gulp
This line will let you read which assembly symbol is used in Visual Studio when compiling your solution. To access this variable, you can use process.env.NODE_ENV. Thus, we can use this piece of code to check whether we are compiling in debug or release mode, and then decide whether to run the mini-task or not.
var tasksToRun = ['scripts']; if(process.env.NODE_ENV === 'Release'){ tasksToRun.push('minify'); } gulp.task('default', tasksToRun);
http://www.myeyeson.net/gulp-js-and-browserify-with-asp-net/
source share