[Enhancement] --output-hashing=chunk
See original GitHub issue- [ ] bug report -> please search issues before submitting
- [ x] feature request
Versions.
@angular/cli: 1.2.6 node: 7.7.1 os: win32 x64 @angular/animations: 4.2.4 @angular/common: 4.2.4 @angular/compiler: 4.2.4 @angular/core: 4.2.4 @angular/forms: 4.2.4 @angular/http: 4.2.4 @angular/platform-browser: 4.2.4 @angular/platform-browser-dynamic: 4.2.4 @angular/router: 4.2.4 @angular/cli: 1.2.6 @angular/compiler-cli: 4.2.4 @angular/language-service: 4.2.4
Desired functionality.
Due to the way our server side code is set up, we are unable to use the dist/index.html file generated during the build process. We use it locally for development purposes only. Consequently, we have output hashing turned off since trying to keep all the file names straight with an external file would be a nightmare.
We have recently run into an issue with browsers caching the chunk files, since they don’t have the hash appended to them. Our normal JS files are loaded with a url parameter to keep them fresh, but we aren’t able to do that with the chunk files (lazy loaded modules) as they are loaded via inline.bundle.js.
I ejected the webpack config file, and it looks like it would be possible to add an additional argument value (–output-hashing=chunk) so that it only applies the hash value to those files. I’m not sure what difficulties this would create outside of the webpack.config. There may be technical reasons this hasn’t been done already, but I thought I’d ask just in case.
I’m also open to other suggestions we could implement to prevent the browsers from being able to cache the chunk files.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:16
- Comments:14 (2 by maintainers)
same here, I want to have my lazy loaded chunks to be hashed for cache busting, but not the main bundles, since they are addressed directly from an MVC rendering.
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.