Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example of a dev flag for gulp
// Define your plugins here, make sure you have `gulp-util`...
var gutil = require('gulp-util');
/**
* Define dev CLI flag
* Run `gulp --dev`
*/
var isDev = gutil.env.dev;
gulp.task('scripts', function() {
return gulp.src('src/scripts/*/**.js')
.pipe(concat('main.js'))
.pipe(gulpif(!isDev, $.uglify())) // If we use the `--dev` flag, uglify will not take place.
.pipe(gulp.dest('dist/scripts'))
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.