1) Take your favourite Angular2 project
2) run "pub build"
3) inspect the results in ./build/web
Expected behaviour:
"pub build" creates clean output which can be directly uploaded to the production environment.
Observed behaviour:
There are many files which are probably not needed in production (?): ng_meta.json, ng_summary.json ...
Please note that for example Google App Engine limits a number of files in app package in quotas. Not mentioning the amount of data which is transferred, distributed to CDN, archived, etc.
I understand that it might be hard to solve right know and that it depends on "pub" itself. For now, please provide some "safe cleanup script":
rm `find . -name *.ng_*.json`
AFAIK this is a transformer limitation, files can't be deleted once created.
I haven't found where I saw this being discussed.
You saw it here: https://plus.google.com/u/0/+TomasZverina/posts/gjigzCB2qY6
... but it still needs to be solved.
For example - we have this backend administration app in Angular2.Dart. We removed all probably unnecessary files from build/web:
rm `find . -name *.ng_*.json`
... and final "war" package is now 18MB smaller.
There is no way to do this unfortunately with barback (pub transformers).
We're working on a new compiler that won't have this limitation, though.
I'll leave this open as a tracker.
Most helpful comment
You saw it here: https://plus.google.com/u/0/+TomasZverina/posts/gjigzCB2qY6
... but it still needs to be solved.