-
Notifications
You must be signed in to change notification settings - Fork 27.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
Custom pages directory #13540
Comments
Duplicate of #4315 (comment) This has been discussed very in-depth in the issue tracker already and we're not going to allow for a configuration option for this. |
If you found this, while looking for a solution, there is a fork that allows you to set a custom pages directory, you can find the link in this discussion: #23640 |
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. |
Feature request
Is your feature request related to a problem? Please describe.
I'm vouching for the case of supplying a custom path for where the
pages
live. Currently, this is not configurable and it's either,./pages
or./src/pages
. Usually this is not necessary, but I have one use case for it where this feature would come in very handy.Say you have a couple of websites, all with very similar complex components, yet sometimes they diverge and you need a different page layout or some different modules. We have all the complexity of the modules hidden inside the modules folder and the pages are just simple collections of a layout and the imported modules. When we want one of these websites to diverge we'll end up adding complexity to the page, or we'll be adding a new page that is not necessary for the other websites. Following a CAC approach, it would be great to have a folder per website with very simple pages that connect to the modules folder and that we can compile these separately at build time.
Having different next.js apps could be a simple solution here as well, but I'd rather not duplicate the configuration of our app, I'd rather just change a very simple thing and that is changing the path to the pages folder.
Describe the solution you'd like
A field in the
next.config.js
where you can set a custom path to your pages folder.Describe alternatives you've considered
An alternative could be having several next.js apps.
The text was updated successfully, but these errors were encountered: