.vercelignore file?

I have published many sites on Pages using the next-on-pages tool. In the past, my projects only contained the Next.js app and nothing else.

This week, I'm trying to set up a site that includes the Next.js app but also a Sanity.io studio install. The project can be used to build the Next.js project and run Sanity Studio for authors.

Sanity Studio keeps a set of key schema files in a directory called schema. This directory is not needed for building the Next.js project and can/should be ignored by Next.js or next-on-pages activity.

The problem:
Running npx @cloudflare/next-on-pages@1 results in a type error for the Sanity schema that blocks the build.

Attempted (and failed) fixes:
  • Hide the folder with the offending files by renaming /schema to /.schema.
  • Add a .vercelignore file with schema as the lone entry.
  • Add schema to the tsconfig.json file in the project to exclude the directory from type checking.
  • Added schema to the .gitignore as a test (this won't be acceptable as a solution) but that also failed.
  • Experimented with
    wrangler.toml
    to see if there's a way to do it there, but I don't think that runs on prod builds anyhow so..../shrug
  • Tried all of the above at the same time, just in case...but no joy.
How can I tell next-on-pages to ignore a set of files or directories on build?
Was this page helpful?