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
Resolve modules absolutely #342
Comments
You can create a When #222 be merged you will be able to able to configure aliases (or custom modules directories) in the webpack configuration. Maybe this can be added to the next.js configuration, but then everyone should use a |
@rovansteen @sergiodxa Next.js supports NODE_PATH env variable. You can |
@arunoda yeah I saw that issue but that's not working for me because the files are imported that way are not transpiled through babel. Is that correct? @sergiodxa that was something I tried as well but ran into the issue you described. Guess I'll have to wait until #222 is merged. Thanks anyway! |
@rovansteen no. It should work properly. If that's not working it's a bug. |
I suggest babel-root-import It can be configured to support multiple paths. |
@arunoda when using |
Correction, |
@rovansteen Yep. |
I've look at this again. We do support absolute modules via NODE_PATH in webpack environment. But for SSR, it won't work well. I tried fixing a lot of stuff, even hijacking node's module system or introduce a different env variable. This is doable, but feels hacky. Since we've a solution via |
+ I have replaced redirects with copies of main dashboard page. This way user should be less confused about what's happening, since navigation indicator should follow his clicks.
Is there any way right now to resolve modules absolutely relative to the project directory?
For example inside a file in the
pages
directory:where the
components
directory is next to thepages
directory.This would be nice so that we don't have to write long relative paths for nested directories.
The text was updated successfully, but these errors were encountered: