Closed omidantilong closed 2 years ago
Looks like we can add some config to jest.config.js to tell it to use next/babel
, while keeping swc compilation the build stage. https://github.com/vercel/next.js/issues/30811#issuecomment-963102661
Will give it a whirl tomorrow
This is tested and working. We get the benefits of using SWC for compilation while still transforming modules correctly for jest. Also updated the babel transform regex to be a bit more human friendly.
This enables localised testing in the workbench repo using the recommended next settings for babel to keep jest happy. Note that adding a babel.config.js switches the compiler from SWC See notes in
workbench/babel.config.js