-
-
Notifications
You must be signed in to change notification settings - Fork 104
/
Copy pathvalaxy.config.ts
50 lines (46 loc) · 1.23 KB
/
valaxy.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
import type { ResolvedValaxyOptions } from 'valaxy'
import type { Plugin } from 'vite'
import type { ThemeConfig } from './types'
import { defineTheme } from 'valaxy'
import { defaultThemeConfig, generateSafelist } from './index'
function ThemeVitePlugin(options: ResolvedValaxyOptions<ThemeConfig>): Plugin {
const themeConfig = options?.config.themeConfig || {}
return {
name: 'valaxy-theme-yun',
enforce: 'pre',
config() {
return {
css: {
preprocessorOptions: {
scss: {
additionalData: `$c-primary: ${themeConfig.colors?.primary || '#0078E7'} !default;`,
},
},
},
optimizeDeps: {
include: [
'@ctrl/tinycolor',
'gsap',
'gsap/dist/ScrollToPlugin',
'@explosions/fireworks',
'@vueuse/motion',
'primevue/toastservice',
'primevue/config',
],
exclude: ['@docsearch/js'],
},
}
},
}
}
export default defineTheme<ThemeConfig>((options) => {
return {
themeConfig: defaultThemeConfig,
vite: {
plugins: [ThemeVitePlugin(options)],
},
unocss: {
safelist: generateSafelist(options),
},
}
})