Skip to content

Commit 9274d5b

Browse files
committed
Update to babel-preset-env
Previously used presets 'es2015' and 'stage-3' are now deprecated in favour of 'env'. This resulted in a build warning. New preset makes it possible to specify target browsers and NodeJS versions. Only needed code transformations and polyfills are then applied. Right now browsers and NodeJS versions are not configured so this preset behaves the same was as the previous two. Also updated versions of babel-related dependencies. For more details about the 'env' preset see: http://babeljs.io/env https://github.com/babel/babel/tree/master/packages/babel-preset-env
1 parent 7ccfad9 commit 9274d5b

File tree

4 files changed

+97
-72
lines changed

4 files changed

+97
-72
lines changed

.babelrc

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
{
2-
"presets": ["es2015", "stage-3"],
2+
"presets": [
3+
"env"
4+
],
35
"plugins": ["transform-runtime"]
46
}

gulpfile.babel.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ gulp.task('build-browser', function () {
6666
standalone: 'neo4j',
6767
packageCache: {}
6868
}).transform(babelify.configure({
69-
presets: ['es2015', 'stage-3'], ignore: /external/
69+
presets: ['env'], ignore: /external/
7070
})).bundle();
7171

7272
// Un-minified browser package
@@ -103,7 +103,7 @@ gulp.task('build-browser-test', function(){
103103
cache: {},
104104
debug: true
105105
}).transform(babelify.configure({
106-
presets: ['es2015', 'stage-3'], plugins: ['transform-runtime'], ignore: /external/
106+
presets: ['env'], plugins: ['transform-runtime'], ignore: /external/
107107
}))
108108
.bundle(function(err, res){
109109
cb();
@@ -120,7 +120,7 @@ gulp.task('build-browser-test', function(){
120120

121121
var buildNode = function(options) {
122122
return gulp.src(options.src)
123-
.pipe(babel({presets: ['es2015', 'stage-3'], plugins: ['transform-runtime'], ignore: ['src/external/**/*.js']}))
123+
.pipe(babel({presets: ['env'], plugins: ['transform-runtime'], ignore: ['src/external/**/*.js']}))
124124
.pipe(gulp.dest(options.dest))
125125
};
126126

package-lock.json

+84-60
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+7-8
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,18 @@
2626
"types": "types/index.d.ts",
2727
"devDependencies": {
2828
"async": "^2.4.0",
29-
"babel-core": "^6.17.0",
30-
"babel-plugin-transform-runtime": "^6.15.0",
31-
"babel-preset-es2015": "^6.16.0",
32-
"babel-preset-stage-3": "^6.17.0",
33-
"babel-register": "^6.18.0",
29+
"babel-core": "^6.26.3",
30+
"babel-plugin-transform-runtime": "^6.23.0",
31+
"babel-preset-env": "^1.6.1",
32+
"babel-register": "^6.26.0",
3433
"babelify": "^7.3.0",
35-
"browserify": "^13.1.0",
34+
"browserify": "^13.3.0",
3635
"esdoc": "^1.0.4",
3736
"esdoc-importpath-plugin": "^1.0.1",
3837
"esdoc-standard-plugin": "^1.0.0",
3938
"fs-extra": "^1.0.0",
4039
"gulp": "^3.9.1",
41-
"gulp-babel": "^6.1.2",
40+
"gulp-babel": "^6.1.3",
4241
"gulp-batch": "^1.0.5",
4342
"gulp-cucumber": "0.0.14",
4443
"gulp-decompress": "^1.2.0",
@@ -72,7 +71,7 @@
7271
"vinyl-source-stream": "^1.1.0"
7372
},
7473
"dependencies": {
75-
"babel-runtime": "^6.18.0",
74+
"babel-runtime": "^6.26.0",
7675
"uri-js": "^4.2.1"
7776
}
7877
}

0 commit comments

Comments
 (0)