-
Notifications
You must be signed in to change notification settings - Fork 1
/
unocss.config.ts
56 lines (55 loc) · 1.35 KB
/
unocss.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
import { FileSystemIconLoader } from '@iconify/utils/lib/loader/node-loaders';
import { presetWeapp } from 'unocss-preset-weapp';
import { transformerClass } from 'unocss-preset-weapp/transformer';
import { defineConfig, presetIcons, transformerDirectives } from 'unocss';
export default defineConfig({
presets: [
presetWeapp({
// h5兼容
isH5: process.env.TARO_ENV === 'h5',
platform: 'taro',
taroWebpack: 'webpack5',
}),
presetIcons({
scale: 1,
warn: true,
extraProperties: {
display: 'inline-block',
},
collections: {
local: FileSystemIconLoader('./src/assets/icons'),
},
}),
],
shortcuts: [
{
'flex-center': 'flex justify-center items-center',
'flex-justify': 'flex justify-center',
'flex-align': 'flex items-center',
'border-bottom': 'border-b-[2rpx] border-b-solid border-b-[#f5f5f5]',
'border-all': 'border-[2rpx] border-solid border-[#f5f5f5]',
},
],
transformers: [
transformerClass(),
transformerDirectives({
enforce: 'pre',
}),
],
content: {
pipeline: {
include: [/\.([jt]sx|css)($|\?)/],
exclude: [
'node_modules',
'.git',
'.husky',
'.vscode',
'dist',
'public',
'build',
'mock',
'./stats.html',
],
},
},
});