-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Description
I know this was discussed in #2332 but I have a slightly different use case which I'd like to share.
Feature request
Ignore certain pages under pages/ at build time.
Is your feature request related to a problem? Please describe.
I'm using the same MDX pages (content) in two projects. One handles MDX at runtime and let's me catch malformed MDX/JSX at runtime. The other project uses the MDX files directly at buildtime, but now it fails on a page I was using to demonstrate error handling.
Describe the solution you'd like
Could there be a next.config.js key, like pageExtensions but instead to prevent certain pages (by regex or simple array) from being built? Maybe ignorePages?
Describe alternatives you've considered
Neither the HOC approach nor the 404 trick would help in the case of (known) malformed pages.
Additional context
Note that I'm not looking to put otherwise useful files under pages/ but I want to handle the case of known malformed files.
Back to my two-project example, you could think of one as the Admin and the other as the Public site. Files from Admin are automatically copied to Public using dat, but it would apply to any kind of sync.