mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-20 15:01:46 +01:00
@@ -1,5 +1,5 @@
|
||||
import { resolve, join } from 'pathe'
|
||||
import { defineNuxtModule, installModule } from '@nuxt/kit'
|
||||
import { defineNuxtModule, installModule, addPlugin, resolveModule } from '@nuxt/kit'
|
||||
import { colors } from '@unocss/preset-uno'
|
||||
import type { UnocssNuxtOptions } from '@unocss/nuxt'
|
||||
|
||||
@@ -95,8 +95,11 @@ export default defineNuxtModule({
|
||||
|
||||
await installModule(nuxt, { src: '@unocss/nuxt', options })
|
||||
|
||||
const runtimeDir = resolve(__dirname, 'runtime')
|
||||
const componentsDir = resolve(__dirname, 'components')
|
||||
|
||||
addPlugin(resolveModule('./plugin', { paths: runtimeDir }), { append: true })
|
||||
|
||||
nuxt.hook('components:dirs', (dirs) => {
|
||||
dirs.push({
|
||||
path: join(componentsDir, 'elements'),
|
||||
|
||||
6
src/runtime/plugin.ts
Normal file
6
src/runtime/plugin.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { useDark } from '@vueuse/core'
|
||||
import { defineNuxtPlugin } from '#app'
|
||||
|
||||
export default defineNuxtPlugin(() => {
|
||||
useDark()
|
||||
})
|
||||
Reference in New Issue
Block a user