Skip to content

Commit

Permalink
Resolve location of @vue/apollo-composable using node module resolu…
Browse files Browse the repository at this point in the history
…tion algo
  • Loading branch information
zenflow authored Jul 1, 2023
1 parent c93fbf0 commit 144e395
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { createRequire } from 'module'
import { existsSync } from 'fs'
import jiti from 'jiti'
import { Ref } from 'vue'
Expand All @@ -9,6 +10,7 @@ import type { ClientConfig, NuxtApolloConfig, ErrorResponse } from './types'

export type { ClientConfig, ErrorResponse }

const require = createRequire(import.meta.url)
const logger = useLogger(name)

async function readConfigFile (path: string): Promise<ClientConfig> {
Expand Down Expand Up @@ -141,7 +143,7 @@ export default defineNuxtModule<NuxtApolloConfig<any>>({
'useGlobalQueryLoading',
'useGlobalMutationLoading',
'useGlobalSubscriptionLoading'
].map(n => ({ name: n, from: '@vue/apollo-composable' })))
].map((n) => ({ name: n, from: resolve(require.resolve("@vue/apollo-composable")) }))
])

nuxt.hook('vite:extendConfig', (config) => {
Expand Down

0 comments on commit 144e395

Please sign in to comment.