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
When using esbuild instead of babel for the transforming, you miss out of using babel plugins. Today we use esbuild and puild our own plugin (esbuild-plugin-styled-component) to transform the css props supported in Styled Components (with a babel plugin) to React components.
I can't find any way to use this plugin with Vite2.
Suggested solution
What if we could send the plugins to our Vite configs esbuild object?
Probably this should be solved in another way. Instead of using babel as a way of transform CSS props from Styled Components, there should be a native way for esbuild to transform css props. But anyway we need a way to tell esbuild to use this plugin.
The text was updated successfully, but these errors were encountered:
When Vite uses esbuild for transpiling individual files, AFAICS there is no way to use plugins for transforming. esbuild plugins are used for bundling (build).
Check out this comment and issue #2238 (comment), where there is a link to the rationale from Evan Wallace evanw/esbuild#779 (comment)
Closing this issue as we are already discussing this in #2238
When using esbuild instead of babel for the transforming, you miss out of using babel plugins. Today we use esbuild and puild our own plugin (
esbuild-plugin-styled-component
) to transform the css props supported in Styled Components (with a babel plugin) to React components.I can't find any way to use this plugin with Vite2.
Suggested solution
What if we could send the plugins to our Vite configs esbuild object?
Additional context
Probably this should be solved in another way. Instead of using babel as a way of transform CSS props from Styled Components, there should be a native way for esbuild to transform css props. But anyway we need a way to tell esbuild to use this plugin.
The text was updated successfully, but these errors were encountered: