-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnuxt.config.ts
43 lines (41 loc) · 1.02 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
import Components from 'unplugin-vue-components/vite';
import { AntDesignVueResolver } from 'unplugin-vue-components/resolvers';
export default defineNuxtConfig({
modules: ['@unocss/nuxt', '@pinia/nuxt'],
experimental: {
reactivityTransform: true,
},
vite: {
plugins: [
Components({
resolvers: [AntDesignVueResolver({ importStyle: 'less', resolveIcons: true })],
}),
],
css: {
preprocessorOptions: {
less: {
javascriptEnabled: true,
}
}
},
// 指定哪些插件不使用ssr渲染
ssr: {
noExternal: [
'moment',
'compute-scroll-into-view',
'ant-design-vue',
'lodash-es',
'dayjs',
],
},
},
// ant-design-vue 源码底层使用了dayjs,打包时更改为es6 module模块
alias: {
dayjs: 'dayjs/esm/',
},
build: {
// 禁用指定的打包优化,本地启动需要删除@babel/runtime
transpile: ['lodash-es', '@babel/runtime'],
// transpile: ['lodash-es'],
},
});