diff --git a/apps/roboshield/package.json b/apps/roboshield/package.json index 4196edb5f..043bccbb6 100644 --- a/apps/roboshield/package.json +++ b/apps/roboshield/package.json @@ -1,18 +1,18 @@ { "name": "roboshield", - "version": "0.1.4", + "version": "0.1.5", "private": true, "scripts": { "build-server": "tsc --project tsconfig.server.json", "build-next": "NEXT_BUILD=true pnpm build-server && NEXT_BUILD=true PAYLOAD_CONFIG_PATH=${PAYLOAD_CONFIG_PATH:-dist/payload.config.js} node dist/server.js", - "build-payload": "PAYLOAD_PUBLIC_APP_URL=${PAYLOAD_PUBLIC_APP_URL} payload build", + "build-payload": "payload build", "start": "PAYLOAD_CONFIG_PATH=${PAYLOAD_CONFIG_PATH:-dist/payload.config.js} NODE_ENV=${NODE_ENV:-production} node dist/server.js", "dev": "NODE_OPTIONS='--inspect' ts-node --project tsconfig.server.json server.ts", "clean": "rm -rf .next .turbo node_modules", "jest": "jest --passWithNoTests", "lint-check": "TIMING=1 next lint './'", "lint": "TIMING=1 next lint --fix './'", - "generate:types": "PAYLOAD_PUBLIC_APP_URL=${PAYLOAD_PUBLIC_APP_URL} payload generate:types" + "generate:types": "payload generate:types" }, "dependencies": { "@commons-ui/core": "workspace:*", diff --git a/apps/roboshield/payload.config.ts b/apps/roboshield/payload.config.ts index c6aa8c5c0..8906a1cc4 100644 --- a/apps/roboshield/payload.config.ts +++ b/apps/roboshield/payload.config.ts @@ -5,7 +5,6 @@ import { webpackBundler } from "@payloadcms/bundler-webpack"; import { CollectionConfig, GlobalConfig } from "payload/types"; import { cloudStorage } from "@payloadcms/plugin-cloud-storage"; import Site from "./src/payload/globals/Site"; -import dotenv from "dotenv"; import Media from "./src/payload/collections/Media"; import Pages from "./src/payload/collections/Pages"; import seo from "@payloadcms/plugin-seo"; @@ -13,9 +12,10 @@ import nestedDocs from "@payloadcms/plugin-nested-docs"; import { s3Adapter } from "@payloadcms/plugin-cloud-storage/s3"; import Users from "./src/payload/collections/Users"; import { defaultLocale, locales } from "./src/payload/utils/locales"; +import { loadEnvConfig } from "@next/env"; -dotenv.config(); -dotenv.config({ path: "./.env.local" }); +const projectDir = process.cwd(); +loadEnvConfig(projectDir); const appURL = process?.env?.PAYLOAD_PUBLIC_APP_URL;