expo-key-event
Version:
Provides an interface for reading key events such as from external bluetooth keyboards on Android, iOS and Web.
29 lines (22 loc) • 1.04 kB
JavaScript
// Learn more https://docs.expo.io/guides/customizing-metro
const { getDefaultConfig } = require('expo/metro-config');
const path = require('path');
/** @type {import('expo/metro-config').MetroConfig} */
const config = getDefaultConfig(__dirname);
// npm v7+ will install ../node_modules/react and ../node_modules/react-native because of peerDependencies.
// To prevent the incompatible react-native between ./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')),
new RegExp(path.resolve('..', '..', 'node_modules', 'react-native')),
];
config.resolver.nodeModulesPaths = [
path.resolve(__dirname, './node_modules'),
path.resolve(__dirname, '../../node_modules'),
];
config.resolver.extraNodeModules = {
'expo-key-event': '../..',
};
config.watchFolders = [path.resolve(__dirname, '..', '..')];
module.exports = config;