Skip to content

Instantly share code, notes, and snippets.

@x1unix
Created June 24, 2016 08:38
Show Gist options
  • Save x1unix/2df18a6ba6113279b0263be1952bb53f to your computer and use it in GitHub Desktop.
Save x1unix/2df18a6ba6113279b0263be1952bb53f to your computer and use it in GitHub Desktop.
Babelify Gulp
gulp.task('js', function() {
browserify({
entries: './public/js/src/index.js',
insertGlobals : true,
fullPaths: true, // For discify
debug: ! isProduction
}).transform(babelify, {
presets: ['es2015'],
compact: false,
global: true
})
.bundle()
.pipe(source('index.js'))
.pipe(buffer())
.pipe(uglify())
.pipe(gulp.dest('./public/js/dist'))
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment