getSourceExts not being respected when bundling
See original GitHub issueDo you want to request a feature or report a bug?
Bug
What is the current behavior?
Metro appears to be not respecting the configuration defined in rn-cli.config.js
module.exports = {
getSourceExts: () => {
return ['jsx', 'mjs', 'js'];
}
};
If the current behavior is a bug, please provide the steps to reproduce and a minimal repository on GitHub that we can yarn install
and yarn test
.
Include the above rn-cli.config.js in a RN 0.57.0 project and attempt to leverage a JSX file for your App component.
What is the expected behavior? JSX file extensions should be in the appropriate search paths.
Please provide your exact Metro configuration and mention your Metro, node, yarn/npm version and operating system.
- Metro v0.45.2
- RN 0.57.0
- Yarn 1.9.4
- OSX
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
Top Results From Across the Web
Mandy's Tech Blog
Since React 16.8 came out earlier this week, I've been playing around with hooks ... The array of inputs is not passed as...
Read more >react native – MagmaLabs Blog
Look no further! This introduction to Styled Components will give you your first approach to the library and showcase the power of JS...
Read more >react-native-typescript-transformer - Bountysource
Namespaces; Imports with require. As a consequence, the project cannot compile on metro. It is not clear to me if I can avoid...
Read more >2019-July.txt - CMake
The branch, master has been updated via ... If any of these arguments is not used, then the corresponding variables are set to...
Read more >users/asn/cmake.git - cryptomilk git repositories
‑rw‑r‑‑r‑‑ CMakeLists.txt 2
‑rw‑r‑‑r‑‑ CTestCustom.cmake.in 1
‑rw‑r‑‑r‑‑ ChangeLog.manual 410
‑rw‑r‑‑r‑‑ Docs/cmake‑help.vim 21
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It appears that the config for
sourceExts
does not merge with the defaults specified in the Metro source.This ended up working for me.
I believe
getSourceExts
has changed. See https://github.com/react-native-community/react-native-releases/blob/master/CHANGELOG.md#updating-to-this-version which links to https://facebook.github.io/metro/docs/en/configurationInstead, try: