-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Support for absolute import #276
Comments
Good idea! We're having a discussion about this in #253! |
What is the reason behind top-level “file type” folders? Seems like this is exactly why you want to group assets by component instead, e.g.
|
Well, but you might still need to import a component from a different component: // src/containers/NavBar/Navbar.js
import NavItem from 'components/NavItem'; is a lot nicer than // src/containers/NavBar/Navbar.js
import NavItem from '../components/NavItem'; It gets even worse if you're following a nested, route-hirarchic structure. |
Closed
marcelmokos
added a commit
to marcelmokos/create-react-app
that referenced
this issue
Dec 19, 2016
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.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
For example, I have the following structure
Instead of doing
import logo from "../img/logo.svg"
inside App.js it will be nice to do
import logo from "img/logo.svg"
and it will be easier to read if I have a component placed in deep directory like
components/Sidebar/index.js
.The text was updated successfully, but these errors were encountered: