diff --git a/next.config.js b/next.config.js index 5ea16b7e..12f79d42 100644 --- a/next.config.js +++ b/next.config.js @@ -95,7 +95,7 @@ const nextConfig = { stripPrefix: ["webpack://_N_E/"], urlPrefix: `~${basePath}/_next`, release: COMMIT_SHA, - }), + }) ); } return config; @@ -117,6 +117,7 @@ const nextConfig = { TRACKING_KEY: process.env.TRACKING_KEY, ENABLE_GOOGLE_PAY: process.env.ENABLE_GOOGLE_PAY, ENABLE_APPLE_PAY: process.env.ENABLE_APPLE_PAY, + DISABLE_VERCEL_REDIRECT: process.env.DISABLE_VERCEL_REDIRECT, }, trailingSlash: false, reactStrictMode: true, diff --git a/pages/_app.tsx b/pages/_app.tsx index 39c3fa57..dd5b986a 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -87,7 +87,10 @@ function MyApp({ process.env.VERCEL_URL && typeof window !== "undefined" ) { - if (process.env.VERCEL_URL !== window.location.hostname) { + if ( + process.env.VERCEL_URL !== window.location.hostname && + process.env.DISABLE_VERCEL_REDIRECT !== "true" + ) { router.replace(`https://${process.env.VERCEL_URL}`); } }