Replies: 7 comments 3 replies
-
Interesting! Have you tried using symlinks in the |
Beta Was this translation helpful? Give feedback.
-
I've published my forked version on NPM here: https://www.npmjs.com/package/@docler/next. If you're interested, feel free to try it out and let me know if there's any issues to fix. |
Beta Was this translation helpful? Give feedback.
-
I have a similar need where I'd also like to provide a base directory of pages, then provide site-specific pages that can override or add new pages to the app. What you're proposing would be a great addition and would also open the door for simply changing the page path based on the env variables. There were also some ideas for loading pages via a plugin system: #9133. |
Beta Was this translation helpful? Give feedback.
-
Thank you @danielkov for you work. I'm using
|
Beta Was this translation helpful? Give feedback.
-
I'm needing this feature. I will prefer this way to structure apps instead of module federation. However I propose a different config structure:
In that way navigating to |
Beta Was this translation helpful? Give feedback.
-
Here's what always annoyed me about I propose Also note that people use the 'router' abstraction on the front end and back end, so it is a universal concept. There's react router, and there's express router. @timneutkens I know you have been adamantly against a configuration option for the pages dir in the past (example), but would you agree that If you'd like, I could make a separate thread for this. |
Beta Was this translation helpful? Give feedback.
-
"I haven't heard a good argument to allow it" is a naive statement.You haven't heard a good argument according to yourself. There's hundreds of reactions disagreeing with your decision about this. That should be enough in an open-source project to warrant lifting your foot off this. I don't understand why Vercel is so against this, if we go back to the days of self-hosting with IIS and Apache, there was not a single soul even trying to propose a limitation of e.g. the IIS physical path or the Apache filesystem locations, yet they pretty much ran the internet. Here's a "good argument" if you wish, by telling developers that you're putting your foot down on not implementing this, you're indirectly telling them:
This is certainly not the way to go about this, in my opinion... You as a company definitely do not need to provide support for contributions like these that you do not agree with, you can make that exceptionally clear, but at the very least - allow contributors to implement what's asked for, even if it has to be put behind some kind of obscure "unsupported" flag to use. |
Beta Was this translation helpful? Give feedback.
-
Describe the feature you'd like to request
At my company, we'd like the following feature to be added to
next
:Add configurable pages directory option, with multi-directory support.
Our use-case is the following:
src/pages
)sites
directorypages
directory, where additional pages can be added and shared pages can be overriddennext
for development, an environment variable has to be defined for the current site, which is then accessed innext.config.js
where it's added the a new configpagesPaths
array.pagesPaths
arraypagesPaths
until all pages are discoveredDescribe the solution you'd like
My current solution is the following:
next.config.js
:next
to be able to handle this config and read from multiple directories.The working reference implementation can be found here
I'd love for this to be considered for merging into
next
. I understand there's been similar issues in the past and they'd been shot down because of the "convention over configuration" argument, but I have a working reference implementation that does not compromise current workings ofnext
, only extends it with negligible cost.Describe alternatives you've considered
next
process - while this works for building, because there are filesystem changes required to make this work, it is not feasible in development mode.patch-package
to add the delta of the changes after install - this has all the disadvantages of the previous solution, plus there's an extra step of having to build, copy and apply patch after each update.Beta Was this translation helpful? Give feedback.
All reactions