From b48ad564d515bdc7643aaf304826a76191db155f Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Tue, 20 Jun 2023 14:52:58 +0100 Subject: [PATCH] fix: add alias via tsConfig paths --- src/module.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/module.ts b/src/module.ts index 74779a9..ef8fe73 100644 --- a/src/module.ts +++ b/src/module.ts @@ -87,17 +87,9 @@ export default defineNuxtModule({ nitroConfig.alias['#stripe/server'] = resolveRuntimeModule('./server/services') }) - addTemplate({ - filename: 'types/stripe.d.ts', - getContents: () => [ - 'declare module \'#stripe/server\' {', - ` const useServerStripe: typeof import('${resolve('./runtime/server/services')}').useServerStripe`, - '}' - ].join('\n') - }) - + // TODO: add to nitro tsconfig instead when Nuxt v3.6 is released nuxt.hook('prepare:types', (options) => { - options.references.push({ path: resolve(nuxt.options.buildDir, 'types/stripe.d.ts') }) + options.tsConfig.compilerOptions.paths['#stripe/server'] = [resolveRuntimeModule('./server/services')] }) } })