From 70224401c5a87d6e3155ff35a246c7fd47c4aff6 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 16 Feb 2017 17:37:21 +0200 Subject: [PATCH] feature(webpack) exclude object.assign, promise polyfill from dev build --- webpack.config.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/webpack.config.js b/webpack.config.js index e641f2c9..ed82a1c7 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -51,6 +51,9 @@ module.exports = { libraryTarget: 'umd' }, plugins, + externals: [ + externals + ], module: { loaders: [{ test: /\.js$/, @@ -64,3 +67,17 @@ module.exports = { } }; +function externals(context, request, fn) { + if (!isDev) + return fn(); + + const list = [ + 'es6-promise', + 'object.assign', + ]; + + if (list.includes(request)) + return fn(null, request); + + fn(); +}