From 794e0b908e2de2d833f7c83467209d5ff8a4db83 Mon Sep 17 00:00:00 2001 From: Dominic Gannaway Date: Thu, 30 Mar 2017 20:31:17 +0100 Subject: [PATCH] moved around plugin order to try and fix deadcode requires as per https://github.com/rollup/rollup/issues/855 --- scripts/rollup/build.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/rollup/build.js b/scripts/rollup/build.js index 58a6b48662..6525e7fcce 100644 --- a/scripts/rollup/build.js +++ b/scripts/rollup/build.js @@ -363,20 +363,23 @@ function getPlugins(entry, babelOpts, paths, filename, bundleType, isRenderer, m ), babel(updateBabelConfig(babelOpts, bundleType)), alias(getAliases(paths, bundleType, isRenderer)), - commonjs(getCommonJsConfig(bundleType)), ]; if (bundleType === UMD_PROD || bundleType === NODE_PROD || bundleType === FB_PROD) { plugins.push( - uglify(uglifyConfig(bundleType !== FB_PROD, manglePropertiesOnProd)), replace( stripEnvVariables(true) - ) + ), + // needs to happen after strip env + commonjs(getCommonJsConfig(bundleType)), + uglify(uglifyConfig(bundleType !== FB_PROD, manglePropertiesOnProd)) ); } else if (bundleType === UMD_DEV || bundleType === NODE_DEV || bundleType === FB_DEV) { plugins.push( replace( stripEnvVariables(false) - ) + ), + // needs to happen after strip env + commonjs(getCommonJsConfig(bundleType)) ); } // this needs to come last or it doesn't report sizes correctly