fixing vercel deployments by switching next config using env (#2067)

This commit is contained in:
sriram veeraghanta 2023-09-03 20:55:37 +05:30 committed by GitHub
parent 1e152c666c
commit 4ea52302ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 6 deletions

View File

@ -1,15 +1,18 @@
/** @type {import('next').NextConfig} */ /** @type {import('next').NextConfig} */
const path = require("path"); const path = require("path");
const withImages = require("next-images") const withImages = require("next-images");
const nextConfig = withImages({ const nextConfig = {
basePath: "/spaces",
reactStrictMode: false, reactStrictMode: false,
swcMinify: true, swcMinify: true,
experimental: { experimental: {
outputFileTracingRoot: path.join(__dirname, "../"), outputFileTracingRoot: path.join(__dirname, "../"),
}, },
output: "standalone", 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;
}

View File

@ -24,7 +24,8 @@
"NEXT_PUBLIC_SLACK_CLIENT_SECRET", "NEXT_PUBLIC_SLACK_CLIENT_SECRET",
"NEXT_PUBLIC_SUPABASE_URL", "NEXT_PUBLIC_SUPABASE_URL",
"NEXT_PUBLIC_SUPABASE_ANON_KEY", "NEXT_PUBLIC_SUPABASE_ANON_KEY",
"NEXT_PUBLIC_PLAUSIBLE_DOMAIN" "NEXT_PUBLIC_PLAUSIBLE_DOMAIN",
"NEXT_PUBLIC_DEPLOY_WITH_NGINX"
], ],
"pipeline": { "pipeline": {
"build": { "build": {