Skip to content

Why stub pages for /src/pages? #102

Answered by sozonome
mattkrick asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @mattkrick 👋

Your guess is one of the reasons, another reason is /pages folder in next.js have its own rules (for how to defined the page, embedding GSSP, GSSR, etc).

If someday I'd like to copy pages components into another project which maybe not using next.js (for example vite with react-router or remix), I'd just need to copy lib folder and re-create the /pages file conforming with the other project's rules.

Portability and to separate which folder is next.js specific (src/pages) and which are not (src/lib)

I'm open for suggestions though. I've been tinkering with various foldering conventions and finding sweet spot in src/lib and src/pages foldering structure (highly influenced by…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mattkrick
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants