diff --git a/package.json b/package.json index dee7095..9006685 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ ], "scripts": { "prepack": "nuxt-module-build build", - "build": "nuxt-module-build build", + "build": "nuxt-module-build prepare && nuxt-module-build build", "dev": "nuxi dev playground", "dev:build": "nuxi build playground", "dev:preview": "nuxi preview playground", diff --git a/playground/pages/index.vue b/playground/pages/index.vue index 0042b5b..9d69162 100644 --- a/playground/pages/index.vue +++ b/playground/pages/index.vue @@ -1,4 +1,6 @@ diff --git a/playground/tsconfig.json b/playground/tsconfig.json index a746f2a..a994a26 100644 --- a/playground/tsconfig.json +++ b/playground/tsconfig.json @@ -1,4 +1,4 @@ { // https://nuxt.com/docs/guide/concepts/typescript - "extends": "./.nuxt/tsconfig.json" + "extends": "./.nuxt/tsconfig.json", } diff --git a/src/module.ts b/src/module.ts index 94986fe..7727d4e 100644 --- a/src/module.ts +++ b/src/module.ts @@ -7,6 +7,7 @@ import { createResolver } from "@nuxt/kit"; import type { NuxtHookName } from "@nuxt/schema"; +import type { Nuxt } from "nuxt/schema"; export interface ModuleOptions { accessToken: string, @@ -32,7 +33,7 @@ export default defineNuxtModule({ componentsDir: '~/storyblok', apiOptions: {}, }, - setup(options, nuxt) { + setup(options: ModuleOptions, nuxt: Nuxt) { const resolver = createResolver(import.meta.url); if(nuxt.options.vite.optimizeDeps) { @@ -72,6 +73,8 @@ export default defineNuxtModule({ for (const name of names) { addImports({ name, as: name, from: "@storyblok/vue" }); } + + nuxt.options.typescript.hoist.push("@storyblok/vue") addImportsDir(resolver.resolve("./runtime/composables")); if (options.devtools) { diff --git a/tsconfig.json b/tsconfig.json index c4f2839..cb3b1e5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,3 +1,3 @@ { - "extends": "./playground/.nuxt/tsconfig.json" + "extends": "./.nuxt/tsconfig.json" } \ No newline at end of file