Absolute Imports
Import project assets using absolute paths from the project root.
So this…
const dateUtil =
…becomes…
const dateUtil =
Support
Works with React Native and Node.
For web, you don't need this package. Simple add this to your Webpack config:
resolve: { // ...+ modulesDirectories: ['', 'node_modules'],},
Install
yarn add absolute-imports
Setup
The best way to set up is to add the script to the postinstall
step - but feel free to move it around as you like.
// package.json // ... "scripts" // ... "postinstall": "node absolute-imports --prefix=org --project=app"