Skip to content

The build assumes that all js files under /pages is a page #3183

@emattias

Description

@emattias

We have structured our files so that page specific code is in the pages folder. Here is an example:

  • pages
    • manage-users
      • __tests__
        • manage-users.test.js
      • index.js
      • components
        • ManageUsersPage.js
        • <other page specific components here>

The index.js file has the ManageUsersPage.js components as its default export. That is a regular next.js page component

This structure has worked fine for us except when we build. This hardcoded glob assumes that all js files under pages is a page: https://github.com/zeit/next.js/blob/canary/server/build/webpack.js#L50

Does it make sense to make this glob overridable or do we have to not use file based routing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions