-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnuxt.config.ts
151 lines (143 loc) · 4.28 KB
/
nuxt.config.ts
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
//devtools: { enabled: true },
ssr: true, //不为true不会触发api请求
experimental:{payloadExtraction:false},
app: {
head: {
charset: 'utf-8',
viewport: 'width=device-width, initial-scale=1',
meta: [
{ name: 'facebook-domain-verification', content: 'z7pujkh9nnmwrhgrofcm6p308glvub' },
{ 'http-equiv': 'Pragma', content: 'no-cache' },
{ name: 'X-UA-Compatible', content: 'IE=edge,Chrome=1' },
{ name: 'viewport', content: 'width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no' },
],
},
},
modules: [
// pinia plugin
'@nuxtjs/harlem',
'@nuxtjs/robots',
'nuxt-simple-sitemap',
'@pinia/nuxt',
'@nuxtjs/harlem',
'nuxt-lodash',
'@nuxtjs/tailwindcss',
//'@nuxt-alt/proxy',
'nuxt-proxy-request',
'@tailwindcss/forms',
'blueblocksui-banner/nuxt',
'blueblocksui-breadcrumb/nuxt',
'blueblocksui-button/nuxt',
'blueblocksui-card/nuxt',
'blueblocksui-carousel/nuxt',
'blueblocksui-category-filters/nuxt',
'blueblocksui-comment/nuxt',
'blueblocksui-dialog/nuxt',
'blueblocksui-footer/nuxt',
'blueblocksui-header/nuxt',
'blueblocksui-headings/nuxt',
'blueblocksui-pagination/nuxt',
'blueblocksui-tabs/nuxt',
'blueblocksui-layouts/nuxt',
'blueblocksui-comment-list/nuxt',
'blueblocksui-paragraph/nuxt',
'blueblocksui-product-detail/nuxt',
'blueblocksui-tag/nuxt',
'blueblocksui-suspension/nuxt',
'blueblocksui-mobile-footer/nuxt',
'blueblocksui-mobile-header/nuxt'
],
//plugins:['~/plugins/globalpinia'],
runtimeConfig: {
public: {},
proxy: {
options: [
{
target: 'http://f.lgl.lb.in:8080/vueapi',
pathFilter: ['/api/**'],
pathRewrite: {
'^/api': ''
}
}
]
}
// proxy:{
// proxies:{
// '^/api/.*': {
// target: 'http://f.lgl.lb.in:8080/vueapi/',
// changeOrigin: true,
// rewrite: (path) => path.replace(/^\/api/, '')
// }
// }
// }
},
lodash: {
prefix: "use",
prefixSkip: ["is"],
upperAfterPrefix: true,
exclude: [""],
alias: [
["camelCase", "stringToCamelCase"], // => stringToCamelCase
["kebabCase", "stringToKebab"], // => stringToKebab
["isDate", "isLodashDate"], // => _isLodashDate
],
},
imports: {
dirs: ['./stores'],
},
pinia: {
autoImports: ['defineStore', 'acceptHMRUpdate', 'storeToRefs', 'mapStores', 'getActivePinia'],
},
// routeRules:{
// '/shop/carbon-accessories/**': { cors: true },
// '/shop/carbon-BMX-bike/**': { cors: true },
// '/shop/carbon-fat-bike/**': { cors: true },
// '/shop/carbon-mountain-bike/**': { cors: true },
// '/shop/carbon-road-bike/**': { cors: true },
// '/shop/carbon-road-gravel-cx-disc-bike/**': { cors: true },
// '/shop/carbon-tri-time-trial-track-bike/**': { cors: true },
// },
// nitro: {
// logLevel:1,
// errorHandler: "~/error"
// // rollupConfig: {
// // // external: ['ali-oss'],
// // include: 'node_modules/blueblocksui**',
// // },
// },
nitro: {
logLevel: 4,
//dev:false,
prerender: {
//baseURL: "http://localhost:3000",
crawlLinks: true,
// routes: ['/', 'sitemap.xml'],
// ignore: ['/tak', '/konfiguration', '/checkout'],
failOnError:false
},
},
//站点地图的配置
sitemap: {
siteUrl: 'http://192.168.130.139:3000',
},
//如果出现这个情况,你可以在nuxt配置中的build.transpile选择中添加你依赖的库,这个就告诉nuxt不要尝试导入这些库。
build: {
transpile: [/blueblocksui/] //是一个正则
// process.env.NODE_ENV !== "production"
// ? [
// "blueblocksui-footer",
// ]
// : [],
},
// localization - i18n config ,nuxt-awesome-starter
intlify: {
localeDir: 'locales',
vueI18n: {
locale: 'en',
fallbackLocale: 'en',
availableLocales: ['en', 'id', 'ja', 'ko'],
},
},
})