-
-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
augmentChunkHash with extract: true breaks hashing #315
Comments
Using the https://rollupjs.org/guide/en/#thisemitfileemittedfile-emittedchunk--emittedasset--string
|
Yeah, i'm observing the same behavior in my project. This issue breaks caching. |
PR #226 already uses the |
Did anyone find a fork that fixes these kind of big/completely breaking bugs? |
You can go relatively far using something like patch-package to amend specific things until the maintainers have the time to look at the submitted PRs. function emitFileWithSourcemap(bundle, name, code, map) {
const ref = this.emitFile({
type: 'asset',
name: name,
source: code
});
const filename = this.getFileName(ref);
const mapFilename = `${filename}.map`;
// TODO handle inline, hidden or disabled sourcemap options
bundle[filename].source += `\n/*# sourceMappingURL=${path.basename(mapFilename)} */`;
this.emitFile({
fileName: mapFilename,
type: 'asset',
source: map
});
} This function lets Rollup handle the naming and the hashing, using its |
My configuration looks like this:
https://rollupjs.org/guide/en/#augmentchunkhash
https://github.com/egoist/rollup-plugin-postcss/blob/master/src/index.js#L140
The
augmentChunkHash
hook is used to augment the hash of chunks (entry js file + its dependencies), not assets, so I don't understand why this is used. It's not even filtering which chunk gets its hash augmented.This is causing all my js files to have new a hash on every build, even when nothing has changed.
The extracted stylesheet's hash should also not be based on the entry file's hash, it should have its own independent hash.
Removing the
augmentChunkHash
hook completely fixes first problem.rollup-plugin-postcss
will still need to hash the stylesheet based on its content.The text was updated successfully, but these errors were encountered: