-
Since Metro transpile all the node modules by default, we don't have to add any additional config . Can we do this in webpack ? i tried to add a rule like this : /node_modules/(.*)/, but it will cause a error : Property 'exports' doesn't exist Can someone tell me why is this happening ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey @ra1nj, that's a very good question! The template we provide with Re.Pack, limits the number of transformed modules by default to not be too hard on the performance side. The error you've encountered is due to how modules are processed by both bundlers - some rules from In the next major version of Re.Pack (V5 with support for Rspack), the performance impact is mostly gone thanks to the |
Beta Was this translation helpful? Give feedback.
Hey @ra1nj,
that's a very good question! The template we provide with Re.Pack, limits the number of transformed modules by default to not be too hard on the performance side.
The error you've encountered is due to how modules are processed by both bundlers - some rules from
@react-native/babel-preset
don't play nicely in webpack. You usually need to track down these modules and adjust them on a case-by-case basis. In the case you have above, it's most likely that the module was recognized as an ESM, but was then compiled down to CJS (because of the RN preset) and webpack didn't not take that into account and forgot to exposeexports
property for it. That's the gist of itIn the next major…