From 4ed70beabc73dd9aa1d2e06ab5902ded0801c404 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Fri, 4 Mar 2022 16:49:41 +0100 Subject: chore: use a different configuration depending on app env It will be useful with Docker. Instead of cloning the project with a different configuration, I can manage two different configuration thanks to dotenv and some checking inside the app. --- next-sitemap.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'next-sitemap.js') diff --git a/next-sitemap.js b/next-sitemap.js index c9cd443..348ea0b 100644 --- a/next-sitemap.js +++ b/next-sitemap.js @@ -1,7 +1,11 @@ /** @type {import('next-sitemap').IConfig} */ +const isStaging = process.env.APP_ENV === 'staging'; + module.exports = { - siteUrl: `${process.env.NEXT_PUBLIC_APP_PROTOCOL}://${process.env.NEXT_PUBLIC_APP_DOMAIN}`, + siteUrl: isStaging + ? process.env.NEXT_PUBLIC_STAGING_APP_URL + : process.env.NEXT_PUBLIC_APP_URL, generateRobotsTxt: true, changefreq: null, priority: null, -- cgit v1.2.3