Blame view

nuxt.config.ts 1.71 KB
1
2
// https://nuxt.com/docs/api/configuration/nuxt-config
// Nuxt config file
3
import { defineNuxtConfig } from "nuxt/config";
4
5
6
7

export default defineNuxtConfig({
  app: {
    head: {
8
9
      link: [{ rel: "icon", type: "image/x-icon", href: "/fav.ico" }],
    },
10
  },
11
  css: ["~/assets/css/main.css"],
12
13
14
15
16
17
18
19
20
21
22
  postcss: {
    plugins: {
      tailwindcss: {},
      autoprefixer: {},
    },
  },
  // runtimeConfig: {
  //   public: {
  //      baseURL:  'http://47.89.254.121:8002/shop' || 'http://39.108.227.113:8002' // Exposed to the frontend as well.
  //   }
  // },
boyang authored
23
24
25
26
27
28
29
30
31
32
  modules: [
    "vuetify-nuxt-module",
    "@pinia/nuxt",
    "@nuxtjs/i18n",
    "@stefanobartoletti/nuxt-social-share",
  ],
  // optional configuration, should be added manually
  socialShare: {
    // module options
  },
33
34
35
36
37
38
  vuetify: {
    moduleOptions: {
      /* module specific options */
    },
    vuetifyOptions: {
      /* vuetify options */
39
    },
40
  },
41
  nitro: {
42
    devProxy: {
43
      "/shop": {
boyang authored
44
45
        target: "http://47.89.254.121:8002/shop", // 线上代理地址
        // target: "http://127.0.0.1:8002/shop",
46
47
        // target: process.env.BASE_URL || 'http://39.108.227.113:8002/shop', // 目标接口域名
        changeOrigin: true, // 表示是否跨域
48
      },
49
    },
50
51
52
    // 该配置用于服务端请求转发
    routeRules: {
      "/shop/**": {
boyang authored
53
54
        proxy: "http://47.89.254.121:8002/shop/**",
        // proxy: "http://127.0.0.1:8002/shop/**",
55
        // proxy: process.env.BASE_URL || 'http://39.108.227.113:8002/shop/**'
56
57
      },
    },
sanmu authored
58
59
60
  },
  i18n: {
    locales: [
61
62
      { code: "en", iso: "en-US", file: "en.json" },
      { code: "zh", iso: "zh-CN", file: "zh.json" },
sanmu authored
63
64
    ],
    lazy: true,
65
66
    langDir: "locales/",
    defaultLocale: "zh",
sanmu authored
67
  },
68
});