Open Vadiok opened 5 years ago
File names don't have a concept of "query strings", so this is just a strange-looking filee extension. it's not a .css
file anymore, it's a .css?ah336ewhaba
file - and CSS minifiers only compress .css
files.
What exactly are you doing this for?
This is for keeping one file on server, but still prevent caching updates by working with Revision Manifest Plugin. I don't like to keep many old css files or clear folder on prod before updating. The problem is in optimize-cssnano-plugin: https://github.com/intervolga/optimize-cssnano-plugin/blob/master/index.js#L32
I've made a pull request to ntervolga/optimize-cssnano-plugin with fix. Waiting for their answer.
Version
3.8.2
Reproduction link
https://github.com/Vadiok/VueCliCssMinificationBug
Environment info
Steps to reproduce
yarn run build
"dist/css/app.css
"What is expected?
CSS is minified in production mode
What is actually happening?
CSS isn't compressed
I've created an vue.config.js with custom CSS filename configuration - "
css/[name].css?[hash:8]
" (see https://github.com/Vadiok/VueCliCssMinificationBug/blob/master/vue.config.js ). Minification doesn't applies when I'm using query string as a filename.