From ed7a2038c7390bc4a702c92d8df6f0f0eb17341c Mon Sep 17 00:00:00 2001 From: AllenFang Date: Mon, 25 Jan 2016 10:44:29 +0800 Subject: [PATCH] avoid multiple babel-polyfill loaded --- src/bootstrap.loader.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/bootstrap.loader.js b/src/bootstrap.loader.js index 78bc9e16..6790e339 100644 --- a/src/bootstrap.loader.js +++ b/src/bootstrap.loader.js @@ -16,11 +16,12 @@ if (semver.lt(process.version, '4.0.0')) { Make sure it's installed in your 'node_modules/' directory. `); } - - if (isBabelLatest) { - require(babelLatest); - } else { - require(babelPrev); + if (!global._babelPolyfill) { + if (isBabelLatest) { + require(babelLatest); + } else { + require(babelPrev); + } } }