-
Notifications
You must be signed in to change notification settings - Fork 357
/
Copy pathmodule.ts
41 lines (35 loc) · 1.09 KB
/
module.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 { defineNuxtModule } from '@nuxt/kit'
import { useVuesticCSS } from './composables/use-css'
import { useVuesticPlugin } from './composables/use-plugin'
import { useVuesticComposables } from './composables/use-composables'
import { useVuesticComponents } from './composables/use-components'
import { useTranspile } from './composables/use-transpile'
import { useConfigFile } from './composables/use-config-file'
import type { VuesticOptions } from './types'
const VUESTIC_DEFAULT_CSS = ['smart-helpers', 'typography'] as VuesticOptions['css']
export default defineNuxtModule<VuesticOptions>({
meta: {
name: '@vuestic/nuxt',
configKey: 'vuestic',
compatibility: {
nuxt: '>=3.3.0'
}
},
defaults: {
config: {},
css: [],
fonts: true,
themeCookieKey: 'vuestic-theme'
},
setup (options) {
if (Array.isArray(options.css) && options.css.length === 0) {
options.css = VUESTIC_DEFAULT_CSS
}
useConfigFile()
useVuesticCSS(options)
useVuesticPlugin(options)
useVuesticComponents()
useVuesticComposables()
useTranspile()
}
})