Angular-cli: On build, output a manifest of bundles

Created on 1 Apr 2017  路  6Comments  路  Source: angular/angular-cli

- [ x ] feature request

Desired functionality.

The webpack build output essentially references a few(5) files in "index.html" and allows one to work within, which is ok. But, it would be helpful for placing these bundles into other arrangements outside of this static scenario.

Example - _dist/manifest.json_

{
    "data": {
        "production": true
    },
    "css": [
        "styles.*.bundle.css"
    ],
    "js": [
        "inline.*.bundle.js",
        "polyfills.*.bundle.js",
        "vendor.*.bundle.js",
        "main.*.bundle.js"
    ]
}

Currently

I can only find awful hacks where you leave the index.html empty and fish out the elements with gulp like this SO question - yuck!

plugin example

It seems like this webpack-manifest-plugin is the basic idea but it can probably be added to the cli in a way to offers additional parameters etc.

Most helpful comment

you can use:

ng build --stats-json

All 6 comments

you can use:

ng build --stats-json

Thanks, that works, it's just quite large.
I was able to use JSONStream.parse(["assetsByChunkName"]) for just the bit I need.
There could be a less verbose version of this maybe.

This isn't something we're looking at adding per se, but for now --stats-json serves that need.

Didnt't work for me! Enabled --stats-json, it produces stats.json file, but not expected manifest.json

Aaaa, now I get it. You extract the data from stats.json. Ok, I can to the same.

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

donaldallen picture donaldallen  路  3Comments

gotschmarcel picture gotschmarcel  路  3Comments

purushottamjha picture purushottamjha  路  3Comments

JanStureNielsen picture JanStureNielsen  路  3Comments

hareeshav picture hareeshav  路  3Comments