nuxt.config.ts
3.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
// https://nuxt.com/docs/api/configuration/nuxt-config
// Nuxt config file
import { defineNuxtConfig } from "nuxt/config";
export default defineNuxtConfig({
app: {
head: {
link: [{ rel: "icon", type: "image/x-icon", href: "/fav.ico" }],
},
},
css: ["~/assets/css/main.css"],
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.
// }
// },
modules: [
"vuetify-nuxt-module",
"@pinia/nuxt",
"@nuxtjs/i18n",
"@stefanobartoletti/nuxt-social-share",
],
// optional configuration, should be added manually
socialShare: {
// module options
},
vuetify: {
moduleOptions: {
/* module specific options */
},
vuetifyOptions: {
icons: {
defaultSet: "mdi",
// sets: [
// {
// name: "mdi",
// cdn: "/assets/css/materialdesignicons.min.css",
// },
// ],
},
/* vuetify options */
},
},
nitro: {
devProxy: {
"/shop": {
target: 'http://192.168.31.242:20740/',
// target: "http://47.89.254.121:8002/shop", // 线上代理地址
// target: "http://127.0.0.1:8002/shop",
// target: process.env.BASE_URL || 'http://39.108.227.113:8002/shop', // 目标接口域名
changeOrigin: true, // 表示是否跨域
},
"/email": {
target: 'http://192.168.31.242:20740/',
// 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, // 表示是否跨域
},
"/api/front/cal": {
target: "http://www.canrd.com/mshop/api/front/cal",
// proxy: "http://127.0.0.1:8002/shop/**",
// proxy: process.env.BASE_URL || 'http://39.108.227.113:8002/shop/**'
changeOrigin: true, // 表示是否跨域
},
},
// 该配置用于服务端请求转发
routeRules: {
"/shop/**": {
proxy: 'http://192.168.31.242:20740/',
// proxy: "http://47.89.254.121:8002/shop/**",
// proxy: "http://127.0.0.1:8002/shop/**",
// proxy: process.env.BASE_URL || 'http://39.108.227.113:8002/shop/**'
},
"/email/**": {
proxy: 'http://192.168.31.242:20740/',
// 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/**'
},
"/api/front/cal/**": {
proxy: "http://www.canrd.com/mshop/api/front/cal/**",
// proxy: "http://127.0.0.1:8002/shop/**",
// proxy: process.env.BASE_URL || 'http://39.108.227.113:8002/shop/**'
},
},
},
i18n: {
locales: [
{ code: "en", iso: "en-US", file: "en.json" },
{ code: "zh", iso: "zh-CN", file: "zh.json" },
],
lazy: true,
langDir: "locales/",
defaultLocale: "zh",
},
compatibilityDate: "2024-12-30",
});