Custom generated filename with Angular Cli
It's now supported via a command option as of beta.25.
This allows the output filename hashes to be configured during a build via a new build command option
--output-hashing
. There are four possible values:
none
: no hashing performed
media
: only add hashes to files processed via [url|file]-loaders
bundles
: only add hashes to the output bundles
all
: add hashes to both media and bundlesnone is the default for the development target. all is the default for the production target.
More details here.
I added the following script element for production build in the package.json file.
"scripts": {
"prod" : "ng build --prod --output-hashing=none --base-href=./"
}
then running
npm run prod
would build the dist folder without hash and also includes the ./ as base-href so that files are loaded relative to current directory.