I don't want angular cli to rename generated script files by ng build --prod
and put its link in my index.html file. I just want to use the same name again and again as it does for the development build for the prod build as well.
I know in the .angular-cli.json
file holds all configuration but what option I need to place to stop renaming of files for prod build.
Other option is as the angular cli is using webpack
internally, is there any way we can configure webpack
to handle file renaming.
If you simply run ng build Angular will create dist folder with files name having hash with it but by using --output-hashing none you can avoid these hash names.
A file named angular. json at the root level of an Angular workspace provides workspace-wide and project-specific configuration defaults for build and development tools provided by the Angular CLI. Path values given in the configuration are relative to the root workspace folder.
Created by the Angular team, Build Optimizer is a tool that further optimizes Angular Webpack builds. It identifies code that can be removed at build time without side effects. For instance, Build Optimizer can remove Angular decorators like @Component from AOT builds.
ng build command compiles the Angular app into an output directory named dist/ at the given output path. This command must be executed from within the working directory. The application builder in Angular uses the webpack build tool, with configuration options specified in the workspace configuration file (angular.
Use ng build --prod --output-hashing none
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With