From c16cfc694b4b905df5ed61d4bcea4aa609d7da33 Mon Sep 17 00:00:00 2001 From: David Aurelio Date: Tue, 12 Apr 2016 08:28:22 -0700 Subject: [PATCH] Don't load 'babel-polyfill', only polyfill `Array#values`, `Object.values`, and `Object.entries` Summary:Instead of loading `'babel-polyfill'` into packager, we only polyfill es6 methods that are unavailable in node 4, and es7 stage 4 proposals. That makes sure that we are using native promises, and don't load unnecessary polyfills. Reviewed By: vjeux Differential Revision: D3168057 fb-gh-sync-id: 68b53795d9a1d7cfdc00fc31684da3ad21a7bb34 fbshipit-source-id: 68b53795d9a1d7cfdc00fc31684da3ad21a7bb34 --- babelRegisterOnly.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/babelRegisterOnly.js b/babelRegisterOnly.js index f862bb75..bb973ba4 100644 --- a/babelRegisterOnly.js +++ b/babelRegisterOnly.js @@ -8,7 +8,9 @@ */ 'use strict'; -require('babel-polyfill'); +Array.prototype.values || require('core-js/fn/array/values'); +Object.entries || require('core-js/fn/object/entries'); +Object.values || require('core-js/fn/object/values'); var fs = require('fs'); var path = require('path');