Blame view

nuxt.config.ts 2.36 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
  vuetify: {
    moduleOptions: {
      /* module specific options */
    },
    vuetifyOptions: {
38
39
40
41
42
43
44
45
46
      icons: {
        defaultSet: "mdi",
        // sets: [
        //   {
        //     name: "mdi",
        //     cdn: "/assets/css/materialdesignicons.min.css",
        //   },
        // ],
      },
47
      /* vuetify options */
48
    },
49
  },
50
  nitro: {
51
    devProxy: {
52
      "/shop": {
53
54
        //target: "http://47.89.254.121:8002/shop", // 线上代理地址
        target: "http://127.0.0.1:8002/shop",
55
56
        // target: process.env.BASE_URL || 'http://39.108.227.113:8002/shop', // 目标接口域名
        changeOrigin: true, // 表示是否跨域
57
      },
58
59
60
61
62
63
      "/mshop": {
        target: "http://www.canrd.com/mshop",
        // proxy: "http://127.0.0.1:8002/shop/**",
        // proxy: process.env.BASE_URL || 'http://39.108.227.113:8002/shop/**'
        changeOrigin: true, // 表示是否跨域
      },
64
    },
65
66
67
    // 该配置用于服务端请求转发
    routeRules: {
      "/shop/**": {
68
69
        //proxy: "http://47.89.254.121:8002/shop/**",
        proxy: "http://127.0.0.1:8002/shop/**",
70
        // proxy: process.env.BASE_URL || 'http://39.108.227.113:8002/shop/**'
71
      },
72
73
74
75
76
77

      "/mshop/**": {
        proxy: "http://www.canrd.com/mshop/**",
        // proxy: "http://127.0.0.1:8002/shop/**",
        // proxy: process.env.BASE_URL || 'http://39.108.227.113:8002/shop/**'
      },
78
    },
sanmu authored
79
80
81
  },
  i18n: {
    locales: [
82
83
      { code: "en", iso: "en-US", file: "en.json" },
      { code: "zh", iso: "zh-CN", file: "zh.json" },
sanmu authored
84
85
    ],
    lazy: true,
86
87
    langDir: "locales/",
    defaultLocale: "zh",
sanmu authored
88
  },
89
});