-
Notifications
You must be signed in to change notification settings - Fork 31
/
nuxt.config.ts
111 lines (108 loc) · 2.51 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
import Components from 'unplugin-vue-components/vite'
import { AntDesignVueResolver } from 'unplugin-vue-components/resolvers'
import prismjs from 'vite-plugin-prismjs'
// const isProduction = process.env.NODE_ENV === 'production'
export default defineNuxtConfig({
app: {
head: {
title: '开源博客 - helloworld',
meta: [
{ name: 'keywords', content: '开源博客,helloworld' },
{ name: 'description', content: '开源博客 - helloworld' }
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
{
rel: 'stylesheet',
href: '//at.alicdn.com/t/c/font_3420979_f6dbhdrnbpu.css'
}
]
// script: [{ src: 'https://at.alicdn.com/t/font_3420979_o8r3ia8tx4c.js' }]
}
},
modules: ['@element-plus/nuxt', '@pinia/nuxt', '@pinia-plugin-persistedstate/nuxt',],
elementPlus: {
directives: {
InfiniteScroll: 'ElInfiniteScroll'
}
},
build: {},
//vite只能用 ant-design-vue/es 而非 ant-design-vue/lib
css: [
'ant-design-vue/es/message/style/css',
'@/assets/less/style.less'
// '@/assets/less/iconfont.less'
],
postcss: {
plugins: {
autoprefixer: {}
}
},
vite: {
logLevel: 'info',
optimizeDeps: {
include: ['vue', 'pinia', 'ufo']
},
server: {
hmr: true,
watch: {
usePolling: true //set here to enable hot reload
}
},
css: {
preprocessorOptions: {
less: {
modifyVars: {
'primary-color': '#0AA679'
},
javascriptEnabled: true
}
}
},
plugins: [
Components({
resolvers: [AntDesignVueResolver(), ]
}),
prismjs({
languages: [
'js',
'javascript',
'html',
'xml',
'css',
'bash',
'dart',
'dockerfile',
'go',
'kotlin',
'lua',
'markdown',
'nginx',
'php',
'python',
'ruby',
'shell',
'sql',
'swift',
'vim',
'yaml'
]
})
],
// @ts-expect-error: Missing ssr key
ssr: {
noExternal: ['compute-scroll-into-view', 'ant-design-vue']
}
},
runtimeConfig: {
public: {
BASE_URL: process.env.BASE_URL + '/api',
}
}
// autoImports: {
// global: false //關掉的話更新跑的比較快
// },
// components: {
// global: false //關掉的話更新跑的比較快
// }
})