-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmetro.config.js
More file actions
35 lines (33 loc) · 1.08 KB
/
metro.config.js
File metadata and controls
35 lines (33 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
const { getDefaultConfig } = require('@react-native/metro-config');
const path = require('path');
/**
* Metro configuration
* https://reactnative.dev/docs/metro
*
* @type {import('@react-native/metro-config').MetroConfig}
*/
module.exports = (async () => {
const config = await getDefaultConfig(__dirname);
return {
...config,
resolver: {
...config.resolver,
// 이미지 확장자 명시적 추가
assetExts: [...config.resolver.assetExts, 'png', 'jpg', 'jpeg', 'gif'],
// 기본 소스 확장자 유지
sourceExts: [...config.resolver.sourceExts],
// React Navigation 에셋 경로 추가
assets: ['./node_modules/@react-navigation/elements/src/assets'],
resolverMainFields: ['sbmodern', 'react-native', 'browser', 'main'],
extraNodeModules: new Proxy({}, {
get: (target, name) => {
if (name === '@') {
return path.resolve(__dirname, 'src');
}
return path.join(__dirname, `node_modules/${name}`);
},
}),
},
watchFolders: [path.resolve(__dirname)],
};
})();