— react-native, create-react-native-app, absolute-path — 1 min read
참고(Reference) : https://github.com/react-community/create-react-native-app
1create-react-native-app my-appbabel-plugin-module-resolver 설치(Install babel-plugin-module-resolver)1npm install babel-plugin-module-resolver -D.babelrc 수정(Edit .babelrc)1"plugins": [2  [3    "module-resolver",4    {5      "root": ["./src"],6      "extensions": [".js", ".ios.js", ".android.js"]7    }8  ]9]캐시를 비우고 다시 시작한다.(Empty the cache and restart)
1npm start --reset-cacheroot 에 원하는 경로를 넣으면 된다. 아래 예제에서는 src를 root 로 설정했다.
(Input the path in root. In the following example, set src to root)
만약 /src/component/MyComponent를 import 하려면 아래와 같이 작성한다.
(If you import from /src/component/MyComponent type below code)
1import MyComponent from "components/MyComponent";