30 lines
801 B
JavaScript
30 lines
801 B
JavaScript
// Learn more https://docs.expo.io/guides/customizing-metro
|
|
const { getDefaultConfig } = require('expo/metro-config');
|
|
const exclusionList = require('metro-config/src/defaults/exclusionList');
|
|
|
|
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;
|