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
Many things can be constant folded at compile time, an important one are CSS calc() expressions
Suggested solution
This is solved by https://github.com/postcss/postcss-calc
However most people are not even aware of the existence of this library.
As such it would be a nice optimization if vite leveraged internally this lib in order to perform css Calc constant folding for free to users.
Clear and concise description of the problem
Constant folding (propagation) is a popular optimization https://en.m.wikipedia.org/wiki/Constant_folding
Many things can be constant folded at compile time, an important one are CSS calc() expressions
Suggested solution
This is solved by https://github.com/postcss/postcss-calc
However most people are not even aware of the existence of this library.
As such it would be a nice optimization if vite leveraged internally this lib in order to perform css Calc constant folding for free to users.
Note that esbuild might support this one day
evanw/esbuild#1607
Alternative
What other things can be constant folded at compile time?
Also this is desired for production but is it also desired for dev?
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: