Feature Request: Can we have conditional robot.txt generation? like different for development & production.
vishalyadaviit opened this issue · 2 comments
vishalyadaviit commented
So my requirement is such that I would like to generate robot.txt that block everything for my development platform but only certain things in production.
ricardogobbosouza commented
Hi @nemeton-x
I'll review your request.
ricardogobbosouza commented
Hi @nemeton-x
Try this:
// nuxt.config.js
robots: [
{
// all environment
UserAgent: ['Googlebot', 'Bingbot'],
// disallow '/admin', only production
Disallow: () => (process.env.NODE_ENV !== 'production') ? [] : ['/admin']
}
]