-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.ts
62 lines (60 loc) · 1.48 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import { type PluginOption, defineConfig } from 'vite'
import typescript from '@rollup/plugin-typescript'
import { compileLitTemplates } from '@lit-labs/compiler'
import UnoCSS from 'unocss/vite'
import {
presetAttributify,
presetTagify,
presetUno,
presetIcons,
presetTypography,
transformerCompileClass,
transformerVariantGroup
} from 'unocss'
import template from 'rollup-plugin-html-literals'
export const plugins = [
typescript({
declaration: true,
transformers: {
before: [compileLitTemplates()]
},
}) as PluginOption,
UnoCSS({
mode: 'shadow-dom',
presets: [
presetAttributify(),
presetTagify(),
presetUno({ dark: 'media' }),
presetIcons({ prefix: 'i-', scale: 1.5 }),
presetTypography()
],
transformers: [
transformerCompileClass({ classPrefix: 'seia-' }),
transformerVariantGroup()
],
theme: {
colors: {
seia: {
bg: 'var(--seia-color-bg, #f8fafc)', // slate-50
text: 'var(--seia-color-text, #0f172a)', // slate-900
primary: 'var(--seia-color-primary, #ea580c)' // orange-600
}
},
borderRadius: {
avatar: 'var(--seia-rounded-avatar, 8964px)', // rounded-full
card: 'var(--seia-rounded-card, 0.75rem)' // rounded-xl
}
}
}),
template(),
]
export default defineConfig({
build: {
lib: {
entry: 'src/seia.ts',
formats: ['es']
}
},
esbuild: { legalComments: 'external' },
plugins,
})