2022-12-12 18:50:50 +00:00
|
|
|
// Learn more https://docs.expo.io/guides/customizing-metro
|
|
|
|
const { getDefaultConfig } = require('expo/metro-config');
|
2023-01-05 20:53:32 +00:00
|
|
|
const exclusionList = require('metro-config/src/defaults/exclusionList');
|
2022-05-10 23:42:15 +00:00
|
|
|
|
2023-01-05 20:53:32 +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;
|