@sanity/routes
    Preparing search index...

    Function createRouteMapType

    • Creates the route map schema type with the correct reference targets.

      Each document is a pre-computed shard mapping document IDs to their resolved URL paths for a specific channel + document type combination.

      Parameters

      • OptionalroutableTypes: string[]

        The document type names that can appear in route maps. When provided, the doc field uses a proper weak reference with to set to these types. When empty, falls back to a plain object field to avoid Sanity's "reference type should define at least one accepted type" error.

      Returns { name: "routes.map"; type: "document" } & Omit<DocumentDefinition, "preview"> & {
          preview?: PreviewConfig<
              { channel: string; documentType: string; entries: string },
              Record<"entries" | "channel" | "documentType", any>,
          >;
      }