sanity-io / sanity-template-nextjs-clean

A clean Next.js template with a native authoring experience
https://template-nextjs-clean.sanity.build
144 stars 58 forks source link

How to run sanity deploy? #50

Closed cywtf closed 11 months ago

cywtf commented 11 months ago

I want to deploy the studio to its own url, but there is no deploy in the package.json

"scripts": {
    "build": "next build",
    "dev": "next",
    "format": "npx prettier --write . --ignore-path .gitignore",
    "lint": "next lint -- --ignore-path .gitignore",
    "lint:fix": "npm run format && npm run lint -- --fix",
    "start": "next start",
    "type-check": "tsc --noEmit"
  },

If I run sanity deploy in the root folder I get an error

Error: [vite]: Rollup failed to resolve import "~/lib/sanity.api" from "/folder".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`

What's the way to do that with this setup?