패키지 설치
yarn add babel-plugin-module-resolver -D npm i -D babel-plugin-module-resolver
Babel 설정
// babel.config.js module.exports = { presets: ['module:metro-react-native-babel-preset'], plugins: [ [ 'module-resolver', { root: ['./src'], alias: { '@': './src', }, }, ], ], }
TS 설정
// tsconfig.json { "extends": "@tsconfig/react-native/tsconfig.json", "compilerOptions": { "skipLibCheck": true, "baseUrl": ".", "paths": { "@/*": ["src/*"], } } }
재시작
yarn start -—reset-cache npm run start --reset-cache