user8570495
user8570495

Reputation: 1835

is it possible to configure the filenames generated by cli ng build --prod?

Is it possible to configure the js bundle filenames generated by CLI? "ng build --prod" outputs files with names like this to the dist dir:

I have a requirement to use the app's current build number as the second part of the filename. So if the app build number is 1.15.2 then the dist js filenames would look like this: inline.1.15.2.bundle.js

Do you know if "ng build --prod" supports a flag to configure the second part of the output filename? Or will I most likely need to create some type of custom post-build routine which programatically makes this update?

Upvotes: 3

Views: 2918

Answers (2)

Vega
Vega

Reputation: 28708

You can remove the hash part with output-hashing option on ng build --prod

output-hashing --output-hashing (aliases: -oh)

Define the output filename cache-busting hashing mode.

Values: none, all, media, bundles

Docs

Upvotes: 2

alexKhymenko
alexKhymenko

Reputation: 5598

You can just write script to rename files after build, depending on your operational system. Or use npm rename package.

Upvotes: 1

Related Questions