Skip to content

Commit

Permalink
Exclude Explorer previews from indexing (#995)
Browse files Browse the repository at this point in the history
  • Loading branch information
majakomel committed Feb 13, 2025
1 parent 3a44f1c commit 3fe1206
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,21 @@ module.exports = withBundleAnalyzer(
},
]
},
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)
Expand Down

0 comments on commit 3fe1206

Please sign in to comment.