mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-05-24 03:35:43 +00:00
cc527dfd49
# Summary Fixes paths in Metro config
31 lines
1.0 KiB
JavaScript
31 lines
1.0 KiB
JavaScript
// Learn more https://docs.expo.io/guides/customizing-metro
|
|
const { getDefaultConfig } = require('expo/metro-config');
|
|
const path = require('path');
|
|
|
|
const config = getDefaultConfig(__dirname);
|
|
|
|
// npm v7+ will install ../node_modules/react-native because of peerDependencies.
|
|
// To prevent the incompatible react-native bewtween ./node_modules/react-native and ../node_modules/react-native,
|
|
// excludes the one from the parent folder when bundling.
|
|
config.resolver.blockList = [
|
|
...Array.from(config.resolver.blockList ?? []),
|
|
new RegExp(path.resolve('../..', 'node_modules', 'react-native')),
|
|
new RegExp(path.resolve('../..', 'node_modules', 'react')),
|
|
];
|
|
|
|
config.resolver.nodeModulesPaths = [
|
|
path.resolve(__dirname, './node_modules'),
|
|
path.resolve(__dirname, '../../node_modules'),
|
|
];
|
|
|
|
config.watchFolders = [path.resolve(__dirname, '../..')];
|
|
|
|
config.transformer.getTransformOptions = async () => ({
|
|
transform: {
|
|
experimentalImportSupport: false,
|
|
inlineRequires: true,
|
|
},
|
|
});
|
|
|
|
module.exports = config;
|