-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
Can we please have official support for putting everything in a src directory? #8415
Comments
I'd guess because a lot of functionality and optimizations in next.js are build around having the pages inside the pages directory. On a side note - i was upvoting the original issue and just removed my vote. After using next.js for a while I learned to bend my mental model to see We currently use this structure in a rather big app and developers tend to like(or at least not hate) it.
I'd love to see #7779 to land as we currently still rely on relative import paths. |
I fully understand this, but allowing the directory to be |
Going to close this as this is not following the issue template nor is it an RFC. I'm really not sure why you completely ignored the issue template. I replied here yesterday that we'll soon add support for We'll post a RFC soon. |
Posted #8451 |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
This feature has been requested for years (e.g., #4789).
We've had workarounds, but now with things like official TS support it's no longer possible because Next assumes so much of our project structure. E.g., we can run "next ./src" but it assumes our
tsconfig.json
should be undersrc
, too.Putting everything in a
src
dir is such a common project structure. It's used by CRA and just about every React starter kit.Our
components
dir is on the same level asdist
,.babelrc
,tsconfig.json
,node_modules
,pages
,next.config.js
,static
, etc. It's so disorganized!All we would like is a
srcDir
option. Why is there so much opposition from the Next team on this?The text was updated successfully, but these errors were encountered: