-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
47 lines (46 loc) · 1.12 KB
/
vite.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
import { defineConfig } from 'vite'
import nested from 'tailwindcss/nesting'
import tailwindcss from 'tailwindcss'
import tailwindcssConfig from './tailwind.config.ts'
import postcssPresetEnv from 'postcss-preset-env'
import uni from '@dcloudio/vite-plugin-uni'
import autoImport from 'unplugin-auto-import/vite'
import uniTailwind from '@uni-helper/vite-plugin-uni-tailwind'
import { isMp } from '@uni-helper/uni-env'
// https://vitejs.dev/config/
export default defineConfig({
css: {
postcss: {
plugins: [
nested(),
tailwindcss({
config: tailwindcssConfig,
}),
postcssPresetEnv({
stage: 3,
features: { 'nesting-rules': false },
}),
],
},
},
plugins: [
uni(),
uniTailwind({
shouldApply: isMp, // 编译小程序需要设置
}),
autoImport({
include: [/\.vue$/, /\.vue\?vue/],
imports: [
'vue',
'uni-app',
'pinia',
],
eslintrc: {
enabled: false,
filepath: './.eslintrc-auto-import.json',
globalsPropValue: true,
},
dts: true,
}),
],
})