-
Notifications
You must be signed in to change notification settings - Fork 0
/
nuxt.config.js
124 lines (123 loc) · 2.18 KB
/
nuxt.config.js
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
// nuxt.config.js
module.exports = {
/**
* Nuxt 2.13.0 后会收集有关常规用法的匿名遥测数据
* 在开发环境下每次启动都会有提示,telemetry 选项可以让我们关闭它
*/
telemetry: false,
/**
* 设定源码目录
*/
srcDir: 'web',
/**
* 忽略选项
*/
ignoreOptions: {
ignorecase: false
},
/**
* 页面 Loading 条设置
*/
loading: {
color: '#00c58e',
height: '2px'
},
/**
* 加载 Style 样式
*/
css: [
'~/assets/less/common.less',
'~/assets/iconfont/iconfont.css'
],
/**
* 加载插件
*/
plugins: [
{ src: '~/plugins/client', ssr: false },
{ src: '~/plugins/element-ui', ssr: true },
{ src: '~/plugins/klelment', ssr: false }
],
/**
* 配置组件
*/
components: [
'~/components'
],
// 装载模块
modules: [
'@unocss/nuxt'
],
// Unocss 设置
unocss: {
// presets
uno: true,
icons: true,
attributify: true,
wind: true,
webFonts: true,
// core options
shortcuts: [],
rules: [],
},
/**
* 加载编译模块
*/
buildModules: [
'@nuxt/typescript-build',
'@nuxt/components'
],
/**
* 编译配置
*/
build: {
babel: {
plugins: [
['component', {
libraryName: 'element-ui',
styleLibraryName: 'theme-chalk'
}],
['@babel/plugin-proposal-private-methods', { loose: true }]
],
comments: true
},
postcss: false,
splitChunks: {
commons: true,
layouts: true,
pages: true
},
optimization: {
runtimeChunk: 'single',
splitChunks: {
chunks: 'all',
maxSize: 307200,
maxAsyncRequests: 7,
cacheGroups: {
elementui: {
test: /node_modules[\\/]element-ui/,
chunks: 'all',
priority: 20,
name: true
}
}
}
}
},
/**
* 映射路径
*/
alias: {
'@': __dirname
},
/**
* 路由配置
*/
router: {
extendRoutes (routes, resolve) {
routes.push({
path: '/*',
component: resolve(__dirname, 'web/pages/_auto/_page.vue')
})
}
}
}