diff --git a/next-sitemap.js b/next-sitemap.js index 8e9424b1..e039f37c 100644 --- a/next-sitemap.js +++ b/next-sitemap.js @@ -21,8 +21,11 @@ module.exports = { generateIndexSitemap: false, sitemapSize: 7000, generateRobotsTxt: true, - robosTxtOptions: { - policies: [{ userAgent: '*', allow: '/' }], + robotsTxtOptions: { + policies: + environment === 'production' + ? [{ userAgent: '*', allow: '/' }] + : [{ userAgent: '*', disallow: '/' }], }, // Adds path as it doesn't support dynamic routes.