nuxt-modules / robots

Tame the robots crawling and indexing your Nuxt site.
https://nuxtseo.com/robots
MIT License
424 stars 34 forks source link

fix: route is prerendered even for ssr build #76

Closed dargmuesli closed 2 years ago

dargmuesli commented 2 years ago

Currently a built nuxt page using this module has its robots.txt prerendered. That means that e.g. a Sitemap: (req) => ...req.headers.host... function has its host set to localhost at build time and does not allow dynamic content at deployment.

In PR #75 I changed that behavior to only prerender the route for target: static. I added tests to ensure no unwanted regressions.

slavco86 commented 2 years ago

👍 Bumping the issue - facing this problem as well. Running SSR Nuxt 3 and build command prerenders robots.txt, resulting in in correct Sitemap behaviour

dargmuesli commented 2 years ago

Just add a :+1: to the first post to show your support! :clap: