Unverified Commit 55365268 authored by Lee Robinson's avatar Lee Robinson Committed by GitHub

Remove dotenv from Relay example. (#21814)

Address one of the bullet points from https://github.com/vercel/next.js/issues/15225 to remove unused dependencies on `dotenv` now that it's supported by default in Next.js.
parent 379ad1b3
RELAY_ENDPOINT=https://nextjs-graphql-with-prisma-relay.vercel.app/api
NEXT_PUBLIC_RELAY_ENDPOINT=https://nextjs-graphql-with-prisma-relay.vercel.app/api
require('dotenv').config()
const path = require('path')
const Dotenv = require('dotenv-webpack')
module.exports = {
webpack: (config) => {
config.plugins = config.plugins || []
config.plugins = [
...config.plugins,
// Read the .env file
new Dotenv({
path: path.join(__dirname, '.env'),
systemvars: true,
}),
]
return config
},
}
......@@ -16,8 +16,6 @@
"@zeit/next-css": "1.0.1",
"bs-fetch": "0.5.2",
"bs-platform": "7.2.2",
"dotenv": "^8.2.0",
"dotenv-webpack": "^1.7.0",
"graphql": "15.0.0",
"isomorphic-unfetch": "^3.0.0",
"next": "latest",
......
......@@ -11,7 +11,7 @@ exception Graphql_error(string);
*/
let fetchQuery: ReasonRelay.Network.fetchFunctionPromise =
(operation, variables, _cacheConfig) => {
let uri: string = [%raw "process.env.RELAY_ENDPOINT"];
let uri: string = [%raw "process.env.NEXT_PUBLIC_RELAY_ENDPOINT"];
fetchWithInit(
uri,
RequestInit.make(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment