question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[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:closed
  • Created 6 years ago
  • Reactions:16
  • Comments:14 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
evtkcommented, Apr 30, 2020

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.

0reactions
angular-automatic-lock-bot[bot]commented, Apr 3, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Enhancement] --output-hashing=chunk - - Bountysource
We have recently run into an issue with browsers caching the chunk files, since they don't have the hash appended to them. Our...
Read more >
6 Best Practices & Pro Tips when using Angular CLI
... --output-hashing all — hash contents of the generated files and append hash ... --named-chunks false — disable using human readable names for...
Read more >
Heap out of memory in angular4 while ng build --prod
Try running build script in package json by the following script: "scripts": { "build-prod": "node --max_old_space_size=5048 .
Read more >
angular/angular-cli - Gitter
Recently we have to change our CI/CD setup of our angular application, as part of that we have modified two option in build...
Read more >
@nrwl/angular:webpack-browser | Nx
Note: There may be some additional overhead in the linking of the built libraries' sources which may reduce the overall improvement in build...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found