nuxt-modules/robots

Not working on build with Nuxt 3

Saurou opened this issue · 1 comments

Using Nuxt 3.7.4 with robots.config.ts in root:

export default [
  { UserAgent: '*' },
  { Disallow: () => (process.env.ENVIRONMENT === 'staging' ? '/' : '') }
]

where ENVIRONMENT is declared on the .env file.

It works in dev mode, but does not generate robots.txt on build

I also tested

robots: {
  configPath: './robots.config'
}

in nuxt.config.ts, without success

Saurou commented

Update:

upgrading to 3.0.0-2 solved the issue

I was using 3.0.0-1 which was correctly generating robots.txt with generate, but not on build