nuxt.config.ts
1.5 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
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
runtimeConfig: {
public: {
baseUrl: process.env.NUXT_API_URL,
}
},
devtools: { enabled: true },
modules: [
'@nuxtjs/tailwindcss',
'@element-plus/nuxt'
],
devServer: {
host: 'localhost',
port: 3000
},
nitro: {
devProxy: {
'/dev-api': {
target: 'http://htai.toolsai.cc/',
changeOrigin: true,
}
},
// 该配置用于服务端请求转发
routeRules: {
'/dev-api/**': {
proxy: 'http://htai.toolsai.cc/**'
},
},
prerender: {
routes: ['/sitemap.xml'],
// 从预渲染中排除 sitemap.xml,让它动态生成
ignore: ['/sitemap.xml']
}
},
css: [
'~/assets/iconfonts/iconfont.css',
],
plugins: [
{ src: '~/assets/iconfonts/iconfont.ts', ssr: false, mode: 'client' }
],
app: {
head: {
title: 'Annie网站',
htmlAttrs: {
lang: 'en'
},
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: '提供市面上最简洁的导航系统' },
{ name: 'format-detection', content: 'telephone=no' },
{ name: 'keywords', content: '提供市面上最简洁的导航系统,一个完全免费的导航站'}
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
]
}
},
})