Skip to content

Instantly share code, notes, and snippets.

@sbalay
Created February 1, 2016 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sbalay/238749f72da20cfb4bcc to your computer and use it in GitHub Desktop.
Save sbalay/238749f72da20cfb4bcc to your computer and use it in GitHub Desktop.
Simple js gulp task for production environment
import gulp from 'gulp';
import uglify from 'gulp-uglify';
import babel from 'gulp-babel';
import concat from 'gulp-concat';
const localConfig = {
src: './src/js/**/*.js',
dest: './build/js/',
buildFileName: 'all.js'
};
gulp.task('js:production', () =>
gulp.src(localConfig.src)
.pipe(babel())
.pipe(concat(localConfig.buildFileName))
.pipe(uglify())
.pipe(gulp.dest(localConfig.dest))
);
gulp.task('build:production', ['js:production', 'css:production', 'vendor:production']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment