waku-react-native/example/metro.config.js

30 lines
801 B
JavaScript
Raw Normal View History

// Learn more https://docs.expo.io/guides/customizing-metro
const { getDefaultConfig } = require('expo/metro-config');
const exclusionList = require('metro-config/src/defaults/exclusionList');
2022-05-10 23:42:15 +00:00
const path = require('path');
const pak = require('../package.json');
const root = path.resolve(__dirname, '..');
const modules = Object.keys({
...pak.peerDependencies,
});
let config = getDefaultConfig(__dirname);
config.projectRoot = __dirname;
config.watchFolders = [root];
config.resolver = {
blacklistRE: exclusionList(
modules.map(
(m) => new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`)
)
),
extraNodeModules: modules.reduce((acc, name) => {
acc[name] = path.join(__dirname, 'node_modules', name);
return acc;
}, {}),
};
module.exports = config;