src/pages only create a page for lowercased .js files #33962
Replies: 2 comments 3 replies
-
There's no reason why that one off component couldn't live within your "components" folder. Nothing about components stipulates that they have to be reused. That's not true for "pages" which clearly indicates it's intention. Having any escape hatch convention for pages is going to lead to confusion. If you really don't like putting those files in components then why not create another folder and reference that? "/one-off-components" |
Beta Was this translation helpful? Give feedback.
-
Hi! We won't be changing our convention here, files inside |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Oftentimes we create one off components in the pages directory alongside the page for better organization. They are not reusable in their own right (if they were, they would be in
src/components
), but they help for readability and organization.The downside is that pages are created for ANY .js file within
src/pages
. This unnecessarily increases build time, and it'd be nice to avoid it with the convention of lowercased .js files being the only ones to actually generate a page.Beta Was this translation helpful? Give feedback.
All reactions