Run Plugins for SWC when running Jest #37475
kennetpostigo
started this conversation in
Ideas
Replies: 2 comments 3 replies
-
It looks like |
Beta Was this translation helpful? Give feedback.
3 replies
-
Interested in trying out https://npmjs.com/package/swc-plugin-vanilla-extract? I could spare some time to port https://npmjs.com/package/@vanilla-extract/babel-plugin for the SWC. For next.js, you may need to wait #40520 to land though. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the feature you'd like to request
Hi 👋
I'm using vanilla-extract a typescript based css pre-processor with
next
and it works great when running and developing my application. However, when trying to runjest
on my UI tests it chokes onvanilla-extract
and throws errors because I believe it doesn't know where the generated CSS is. In mynext.config.js
I use the vanilla-extract plugin and next works flawlessly with this.Describe the solution you'd like
I would like jest to be able to work successfully with
vanilla-extract
. I believe at the moment it is failing because it might not be using the vanilla-extract plugin so it fails when running tests. Is it possible to make jest aware of the plugin? If so I think that may be the best solution.Describe alternatives you've considered
The main alternative that i've considered is enabling the use of babel/webpack with only jest when running tests, but i'm not exactly sure how that would look like or if there is prior art in next land for this. My understanding is that it's all
swc
or allbabel + webpack
but not both, and that makes sense in general.In the worst case we'd have to opt out of using SWC unfortunately 😞
Beta Was this translation helpful? Give feedback.
All reactions