Commit 760a1e55 authored by Philipp Nowinski's avatar Philipp Nowinski
Browse files

[FEATURE] add ES6 support via babel

parent 7fb06563
......@@ -8,6 +8,7 @@ var gulp = require('gulp'),
buffer = require('vinyl-buffer'),
argv = require('yargs').argv,
rename = require('gulp-rename'),
babelify = require('babelify'),
glob = require('glob'),
eventStream = require('event-stream'),
plugins = require('gulp-load-plugins')({
......@@ -24,7 +25,10 @@ function processJs(files, done) {
});
if (argv.production) {
return browserify.bundle()
return browserify.transform(babelify.configure({
presets: [require('babel-preset-es2015')]
}))
.bundle()
.pipe(source(file))
.pipe(buffer())
.pipe(plugins.uglify())
......@@ -38,7 +42,10 @@ function processJs(files, done) {
}))
.pipe(gulp.dest(settings.getPath() + '/' + config.directories.javascriptDest));
} else {
return browserify.bundle()
return browserify.transform(babelify.configure({
presets: [require('babel-preset-es2015')]
}))
.bundle()
.pipe(source(file))
.pipe(buffer())
.pipe(plugins.sourcemaps.init({loadMaps: true}))
......
This diff is collapsed.
......@@ -16,6 +16,8 @@
"node": "~6.3.0"
},
"dependencies": {
"babel-preset-es2015": "^6.14.0",
"babelify": "^7.3.0",
"browser-sync": "^2.13.0",
"browserify": "^13.0.1",
"event-stream": "^3.3.3",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment