Skip to content

Commit

Permalink
fix: don't use file extension when registering runtime plugins (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
userquin authored Jul 11, 2023
1 parent 8e8ccca commit 8a821c4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,21 +206,21 @@ export default defineNuxtModule<ModuleOptions>({
const runtimeDir = resolver.resolve('./runtime')

addPlugin({
src: resolver.resolve(runtimeDir, 'plugins/vuetify.ts'),
src: resolver.resolve(runtimeDir, `plugins/vuetify${i18n ? '-sync' : ''}`),
})
addPlugin({
src: resolver.resolve(runtimeDir, 'plugins/vuetify-icons.ts'),
src: resolver.resolve(runtimeDir, 'plugins/vuetify-icons'),
})

if (i18n) {
addPlugin({
src: resolver.resolve(runtimeDir, 'plugins/vuetify-i18n.ts'),
src: resolver.resolve(runtimeDir, 'plugins/vuetify-i18n'),
})
}

if (dateAdapter) {
addPlugin({
src: resolver.resolve(runtimeDir, 'plugins/vuetify-date.ts'),
src: resolver.resolve(runtimeDir, 'plugins/vuetify-date'),
})
}
},
Expand Down
13 changes: 13 additions & 0 deletions src/runtime/plugins/vuetify-sync.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { configureVuetify } from './config'
import { defineNuxtPlugin } from '#imports'
import { useNuxtApp } from '#app'

export default defineNuxtPlugin({
name: 'vuetify:configuration:plugin',
enforce: 'post',
// i18n runtime plugin is async
parallel: false,
setup() {
useNuxtApp().hook('app:created', configureVuetify)
},
})
1 change: 0 additions & 1 deletion src/runtime/plugins/vuetify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { useNuxtApp } from '#app'
export default defineNuxtPlugin({
name: 'vuetify:configuration:plugin',
enforce: 'post',
parallel: false,
setup() {
useNuxtApp().hook('app:created', configureVuetify)
},
Expand Down

0 comments on commit 8a821c4

Please sign in to comment.