Skip to content

Instantly share code, notes, and snippets.

@eugenehp
Created April 5, 2021 20:54
Show Gist options
  • Save eugenehp/0a12d427fdfd1a737ccdbc7e4dbac667 to your computer and use it in GitHub Desktop.
Save eugenehp/0a12d427fdfd1a737ccdbc7e4dbac667 to your computer and use it in GitHub Desktop.
react-native-randomness example metro config
const path = require('path');
const pak = require('../package.json');
const root = path.resolve(__dirname, '..');
const modules = Object.keys({
...pak.peerDependencies,
});
module.exports = {
projectRoot: __dirname,
watchFolders: [root],
resolver: {
extraNodeModules: modules.reduce((acc, name) => {
acc[name] = path.join(__dirname, 'node_modules', name);
return acc;
}, {}),
},
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: true,
},
}),
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment