From db11d56c54ef3bd8de162ffa6b2f9bf0a1afa95a Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Thu, 4 Aug 2016 11:55:17 +0200 Subject: [PATCH] feat: do not depend on babel-polyfill Closes #36 BREAKING CHANGE: This can break browser builds and tests and needs to be tested carefully when upgrading. --- config/babel.js | 1 + config/karma.conf.js | 2 -- config/webpack.js | 3 +-- package.json | 4 ++-- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/config/babel.js b/config/babel.js index 10bb88b29..258b50aa4 100644 --- a/config/babel.js +++ b/config/babel.js @@ -1,5 +1,6 @@ 'use strict' module.exports = { + plugins: [require.resolve('babel-plugin-transform-runtime')], presets: [require.resolve('babel-preset-es2015')] } diff --git a/config/karma.conf.js b/config/karma.conf.js index 90f2e1d1e..ee7cd0dec 100644 --- a/config/karma.conf.js +++ b/config/karma.conf.js @@ -1,6 +1,5 @@ 'use strict' -const path = require('path') const webpackConfig = require('./webpack') const timeout = webpackConfig.timeout @@ -26,7 +25,6 @@ module.exports = function (config) { } }, files: [ - path.join(require.resolve('babel-polyfill'), '/../../dist/polyfill.js'), 'test/browser.js', 'test/**/*.spec.js' ], diff --git a/config/webpack.js b/config/webpack.js index 5dcaa3702..f48a18b2d 100644 --- a/config/webpack.js +++ b/config/webpack.js @@ -31,7 +31,6 @@ const specific = merge(custom1, custom2) const shared = { entry: [ - require.resolve('babel-polyfill'), path.resolve('src/index.js') ], output: { @@ -99,7 +98,7 @@ const shared = { test: /\.json$/, loader: 'json' }], - postLoaders: [{ + preLoaders: [{ test: /\.js$/, loader: 'transform?brfs' }] diff --git a/package.json b/package.json index 3557deff8..cff7f3215 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "args-parser": "^1.0.2", "babel-core": "^6.11.4", "babel-loader": "^6.2.4", - "babel-polyfill": "^6.9.1", + "babel-plugin-transform-runtime": "^6.12.0", "babel-preset-es2015": "^6.9.0", "brfs": "^1.4.3", "chalk": "^1.1.3", @@ -89,4 +89,4 @@ "dignifiedquire ", "greenkeeperio-bot " ] -} \ No newline at end of file +}