Add a naive WPO implementation

Summary: public

RFC: The minifier haven't been stripping dead-code, and it also can't kill unused
modules, so as a temporary solution this inlines `__DEV__`, kill dead branches
and kill dead modules. For now I'm just white-listing the dev variable, but we
could definitely do better than that, but as a temporary fix this should be
helpful.

I also intend to kill some dead variables, so we can kill unused requires,
although inline-requires can also fix it.

Reviewed By: vjeux

Differential Revision: D2605454

fb-gh-sync-id: 50acb9dcbded07a43080b93ac826a5ceda695936
This commit is contained in:
Tadeu Zagallo
2015-11-17 03:36:50 -08:00
committed by facebook-github-bot-5
parent bd1885b5d4
commit 0b46a0c13b
9 changed files with 297 additions and 48 deletions

View File

@@ -44,7 +44,7 @@ function buildBundle(args, config) {
client.close();
return outputBundle;
})
.then(outputBundle => processBundle(outputBundle, !args.dev))
.then(outputBundle => processBundle(outputBundle, args.dev))
.then(outputBundle => saveBundleAndMap(
outputBundle,
args.platform,