Closed Saurou closed 1 year ago
Using Nuxt 3.7.4 with robots.config.ts in root:
Nuxt 3.7.4
robots.config.ts
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
nuxt.config.ts
Update:
upgrading to 3.0.0-2 solved the issue
3.0.0-2
I was using 3.0.0-1 which was correctly generating robots.txt with generate, but not on build
3.0.0-1
generate
build
Using
Nuxt 3.7.4
withrobots.config.ts
in root:where ENVIRONMENT is declared on the .env file.
It works in dev mode, but does not generate robots.txt on build
I also tested
in
nuxt.config.ts
, without success