tpxqjw
Last Updated: July 12, 2018
·
241
· techmsi
Msi

Absolute Paths in create-react-app

Steps

1) Create a .env file
2) Add the following, save & run npm start

NODE_PATH=src/

All Done

Now you can do

import MyModule from 'components/MyModule'

instead of

import MyModule from './src/components/MyModule'

Say Thanks
Respond