const siteUrl = process.env.NUXT_SITE_URL; if (!siteUrl) { throw new Error(`NUXT_SITE_URL is not defined. Make sure to set it in your build environment variables.`); } const wpUrl = process.env.NUXT_WP_URL; if (!wpUrl) { throw new Error(`NUXT_WP_URL is not defined. Make sure to set it in your build environment variables.`); } // https://nuxt.com/docs/api/configuration/nuxt-config export default defineNuxtConfig({ modules: [ "@lewebsimple/nuxt-graphql", "@nuxt/eslint", "@nuxt/ui", "@nuxtjs/seo", "nuxt-auth-utils", ], components: { dirs: [ { path: "~/components", pathPrefix: false }, ], }, devtools: { enabled: true }, css: ["~/assets/css/_main.css"], site: { url: siteUrl, name: "WP Headless", defaultLocale: "fr", }, ui: { colorMode: false, }, compatibilityDate: "2026-01-01", nitro: { preset: "cloudflare_module", cloudflare: { deployConfig: true, nodeCompat: true, wrangler: { name: "foobar", compatibility_date: "2026-01-27", vars: { NODE_ENV: "production", NUXT_SITE_URL: siteUrl, NUXT_WP_URL: wpUrl, }, }, }, }, eslint: { config: { stylistic: { arrowParens: true, commaDangle: "always-multiline", indent: 2, quotes: "double", semi: true, }, }, }, graphql: { server: { context: ["server/graphql/context"], schema: { wp: { type: "remote", endpoint: `${wpUrl}/graphql`, hooks: ["server/graphql/wp-hooks"] }, }, }, }, robots: { sitemap: `${wpUrl}/sitemap_index.xml`, }, sitemap: false, });