sveltejs / sapper

The next small thing in web development, powered by Svelte
https://sapper.svelte.dev
MIT License
7k stars 434 forks source link

No hash appended to client.css filename in v0.29.0 #1716

Closed fivemru closed 3 years ago

fivemru commented 3 years ago

Describe the bug Sapper version 0.29.0 does not add a hash to the client.css file. For other css files the hash is added.

To Reproduce

npx degit "sveltejs/sapper-template#rollup" my-app-0.29.0 \
&& cd my-app-0.29.0 \
&& npm i \
&& npm i -D sapper@0.29.0 \
&& npm run build \
&& ls -la __sapper__/build/client/*.css

output:

__sapper__/build/client/[slug]-5bc8f95f.css
__sapper__/build/client/client.css
__sapper__/build/client/index-39716d32.css
__sapper__/build/client/index-7ed37c94.css

In version 0.28.10 everything is ok.

Expected behavior File name client.css with hash like this:

__sapper__/build/client/client-abcdefg.css

Severity Due to caching of static files, when a new version of the site is released, the user interface is not displayed correctly, users cannot interact with some elements of the site.

Additional context The problem is related to updating rollup-plugin-css-chunks from 1.2.6 to 2.0.2 in sapper 0.29.0 (https://github.com/sveltejs/sapper/pull/1666). Since version 2.0.0 rollup-plugin-css-chunks has a default value of entryFileNames: '[name].css', before that it was entryFileNames: '[name]-[hash].css'