From 4ea52302babd0ef4123bf0ad98aee08a8c3b7782 Mon Sep 17 00:00:00 2001 From: sriram veeraghanta Date: Sun, 3 Sep 2023 20:55:37 +0530 Subject: [PATCH] fixing vercel deployments by switching next config using env (#2067) --- space/next.config.js | 13 ++++++++----- turbo.json | 3 ++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/space/next.config.js b/space/next.config.js index 0b0ccadb5..712c1c472 100644 --- a/space/next.config.js +++ b/space/next.config.js @@ -1,15 +1,18 @@ /** @type {import('next').NextConfig} */ const path = require("path"); -const withImages = require("next-images") +const withImages = require("next-images"); -const nextConfig = withImages({ - basePath: "/spaces", +const nextConfig = { reactStrictMode: false, swcMinify: true, experimental: { outputFileTracingRoot: path.join(__dirname, "../"), }, output: "standalone", -}); +}; -module.exports = nextConfig; +if (parseInt(process.env.NEXT_PUBLIC_DEPLOY_WITH_NGINX || "0")) { + const nextConfigWithNginx = withImages({ basePath: "/spaces", ...nextConfig }); +} else { + module.exports = nextConfig; +} diff --git a/turbo.json b/turbo.json index 69da3c552..47b92f0db 100644 --- a/turbo.json +++ b/turbo.json @@ -24,7 +24,8 @@ "NEXT_PUBLIC_SLACK_CLIENT_SECRET", "NEXT_PUBLIC_SUPABASE_URL", "NEXT_PUBLIC_SUPABASE_ANON_KEY", - "NEXT_PUBLIC_PLAUSIBLE_DOMAIN" + "NEXT_PUBLIC_PLAUSIBLE_DOMAIN", + "NEXT_PUBLIC_DEPLOY_WITH_NGINX" ], "pipeline": { "build": {