Customize babel config by merging new config in, not completely replacing the default config #542
Closed
chriscoomber
started this conversation in
Ideas
Replies: 1 comment 2 replies
-
Such modifications are currently not supported properly as it's not straightforward and needs more work. If you're shipping source code (in the And if you're using module resolver, you also need to make sure that it doesn't conflict with paths in your example app. As of now, I recommend not customizing the babel config. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using my library with a custom babel.config.js file:
babel.config.js
In my package.json I do:
However, this means I lose the well-honed default babel config (see compile.ts) since it gets completely replaced. I don't know enough to know what I'm missing; it was working fine before I added a custom babel.config.js, but I needed to add the module-resolver plugin for other reasons.
Should there a way to just add this one extra plugin to the default config?
Why do I care
I need to do a few things that aren't in the default config:
React
.@react-native/babel-preset
does this by default.Unfortunately, with the solution I have above, I would need to provide
presets: [['@react-native/babel-preset', { disableImportExportTransform: true }]],
just for ESM, to stop it stripping import/export syntax. This means I need two babel config files. It would be much easier to just add in mymodule-resolver
plugin, and addto the default config.
Beta Was this translation helpful? Give feedback.
All reactions