Angular: Stop emitting ng_*.json

Created on 13 Feb 2017  路  5Comments  路  Source: angulardart/angular

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`

Most helpful comment

You saw it here: https://plus.google.com/u/0/+TomasZverina/posts/gjigzCB2qY6

... but it still needs to be solved.

All 5 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AndreyChernykh picture AndreyChernykh  路  4Comments

ranquild picture ranquild  路  4Comments

matanlurey picture matanlurey  路  4Comments

chalin picture chalin  路  3Comments

mandreyel picture mandreyel  路  6Comments