Replace babel-preset-es2015 with babel-preset-env configured for the last 6 browser versions to improve speed and performance

This commit is contained in:
Kevin MacMartin 2017-10-30 21:41:28 -04:00
parent 44281d132c
commit 3d4d2bcd6f
3 changed files with 14 additions and 3 deletions

11
.babelrc Normal file
View file

@ -0,0 +1,11 @@
{
presets: [
[
"env", {
"targets": {
"browsers": [ "last 6 versions" ]
}
}
]
]
}

2
gulpfile.js vendored
View file

@ -79,7 +79,7 @@ function processJavaScript(ouputFilename, inputFiles, es6) {
.pipe(gPlumber(plumberError))
.pipe(gConcat(ouputFilename + ".js"));
if (es6) { javascript.pipe(gBabel({ presets: [ "es2015" ] })); }
if (es6) { javascript.pipe(gBabel()); }
if (prod) { javascript.pipe(gStripDebug()).pipe(gUglify()); }
return javascript.pipe(gulp.dest("public/js/"));
}

View file

@ -8,9 +8,9 @@
"gulp-livereload": "^3.8.1"
},
"dependencies": {
"autoprefixer": "^7.1.4",
"autoprefixer": "^7.1.6",
"babel-core": "^6.26.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-env": "^1.6.1",
"gulp": "^3.9.1",
"gulp-babel": "^7.0.0",
"gulp-concat": "^2.6.1",