Enable build minification

Summary: This shaves another ~6MB of the zipped build. Less than I would have thought, but I haven't looked at the alternative options so far at all.

Reviewed By: nikoant

Differential Revision: D21131772

fbshipit-source-id: 641515d6f36fdeeffa5be81d64c2c1043a9e4e34
This commit is contained in:
Pascal Hartig
2020-04-21 02:08:55 -07:00
committed by Facebook GitHub Bot
parent 2cf9eeb224
commit 9c18a98f89
4 changed files with 48 additions and 4 deletions

View File

@@ -77,6 +77,13 @@ export default async function runBuild(
transformer: {
...baseConfig.transformer,
babelTransformerPath: require.resolve('flipper-babel-transformer'),
minifierPath: 'metro-minify-terser',
minifierConfig: {
// see: https://www.npmjs.com/package/terser
keep_fnames: true,
module: true,
warnings: true,
},
},
resolver: {
...baseConfig.resolver,
@@ -87,7 +94,7 @@ export default async function runBuild(
});
await Metro.runBuild(config, {
dev,
minify: false,
minify: !dev,
resetCache: !dev,
sourceMap: true,
entry,