Skip to content

Commit

Permalink
Use next/env instead of dotenv
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvinkipruto committed Oct 4, 2024
1 parent 1cb2dd5 commit d602808
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
1 change: 0 additions & 1 deletion apps/climatemappedafrica/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
"clsx": "catalog:",
"d3-format": "catalog:",
"deepmerge": "catalog:",
"dotenv": "catalog:",
"express": "catalog:",
"leaflet": "catalog:",
"lodash": "catalog:",
Expand Down
8 changes: 3 additions & 5 deletions apps/climatemappedafrica/payload.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import path from "path";

import { buildConfig } from "payload/config";
import dotenv from "dotenv";
import { loadEnvConfig } from "@next/env";
import { cloudStorage } from "@payloadcms/plugin-cloud-storage";
import { s3Adapter } from "@payloadcms/plugin-cloud-storage/s3";
import { slateEditor } from "@payloadcms/richtext-slate";
Expand All @@ -17,8 +15,8 @@ import Media from "./src/payload/collections/Media";
import Pages from "./src/payload/collections/Pages";
import Users from "./src/payload/collections/Users";

dotenv.config();
dotenv.config({ path: path.resolve(__dirname, "./.env.local") });
const projectDir = process.cwd();
loadEnvConfig(projectDir);

const appURL = process.env.PAYLOAD_PUBLIC_APP_URL;

Expand Down
3 changes: 0 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d602808

Please sign in to comment.