Skip to content

Instantly share code, notes, and snippets.

@jgatjens
Last active August 29, 2015 14:27
Show Gist options
  • Save jgatjens/d39efe5582f73cee2159 to your computer and use it in GitHub Desktop.
Save jgatjens/d39efe5582f73cee2159 to your computer and use it in GitHub Desktop.
Include es6 in your gulpfile.babel.js
// npm install gulp-util --save
import gulpLoadPlugins from 'gulp-load-plugins';
import babelify from 'babelify';
import browserify from 'browserify';
import source from 'vinyl-source-stream';
var notifier = require('node-notifier');
// Standard handler
var standardHandler = function (err) {
// Notification
// var notifier = new notification();
notifier.notify({ message: 'Error: ' + err.message });
// Log to console
$.util.log($.util.colors.red('Error'), err.message);
}
// Es6 browserify and babel
// enable module system
gulp.task('es6', () => {
browserify({
entries: './app/es6/main.js',
debug: true
})
.transform(babelify)
.on('error', standardHandler)
.bundle()
.on('error', standardHandler)
.pipe(source('main.js'))
.pipe(gulp.dest('./app/scripts/'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment