Blame view

nuxt.config.ts 2.95 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
12
  css: ["~/assets/css/main.css"],
13
14
15
16
17
18
19
  postcss: {
    plugins: {
      tailwindcss: {},
      autoprefixer: {},
    },
  },
20
21
22
23
24
25
  // runtimeConfig: {
  //   public: {
  //      baseURL:  'http://47.89.254.121:8002/shop' || 'http://39.108.227.113:8002' // Exposed to the frontend as well.
  //   }
  // },
boyang authored
26
27
28
29
30
31
  modules: [
    "vuetify-nuxt-module",
    "@pinia/nuxt",
    "@nuxtjs/i18n",
    "@stefanobartoletti/nuxt-social-share",
  ],
32
boyang authored
33
34
35
36
  // optional configuration, should be added manually
  socialShare: {
    // module options
  },
37
38
39
40
41
42
  vuetify: {
    moduleOptions: {
      /* module specific options */
    },
    vuetifyOptions: {
43
44
45
46
47
48
49
50
51
      icons: {
        defaultSet: "mdi",
        // sets: [
        //   {
        //     name: "mdi",
        //     cdn: "/assets/css/materialdesignicons.min.css",
        //   },
        // ],
      },
52
      /* vuetify options */
53
    },
54
  },
55
56
  nitro: {
57
    devProxy: {
58
      "/shop": {
59
60
        target: "http://47.89.254.121:8002/shop", // 线上代理地址
        // target: "http://127.0.0.1:8002/shop",
61
62
        // target: process.env.BASE_URL || 'http://39.108.227.113:8002/shop', // 目标接口域名
        changeOrigin: true, // 表示是否跨域
63
      },
64
65
66
67
68
69
      "/email": {
        target: "http://47.89.254.121:8002/email", // 线上代理地址
        // target: "http://127.0.0.1:8002/shop",
        // target: process.env.BASE_URL || 'http://39.108.227.113:8002/shop', // 目标接口域名
        changeOrigin: true, // 表示是否跨域
      },
70
71
      "/api/front/cal": {
        target: "http://www.canrd.com/mshop/api/front/cal",
72
73
74
75
        // proxy: "http://127.0.0.1:8002/shop/**",
        // proxy: process.env.BASE_URL || 'http://39.108.227.113:8002/shop/**'
        changeOrigin: true, // 表示是否跨域
      },
76
    },
77
78
79
    // 该配置用于服务端请求转发
    routeRules: {
      "/shop/**": {
80
81
        proxy: "http://47.89.254.121:8002/shop/**",
        // proxy: "http://127.0.0.1:8002/shop/**",
82
        // proxy: process.env.BASE_URL || 'http://39.108.227.113:8002/shop/**'
83
      },
84
85
86
87
88
      "/email/**": {
        proxy: "http://47.89.254.121:8002/email/**",
        // proxy: "http://127.0.0.1:8002/shop/**",
        // proxy: process.env.BASE_URL || 'http://39.108.227.113:8002/shop/**'
      },
89
90
91
      "/api/front/cal/**": {
        proxy: "http://www.canrd.com/mshop/api/front/cal/**",
92
93
94
        // proxy: "http://127.0.0.1:8002/shop/**",
        // proxy: process.env.BASE_URL || 'http://39.108.227.113:8002/shop/**'
      },
95
    },
sanmu authored
96
  },
97
sanmu authored
98
99
  i18n: {
    locales: [
100
101
      { code: "en", iso: "en-US", file: "en.json" },
      { code: "zh", iso: "zh-CN", file: "zh.json" },
sanmu authored
102
103
    ],
    lazy: true,
104
105
    langDir: "locales/",
    defaultLocale: "zh",
sanmu authored
106
  },
107
108

  compatibilityDate: "2024-12-30",
109
});