callstack / react-native-builder-bob

👷‍♂️ Simple set of CLIs to scaffold and build React Native libraries for different targets
https://callstack.github.io/react-native-builder-bob/
2.78k stars 184 forks source link

feat: add ESM support for generated project #583

Closed satya164 closed 3 months ago

satya164 commented 3 months ago

This adds ESM support to the generated project. To do this:

In addition:

This is a breaking change for library authors. After upgrading, it's necessary to update the configuration by running the following command:

yarn bob init

Alternatively, they can follow the manual configuration guide.

In addition, typescript consumers would need to change the following fields in tsconfig.json:

"jsx": "react-jsx",
"moduleResolution": "Bundler",

If using ESLint, it may also be necessary to disable the "react/react-in-jsx-scope" rule:

"react/react-in-jsx-scope": "off"