-
-
Notifications
You must be signed in to change notification settings - Fork 27k
Add "/src" to webpack resolve.modulesDirectories? #1136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Please could you search the issues and pull requests for "absolute imports"? There have been many discussions about this. Some of them are ongoing. |
Oops, sorry didn't search right. Thanks |
No worries! In short: this is something we want but not through Webpack config because this breaks any other tooling (IDEs, Flow, Node, etc). So instead we're likely to recommend using src/node_modules for this (you can use symlinks for a nicer folder name) once we fix a few issues with this approach. |
You do not have use alias for thing you do. modulesDirectories should work. facebook#1136 facebook#276 facebook#253 The change breaks tooling and you should not use it until issues are resolved with it.
Feature request
Hey,
Since CRA have a
src/
folder that should contains all the source files, we could add this config to webpack: (according to the doc)We would have cleaner import paths.
Example: let's say our app structure is this
We could import
myComponent
in any files like this:import MyComponent from 'components/MyComponent'
instead of having a relative path to import it depending on where we are.
What do you think guys?
The text was updated successfully, but these errors were encountered: