[@expo/config-plugins] - plugin can't be used with the exports
package json setup.
#837
gladiuscode
started this conversation in
General
Replies: 1 comment
-
you need to explicitly expose any files that you want to be readable by other tools with See Node.js docs for |
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
-
Hi all!
Introduction
My library is set up as a backward compatible turbo module, with a companion expo plugin to make it possible for devs to load the library in their expo application as well as the bare one
Since I'm not sure this can be treat as a bug, I'm not opening an issue in any repository of sorts, because my knowledge of the expo framework is not solid, as well as the whole nodejs way to load commonjs or esm module and the insane compatibility topic between them.
I hope this can be of help to you!
Neat Stuff
I though I'd share with you my findings because I've spent quite the amount of time trying to figure out how to fix the following error with my library's expo plugin:
If you experience this, it may be due to how you've setup your package.json: if you've configured it to use the
exports
keyword as per latest changes, be aware that you will not be able to create an expo plugin that makes your library installable on expo with theprebuild
setup.The Expo documentation says, in Plugin and Mods, says that:
It doesn't mention compatibility with the
exports
keyword, so I think we do not have it yet available, even tho the ecosystem is closing the gap with the ESM adoption.That said, the fix is quite simple at the moment, you simply need to avoid using the
exports
keyword and rely on the old way, see below:This makes sure that your library, built with
create-react-native-library
, can be used in both bare and expo environments.Additional
Here you can find my PR that brings support to react-native 79 plus sdk 53: feat: upgrade react native to 79.2
Beta Was this translation helpful? Give feedback.
All reactions