-
Notifications
You must be signed in to change notification settings - Fork 184
Is it possible to set up an absolute path for import in css and js? #60
Comments
Nope you can just use relative paths. Try to keep only one nest level in your directories: this should prevent the most of the hassle during refactoring.... |
@gpbl For a project with a lot of components using a flat directory structure is really not the best solution. Are you sure that webpack doesn't support it the other way? |
In my experience nested directories for components don't help at all... try to split your components using the atomic design principles: you will end with three/four directories and much less pain :) |
So, you are talking about splitting components folder into several ones? Don't you think that having several directories in the component one looks more logical? I wan't thinking about three and more levels of nesting, btw. %) |
It looks more logical but in practice I've found they are harder to organize. You will find yourself refactoring quite often. Atomic design principles IMHO fit great in a react application. You can split your components into |
Ok, thanks! I'll try it this way. |
Hey, another question.
The solution when you have to set paths relative to the position of the file you are importing to, looks rather inconvenient, because when you move one file, you have to update not only the import paths of modules that use it, but also the paths of modules it imports itself. It bring an unnecessary level of complexion.
Is it possible to somehow change it, so it looks for the files always starting from the /src folder and down?
The text was updated successfully, but these errors were encountered: