Closed Whyjsee closed 5 days ago
When I set nitro.preset to cloudflare-pages in nuxt.config.ts and run pnpm run build, the output does not include robots.txt. Only when nitro.preset is set to static does the robots.txt get generated. Does anyone know how to solve this issue?
nitro.preset
cloudflare-pages
nuxt.config.ts
pnpm run build
robots.txt
static
Here's my nuxt.config.ts
// https://nuxt.com/docs/api/configuration/nuxt-config export default defineNuxtConfig({ devtools: { enabled: true }, srcDir: 'src/', nitro: { // preset: 'static', preset: 'cloudflare-pages', output: { dir: 'dist' }, }, modules: ['@nuxtjs/robots'], robots: { enabled: true, allow: ['/aaa'], disallow: [ '/user', '/login' ] }, future: { compatibilityVersion: 3 }, compatibilityDate: '2024-09-19' })
No response
Nuxt project info: (copied to clipboard) 5:04:44 PM ------------------------------ - Operating System: Darwin - Node Version: v20.6.1 - Nuxt Version: 3.14.1592 - CLI Version: 3.15.0 - Nitro Version: 2.10.4 - Package Manager: pnpm@9.0.4 - Builder: - - User Config: default - Runtime Modules: @nuxtjs/i18n@9.1.0, @nuxtjs/robots@4.1.11, @nuxtjs/sitemap@6.1.5 - Build Modules: - ------------------------------ 5:04:44 PM 👉 Report an issue: https://github.com/nuxt/nuxt/issues/new?template=bug-report.yml 👉 Suggest an improvement: https://github.com/nuxt/nuxt/discussions/new 👉 Read documentation: https://nuxt.com
Describe the bug
When I set
nitro.preset
tocloudflare-pages
innuxt.config.ts
and runpnpm run build
, the output does not includerobots.txt
. Only whennitro.preset
is set tostatic
does therobots.txt
get generated. Does anyone know how to solve this issue?Here's my nuxt.config.ts
Reproduction
No response
System / Nuxt Info