Skip to content

Commit

Permalink
fix: type
Browse files Browse the repository at this point in the history
  • Loading branch information
Rock070 committed Nov 26, 2023
1 parent df59fc1 commit d50c817
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/nuxt/playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "module",
"private": true,
"scripts": {
"dev": "nuxi dev",
"dev": "nuxi dev --host --port=4000",
"build": "nuxi build",
"generate": "nuxi generate"
},
Expand Down
10 changes: 6 additions & 4 deletions packages/nuxt/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ export default defineNuxtModule<NotiOptions>({
// Transpile runtime
nuxt.options.build.transpile.push(resolver.resolve('./runtime'))

nuxt.hook('prepare:types', ({ references }) => {
references.push({ types: '@vue3-noti/nuxt' })
})

// Inject options via virtual template
nuxt.options.alias['#build/vue3-noti-nuxt-config-options'] = addTemplate({
filename: 'vue3-noti-nuxt-config-options.mjs',
Expand All @@ -28,6 +24,12 @@ export default defineNuxtModule<NotiOptions>({
filename: 'vue3-noti-nuxt-config-options.d.ts',
})

nuxt.hook('prepare:types', ({ references, tsConfig }) => {
references.push({ types: '@vue3-noti/nuxt' })

tsConfig.compilerOptions!.paths['#build/vue3-noti-nuxt-config-options'] = ['./vue3-noti-nuxt-config-options.d.ts']
})

nuxt.options.css.push('@vue3-noti/core/style.css')

addPlugin(resolver.resolve('./runtime/plugin'))
Expand Down

0 comments on commit d50c817

Please sign in to comment.