Last active
August 29, 2015 14:27
-
-
Save jgatjens/d39efe5582f73cee2159 to your computer and use it in GitHub Desktop.
Include es6 in your gulpfile.babel.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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