Skip to content
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

Non-deterministic css filename with emitCss #224

Open
tsmigiel opened this issue Feb 15, 2023 · 0 comments
Open

Non-deterministic css filename with emitCss #224

tsmigiel opened this issue Feb 15, 2023 · 0 comments

Comments

@tsmigiel
Copy link

I use svelte-loader with emitCss: true and then MiniCssExtractPlugin in my webpack config. I also use svelte-spa-router with the wrap functionality to break my modules up into many chunks. And I use [contenthash] in my js and css filenames so they will get reloaded when changed.

I was investigating why every time I build all of my files end up with new hashes even for small changes. When I diffed the files of 2 different builds, where I made no changes between builds, the difference was the css filename generated by emitCss. Looking at the code here I see an "index++" and if I remove that in my build, then the generated files and hashes are the same.

I assume that index++ has some purpose, maybe to ensure generated files are unique. Could it be made deterministic? Or is it possible to reduce the cases where it is needed?

I noticed the "Help Wanted" issue, so if someone can explain why "index++" is needed, I don't mind trying to come up with a patch to address it.

Or is there some webpack config workaround I can do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant