fix: error invalid url on main page on self host #573
This commit is contained in:
Lucas Smith
2023-10-18 23:20:22 +11:00
committed by GitHub
2 changed files with 12 additions and 4 deletions

View File

@ -2,8 +2,12 @@
const path = require('path');
const { withContentlayer } = require('next-contentlayer');
require('dotenv').config({
path: path.join(__dirname, '../../.env.local'),
const ENV_FILES = ['.env', '.env.local', `.env.${process.env.NODE_ENV || 'development'}`];
ENV_FILES.forEach((file) => {
require('dotenv').config({
path: path.join(__dirname, `../../${file}`),
});
});
/** @type {import('next').NextConfig} */

View File

@ -2,8 +2,12 @@
const path = require('path');
const { version } = require('./package.json');
require('dotenv').config({
path: path.join(__dirname, '../../.env.local'),
const ENV_FILES = ['.env', '.env.local', `.env.${process.env.NODE_ENV || 'development'}`];
ENV_FILES.forEach((file) => {
require('dotenv').config({
path: path.join(__dirname, `../../${file}`),
});
});
/** @type {import('next').NextConfig} */