Skip to content

Instantly share code, notes, and snippets.

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 =;
gulp.task('scripts', function() {
return gulp.src('src/scripts/*/**.js')
.pipe(gulpif(!isDev, $.uglify())) // If we use the `--dev` flag, uglify will not take place.
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.