From e086be4efc2b349daf37ce07f1d8d767672999ba Mon Sep 17 00:00:00 2001 From: colin-marshall Date: Wed, 6 Jan 2016 21:42:32 -0700 Subject: [PATCH] Support only ES2015 features that don't use polyfills --- .babelrc | 13 +++++++++++-- gulp/javascript.js | 4 +--- package.json | 9 ++++++++- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/.babelrc b/.babelrc index fd2925f3d..de0edabac 100644 --- a/.babelrc +++ b/.babelrc @@ -1,4 +1,13 @@ { - "plugins": ["transform-es2015-modules-umd"], - "presets": ["es2015"] + "plugins": [ + "transform-es2015-arrow-functions", + "transform-es2015-block-scoped-functions", + "transform-es2015-block-scoping", + "transform-es2015-classes", + "transform-es2015-destructuring", + "transform-es2015-modules-umd", + "transform-es2015-template-literals", + "transform-es2015-parameters", + "transform-es2015-spread", + ] } \ No newline at end of file diff --git a/gulp/javascript.js b/gulp/javascript.js index eecbce696..93d4b09ee 100644 --- a/gulp/javascript.js +++ b/gulp/javascript.js @@ -26,9 +26,7 @@ gulp.task('javascript', ['javascript:foundation', 'javascript:deps', 'javascript gulp.task('javascript:foundation', function() { return gulp.src(FOUNDATION) - .pipe(babel({ - presets: ['es2015'] - })) + .pipe(babel()) .pipe(concat('foundation.js')) .pipe(gulp.dest('_build/assets/js')); }); diff --git a/package.json b/package.json index 4d55e8ada..7edbace60 100644 --- a/package.json +++ b/package.json @@ -17,8 +17,15 @@ "license": "MIT", "devDependencies": { "babel-core": "^6.3.26", + "babel-plugin-transform-es2015-arrow-functions": "^6.3.13", + "babel-plugin-transform-es2015-block-scoped-functions": "^6.3.13", + "babel-plugin-transform-es2015-block-scoping": "^6.4.0", + "babel-plugin-transform-es2015-classes": "^6.3.15", + "babel-plugin-transform-es2015-destructuring": "^6.3.15", "babel-plugin-transform-es2015-modules-umd": "^6.3.13", - "babel-preset-es2015": "^6.3.13", + "babel-plugin-transform-es2015-parameters": "^6.3.26", + "babel-plugin-transform-es2015-spread": "^6.4.0", + "babel-plugin-transform-es2015-template-literals": "^6.3.13", "bootcamp": "^1.1.7", "browser-sync": "^2.8.2", "clipboard": "^1.5.5", -- 2.47.2