Skip to content

[Enhancement] --output-hashing=chunk #7431

@xouqoa

Description

@xouqoa
- [ ] 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions