diff --git a/next.config.js b/next.config.js index 03830219..ef31e19a 100644 --- a/next.config.js +++ b/next.config.js @@ -40,6 +40,21 @@ module.exports = withBundleAnalyzer( locales: getSupportedLanguages(), defaultLocale: DEFAULT_LOCALE, }, + async headers() { + const headers = [] + if (process.env.NEXT_PUBLIC_VERCEL_ENV === 'preview') { + headers.push({ + headers: [ + { + key: 'X-Robots-Tag', + value: 'noindex', + }, + ], + source: '/:path*', + }) + } + return headers + }, webpack: (config, options) => { const gitCommitSHAShort = process.env.RUN_GIT_COMMIT_SHA_SHORT ? execSync(process.env.RUN_GIT_COMMIT_SHA_SHORT)