From e33758f9db3672878ce626de6ec9e1a06ea3dad7 Mon Sep 17 00:00:00 2001 From: Vitaly Kramskikh Date: Mon, 5 Sep 2016 19:05:28 +0300 Subject: [PATCH] Use babel-plugin-transform-runtime instead of babel-polyfill babel-plugin-transform-runtime allows to reduce size of the resulting bundle dramatically (from 260kb to 24kb). Change-Id: I3cceb1caddfb5b0b2048b7d4efc2cebfee26ab91 --- .babelrc | 3 ++- package.json | 3 ++- src/index.js | 1 - 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.babelrc b/.babelrc index c13c5f6..3ca1979 100644 --- a/.babelrc +++ b/.babelrc @@ -1,3 +1,4 @@ { - "presets": ["es2015"] + "presets": ["es2015"], + "plugins": ["transform-runtime"] } diff --git a/package.json b/package.json index 2ad7aeb..dac6096 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "license": "Apache-2.0", "homepage": "http://www.openstack.org/", "dependencies": { - "babel-polyfill": "^6.9.1", + "babel-runtime": "^6.11.6", "isomorphic-fetch": "^2.2.1", "loglevel": "^1.4.1" }, @@ -38,6 +38,7 @@ "babel-core": "^6.10.4", "babel-loader": "^6.2.4", "babel-plugin-transform-inline-environment-variables": "^6.8.0", + "babel-plugin-transform-runtime": "^6.15.0", "babel-preset-es2015": "^6.9.0", "babel-register": "^6.9.0", "eslint": "^3.0.0", diff --git a/src/index.js b/src/index.js index 7ffce83..2f8887b 100644 --- a/src/index.js +++ b/src/index.js @@ -1,4 +1,3 @@ -import 'babel-polyfill'; import 'isomorphic-fetch'; export default class Test {