// https://nuxt.com/docs/api/configuration/nuxt-config export default defineNuxtConfig({ ssr: true, nitro: { // 部署:`nuxt build` + Node.js 服务器(如 PM2);纯 SSR 模式,每次请求即时渲染 // 移除 prerender 路由列表——原静态化会把内容烘焙进 HTML,导致后台编辑不同步到前端。 // 仅保留 sitemap.xml 静态化。 prerender: { failOnError: false, crawlLinks: false, routes: ['/sitemap.xml'], }, }, css: ['~/assets/less/global.less'], vite: { css: { preprocessorOptions: { less: { additionalData: `@import "~/assets/less/variables.less"; @import "~/assets/less/mixins.less";`, }, }, }, }, app: { head: { htmlAttrs: { lang: 'zh-CN' }, charset: 'utf-8', viewport: 'width=device-width, initial-scale=1', link: [ { rel: 'icon', href: '/favicon.ico' }, { rel: 'apple-touch-icon', href: '/images/logo-square.png' }, { rel: 'dns-prefetch', href: 'https://beian.miit.gov.cn' }, ], meta: [ { name: 'applicable-device', content: 'pc,mobile' }, { 'http-equiv': 'Cache-Control', content: 'no-transform' }, // 内容语言 { 'http-equiv': 'content-language', content: 'zh-CN' }, // 品牌全局声明 - AI 大模型采集时的全局上下文 { name: 'application-name', content: '呼籁旅行' }, { name: 'theme-color', content: '#3a7d44' }, // 允许 AI 索引 { key: 'robots', name: 'robots', content: 'index, follow, max-snippet:-1, max-image-preview:large' }, ], }, }, runtimeConfig: { public: { apiBase: process.env.API_BASE || 'http://localhost:8000', }, }, build: { transpile: ['naive-ui', 'vueuc', '@css-render/vue3-ssr', 'css-render', '@tiptap/vue-3'], }, compatibilityDate: '2025-03-18', })