You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CRA internally use webpack, so you can find the webpack configuration in config folder and you can change them as you want after ejecting.
Also, there is one way to use absolute paths without ejecting though you don't get much flexibility like webpack aliases. CRA respect NODE_PATH environment variable. So you can set NODE_PATH=src and import anything in the src folder directly like import Header from "app/Header" assuming there is a src/app/Header.js file. To configure this environment variable you can either use .env file or use a tool like cross-env with npm scripts. This issue has been extensively discussed in #741.
Hello, I was wondering if there is a way to resolve paths with an app created with CRA (create-react-app).
Like that.
resolve:{ alias:{ app: path.resolve(__dirname, 'src/app/'), } }
in webpackIt's always a pain to to do this
import Header from '../../Header'
Or a way to configure if I ever eject.
If there isn't. Will be great to add that capability.
Thank you.
The text was updated successfully, but these errors were encountered: