Created
December 5, 2019 19:50
-
-
Save burdiuz/18f9b885ca054fee0350429f71eedd3e to your computer and use it in GitHub Desktop.
Metro bundler config as replacement for rn-nodeify, substitutes nodejs modules for dependencies
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Metro configuration for React Native | |
* https://github.com/facebook/react-native | |
* | |
* @format | |
*/ | |
const path = require('path'); | |
module.exports = { | |
resolver: { | |
extraNodeModules: { | |
crypto: path.resolve(__dirname, './node_modules/react-native-crypto'), | |
net: path.resolve(__dirname, './node_modules/react-native-tcp'), | |
os: path.resolve(__dirname, './node_modules/react-native-os'), | |
querystring: path.resolve(__dirname, './node_modules/querystring-es3'), | |
dgram: path.resolve(__dirname, './node_modules/react-native-udp'), | |
stream: path.resolve(__dirname, './node_modules/readable-stream'), | |
fs: path.resolve(__dirname, './node_modules/react-native-level-fs'), | |
vm: path.resolve(__dirname, './node_modules/vm-browserify'), | |
}, | |
}, | |
transformer: { | |
getTransformOptions: async () => ({ | |
transform: { | |
experimentalImportSupport: false, | |
inlineRequires: false, | |
}, | |
}), | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment