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
Looks like part of this code will run in both serve and build mode.
Suggested solution
when in serve mode, minifying the CSS can be slow, and hence would be good if there is an option to opt-out of using the config.build.minify flag here, as it doesn't seem to belong in serve mode.
if the above is not possible, please allow an option to configure the transform call here:
it seems most options are hardcoded apart from target.
possible introduce a new option called config.build.cssMinify as we have config.build.cssTarget already to keep it consistent, then we can spread it like so in this line:
const{ code, warnings }=awaittransform(css,{loader: 'css',minify: true,target: config.build.cssTarget||undefined,// probably need to keep this for backwards compatitibility
...config.build.cssMinify})
I don't believe it was right to close the issue like that, the feature request still stands, as there are still use cases when someone wants to minify js, but not CSS. Right now it is not possible..
I thought your reason of this request was performance.
If you want to disable css minification, it is a duplicate of #5619. I would be great if you write the reason why you would like to do that there.
Description
vite/packages/vite/src/node/plugins/css.ts
Line 424 in 5c6cf5a
Looks like part of this code will run in both
serve
andbuild
mode.Suggested solution
serve
mode, minifying the CSS can be slow, and hence would be good if there is an option to opt-out of using theconfig.build.minify
flag here, as it doesn't seem to belong inserve
mode.vite/packages/vite/src/node/plugins/css.ts
Line 1227 in 5c6cf5a
target
.config.build.cssMinify
as we haveconfig.build.cssTarget
already to keep it consistent, then we can spread it like so in this line:Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: