Blame view

nuxt.config.ts 3.15 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": {
boyang authored
59
60
        // target: 'http://192.168.31.242:20740/',
        target: "http://47.89.254.121:8002/shop", // 线上代理地址
boyang authored
61
        // target: "http://127.0.0.1:8002/shop",
62
63
        // target: process.env.BASE_URL || 'http://39.108.227.113:8002/shop', // 目标接口域名
        changeOrigin: true, // 表示是否跨域
64
      },
65
      "/email": {
boyang authored
66
67
        // target: 'http://192.168.31.242:20740/',
        target: "http://47.89.254.121:8002/email", // 线上代理地址
boyang authored
68
        // target: "http://127.0.0.1:8002/shop",
69
70
71
        // target: process.env.BASE_URL || 'http://39.108.227.113:8002/shop', // 目标接口域名
        changeOrigin: true, // 表示是否跨域
      },
72
73
      "/api/front/cal": {
        target: "http://www.canrd.com/mshop/api/front/cal",
74
75
76
77
        // proxy: "http://127.0.0.1:8002/shop/**",
        // proxy: process.env.BASE_URL || 'http://39.108.227.113:8002/shop/**'
        changeOrigin: true, // 表示是否跨域
      },
78
    },
79
80
81
    // 该配置用于服务端请求转发
    routeRules: {
      "/shop/**": {
boyang authored
82
83
        // proxy: 'http://192.168.31.242:20740/',
        proxy: "http://47.89.254.121:8002/shop/**",
boyang authored
84
        // proxy: "http://127.0.0.1:8002/shop/**",
85
        // proxy: process.env.BASE_URL || 'http://39.108.227.113:8002/shop/**'
86
      },
87
      "/email/**": {
boyang authored
88
89
        // proxy: 'http://192.168.31.242:20740/',
        proxy: "http://47.89.254.121:8002/email/**",
boyang authored
90
        // proxy: "http://127.0.0.1:8002/shop/**",
91
92
        // proxy: process.env.BASE_URL || 'http://39.108.227.113:8002/shop/**'
      },
93
94
95
      "/api/front/cal/**": {
        proxy: "http://www.canrd.com/mshop/api/front/cal/**",
96
97
98
        // proxy: "http://127.0.0.1:8002/shop/**",
        // proxy: process.env.BASE_URL || 'http://39.108.227.113:8002/shop/**'
      },
99
    },
sanmu authored
100
  },
101
sanmu authored
102
103
  i18n: {
    locales: [
104
105
      { code: "en", iso: "en-US", file: "en.json" },
      { code: "zh", iso: "zh-CN", file: "zh.json" },
sanmu authored
106
107
    ],
    lazy: true,
108
109
    langDir: "locales/",
    defaultLocale: "zh",
sanmu authored
110
  },
111
112

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