const { withNxMetro } = require('@nx/expo');
const { getDefaultConfig } = require('@expo/metro-config');
const { mergeConfig } = require('metro-config');
const path = require('path');
const projectRoot = __dirname;
const workspaceRoot = path.resolve(projectRoot, '../../..');
const defaultConfig = getDefaultConfig(projectRoot);
const { assetExts, sourceExts } = defaultConfig.resolver;
const customConfig = {
transformer: {
babelTransformerPath: require.resolve('react-native-svg-transformer'),
},
resolver: {
assetExts: assetExts.filter((ext) => ext !== 'svg'),
sourceExts: [...sourceExts, 'cjs', 'mjs', 'svg'],
useWatchman: true,
blockList: [
new RegExp(`${path.resolve(workspaceRoot, 'node_modules/react-native')}/.*`),
new RegExp(`${path.resolve(workspaceRoot, 'node_modules/@babel')}/.*`),
],
},
watchFolders: [
path.resolve(projectRoot, 'src'),
path.resolve(projectRoot, 'assets'),
workspaceRoot,
],
watchman: {
followSymlinks: true,
},
maxWorkers: 2,
resetCache: true,
};
module.exports = withNxMetro(mergeConfig(defaultConfig, customConfig), {
debug: true,
extensions: ['js', 'jsx', 'ts', 'tsx', 'json', 'cjs', 'mjs', 'svg'],
watchFolders: [
path.resolve(projectRoot, 'src'),
path.resolve(projectRoot, 'assets'),
workspaceRoot,
],
}).then((config) => {
config.watchFolders = config.watchFolders.map((folder) => path.resolve(folder));
return config;
});
ulimit 4096
brew update
brew upgrade
brew cleanup
brew uninstall watchman
brew install watchman
brew upgrade watchman
watchman watch-del-all
watchman shutdown-server
watchman
- watchman의 설정은 메모리에 저장되며, 프로세스가 종료되면 설정이 초기화됩니다. 즉, watchman을 재시작하면 이전에 설정한 감시 목록이나 상태는 사라지게 됩니다.