facebook / metro

🚇 The JavaScript bundler for React Native
https://metrobundler.dev
MIT License
5.22k stars 624 forks source link

Support ES Module / Typescript config #916

Open acalvino4 opened 1 year ago

acalvino4 commented 1 year ago

Feature request: support typescript / esm config

What is the current behavior?

Metro does not look for a metro.config.ts, and if it did, I have no idea whether it would be configurable as a module.

This seems necessary sooner or later, as the ecosystem is moving to modules, and majority of people are using typescript (RN just made it the default for new projects).

What is the desired behavior?

Metro uses metro.config.ts if it exists, and the docs include an example of what this looks like.

karlhorky commented 7 months ago

Update on ESM configs:

In the other issue @robhogan mentioned that ESM configs will need to wait until Node.js v20 is used for the react-native projects: