nuxt.config.ts 3.3 KB
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  ssr: true,
  runtimeConfig: {
    public: {
      baseUrl: process.env.NUXT_BASE_URL,
      apiUrl: process.env.NUXT_API_URL,
    }
  },
  devtools: { enabled: false },
  modules: [
    '@nuxtjs/tailwindcss',
    '@element-plus/nuxt'
  ],
  tailwindcss: {
    cssPath: '~/assets/css/tailwind.css',
    config: {
      darkMode: 'class',
      content: [
        './components/**/*.{js,vue,ts}',
        './layouts/**/*.vue',
        './pages/**/*.vue',
        './plugins/**/*.{js,ts}',
        './app.vue',
      ],
      theme: {
        extend: {},
      },
    }
  },
  features: {
    inlineStyles: false,
    devLogs: false,
  },
  devServer: {
    host: 'localhost',
    port: 3666
  },
  nitro: {
    compressPublicAssets: false,
    devProxy: {
      '/dev-api': {
        // target: 'http://192.168.2.15:35273/',
        target: 'http://htai.aiboxgo.com/',
        changeOrigin: true,
        
      }
    },
    // 该配置用于服务端请求转发
    routeRules: {
      '/dev-api/**': {
        // proxy: 'http://192.168.2.15:35273/**'
        proxy: 'http://htai.aiboxgo.com/**'
      },
    },
    prerender: {
      routes: ['/sitemap.xml'],
      // 从预渲染中排除 sitemap.xml,让它动态生成
      ignore: ['/sitemap.xml']
    },
  },
  css: [
    '~/assets/iconfonts/iconfont.css',
  ],
  plugins: [
    { src: '~/assets/iconfonts/iconfont.ts', ssr: false, mode: 'client' }
  ],
  app: {
    head: {
      title: 'Annie网站 - 优质 AI 工具集合、AI 资源网站、AI 导航平台',
      titleTemplate: '%s | Annie网站',
      htmlAttrs: {
        lang: 'zh-CN'
      },
      meta: [
        { charset: 'utf-8' },
        { name: "renderer", content: "webkit"},
        { name: "force-rendering", content: "webkit"},
        { "http-equiv":"X-UA-Compatible", content:"IE=edge, chrome=1" },
        { name: 'viewport', content:"width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" },
        { name: 'description', content: 'Annie网站是专业的AI工具导航平台,汇集全网优质AI工具,包含AI写作、AI绘画、AI视频、AI对话、AI代码、AI设计、AI办公等各类AI资源,让你快速找到好用的AI工具。' },
        { name: 'keywords', content: 'AI工具,AI导航,AI资源,AI写作,AI绘画,AI视频,AI对话,ChatGPT,AI代码,AI设计,人工智能工具' },
        { name: 'author', content: 'Annie网站' },
        { name:'robots', content:'index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1'},
        { name: 'googlebot', content: 'index, follow' },
        { name: 'format-detection', content: 'telephone=no' },
        { name: 'referrer', content: 'origin-when-cross-origin' },
        { property: 'og:type', content: 'website' },
        { property: 'og:site_name', content: 'Annie网站' },
        { property: 'og:locale', content: 'zh_CN' },
        { property: 'twitter:card', content: 'summary_large_image' },
        { property: 'twitter:site', content: '@Annie网站' }
      ],
      link: [
        { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
        { rel: 'canonical', href: 'https://aiboxgo.com/' }
      ],
      script: [{ src: "/js/translate.js"}]
    },
    rootId: 'annie',
  },
  build: {
    transpile: []
  }
})