build: load .env file for Sanity CLI configuration
This commit is contained in:
parent
c13064dfa9
commit
b575dcf424
1 changed files with 4 additions and 0 deletions
|
@ -1,5 +1,9 @@
|
||||||
|
import { loadEnvConfig } from "@next/env";
|
||||||
import { defineCliConfig } from "sanity/cli";
|
import { defineCliConfig } from "sanity/cli";
|
||||||
|
|
||||||
|
const dev = process.env.NODE_ENV !== "production";
|
||||||
|
loadEnvConfig(__dirname, dev, { info: () => null, error: console.error });
|
||||||
|
|
||||||
export default defineCliConfig({
|
export default defineCliConfig({
|
||||||
api: {
|
api: {
|
||||||
projectId: `${process.env.NEXT_PUBLIC_SANITY_PROJECT_ID}`,
|
projectId: `${process.env.NEXT_PUBLIC_SANITY_PROJECT_ID}`,
|
||||||
|
|
Loading…
Reference in a new issue