-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuno.config.ts
41 lines (39 loc) · 1.2 KB
/
uno.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
import { defineConfig, presetAttributify, presetIcons, presetUno, transformerDirectives } from 'unocss'
import { FileSystemIconLoader } from '@iconify/utils/lib/loader/node-loaders'
import shortcuts from './assets/unocss/shortcuts'
import theme from './assets/unocss/theme'
export default defineConfig({
/* 主题 */
theme,
/* 快捷方式 */
shortcuts,
/* 预设 */
presets: [
presetUno(),
presetAttributify(),
presetIcons({
collections: {
game: () => import('@iconify-json/game-icons/icons.json').then((i) => i.default),
simple: () => import('@iconify-json/simple-icons/icons.json').then((i) => i.default),
// 从本地文件加载自己的图标
ob: FileSystemIconLoader('./assets/icons', (svg) => svg.replace('#fff', 'currentColor'))
}
})
],
/* 文件提取 */
content: {
pipeline: {
include: [
// 默认
/\.(vue|svelte|[jt]sx|mdx?|astro|elm|php|phtml|html)($|\?)/,
// 自定义 (可以编写多个)
// 'components/**/*.{js,ts,vue}',
'composables/**/*.{js,ts}'
]
// 排除文件
// exclude: []
}
},
/* 指令转换器 */
transformers: [transformerDirectives()]
})