You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 1, 2020. It is now read-only.
Unfortunately if the content is changed by the PurgeCss plugin only, for example since I have removed a usage of an class or I'm using a class which hasn't been used before, the contenthash does not change. This leads to old files being served to the users and therefore a breaking app.
The content hash changes as soon as I do an actual modification of the CSS files. My guess would be that the contenthash is calculated to early?
@arneee I just ran into this same problem today. Had to purge my Cloudflare cache to get an update to download after nearly an hour of troubleshooting. Putting immutable on your cache-control headers is fun when the hashes aren't working correctly...
My solution was to stop using this Webpack plugin, and move PurgeCSS to my postcss.config.js file instead (via @fullhuman/postcss-purgecss.
// postcss.config.js/* eslint-env node */constDEV=process.env.NODE_ENV!=='production'classTailwindExtractor{staticextract(content){returncontent.match(/[A-z0-9-:\/]+/g)||[]}}module.exports={plugins: [require('tailwindcss')('./tailwind.js'),DEV
? false
: require('@fullhuman/postcss-purgecss')({content: ['./src/**/*.{js,ejs,html}'],extractors: [{extractor: TailwindExtractor,// Specify the file extensions to include when scanning for// class names.extensions: ['html','js','ejs','vue'],},],}),require('autoprefixer'),].filter(Boolean),}
I'm using the contenthash in the filenames to allow long term caching:
https://webpack.js.org/guides/caching/
Unfortunately if the content is changed by the PurgeCss plugin only, for example since I have removed a usage of an class or I'm using a class which hasn't been used before, the contenthash does not change. This leads to old files being served to the users and therefore a breaking app.
The content hash changes as soon as I do an actual modification of the CSS files. My guess would be that the contenthash is calculated to early?
webpack config:
The text was updated successfully, but these errors were encountered: