-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathvite.config.ts
More file actions
38 lines (36 loc) · 1.03 KB
/
vite.config.ts
File metadata and controls
38 lines (36 loc) · 1.03 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
import { fileURLToPath, URL } from 'node:url'
import Uni from '@uni-helper/plugin-uni'
import Components from '@uni-helper/vite-plugin-uni-components'
import { uViewProResolver, ZPagingResolver } from '@uni-helper/vite-plugin-uni-components/resolvers'
import UniRoot from '@uni-ku/root'
import UnoCSS from 'unocss/vite'
import { defineConfig } from 'vite'
export default defineConfig({
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
plugins: [
// https://github.com/uni-ku/root
UniRoot(),
// https://uni-helper.js.org/vite-plugin-uni-components
Components({
dts: true,
resolvers: [ZPagingResolver(), uViewProResolver()],
}),
// https://uni-helper.js.org/plugin-uni
Uni(),
UnoCSS(),
],
css: {
preprocessorOptions: {
scss: {
additionalData: '@import "uview-pro/theme.scss";',
},
},
},
optimizeDeps: {
exclude: process.env.UNI_PLATFORM === 'h5' && process.env.NODE_ENV === 'development' ? ['uview-pro'] : [],
},
})