Skip to content

Unique identifier ng build --prod #3769

Closed
@psaussure

Description

@psaussure

When compiling with ng build, I get standard file names:

chunk    {0} main.bundle.js, main.bundle.map (main) 107 kB {3} [initial] [rendered]
chunk    {1} styles.bundle.css, styles.bundle.map, styles.bundle.map (styles) 150 kB {4} [initial]
chunk    {2} scripts.bundle.js, scripts.bundle.map (scripts) 136 kB {4} [initial]
chunk    {3} vendor.bundle.js, vendor.bundle.map (vendor) 4.79 MB [initial]
chunk    {4} inline.bundle.js, inline.bundle.map (inline) 0 bytes [entry]

but with ng build --prod i get some identifiers added to file names.

chunk    {0} main.340157664918857603f7.bundle.js, main.340157664918857603f7.bundle.map (main) 106 kB {3} [initial] [rendered]
chunk    {1} styles.9b4687a185c2974d93c1.bundle.css, styles.9b4687a185c2974d93c1.bundle.map, styles.9b4687a185c2974d93c1.bundle.map (styles) 147 kB {4} [initial] [rendered]
chunk    {2} scripts.eb3f44fc5155c6a1c948.bundle.js, scripts.eb3f44fc5155c6a1c948.bundle.map (scripts) 136 kB {4} [initial] [rendered]
chunk    {3} vendor.fbab65b1f30d6a22e3c5.bundle.js, vendor.fbab65b1f30d6a22e3c5.bundle.map (vendor) 4.57 MB [initial] [rendered]
chunk    {4} inline.2a57c067d70b51f52b6f.bundle.js, inline.2a57c067d70b51f52b6f.bundle.map (inline) 0 bytes [entry] [rendered]

Are these identifiers always the same in a given app?
It it possible to change the behavior of prod build not to have these identifiers added to file name?

My own app is deeply intergrated with .NET project and my app loading is based on files without identifier. I don't want to have to edit my .NET view template in order to add at each build the unique identifier.

Side question: _prod is supposed to apply some tree-shaking, but as you can see on the logs pasted above, the vendor bundle is 4.79MB on normal build and 4.57MB on prod.
My app simply use basic routing, angularfire2 and http module. Is this size normal?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions