moved around plugin order to try and fix deadcode requires as per https://github.com/rollup/rollup/issues/855

This commit is contained in:
Dominic Gannaway
2017-03-30 20:31:17 +01:00
parent 589305637a
commit 794e0b908e
+7 -4
View File
@@ -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