Skip to content

Commit

Permalink
fix: use nitro virtual
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Oct 24, 2023
1 parent 2d841f8 commit e04c0e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@ export default defineNuxtModule<ModuleOptions>({
postLoginRedirectURL: '',
})

addTemplate({
filename: 'kinde-version.mjs',
getContents: () => `export const version = '${version}'`,
})
nuxt.options.nitro.virtual ||= {}
nuxt.options.nitro.virtual['kinde-version.mjs'] = () => `export const version = '${version}'`,

// Do not add the extension since the `.ts` will be transpiled to `.mjs` after `npm run prepack`
addPlugin(resolver.resolve('./runtime/plugin'))
Expand Down
3 changes: 2 additions & 1 deletion src/runtime/server/utils/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { createKindeServerClient, GrantType } from '@kinde-oss/kinde-typescript-
import type { ACClient } from '@kinde-oss/kinde-typescript-sdk'
import { useRuntimeConfig } from '#imports'

import { version as frameworkVersion } from '#build/kinde-version.mjs'
// @ts-expect-error virtual file
import { version as frameworkVersion } from 'kinde-version.mjs'

let kindeClient: ACClient

Expand Down

0 comments on commit e04c0e7

Please sign in to comment.