Skip to content

Commit

Permalink
fix: return absolute path for stub entry
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Dec 2, 2023
1 parent 129d833 commit 180bb30
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/module/plugins/entry.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { readFileSync } from 'node:fs'
import { dirname, join } from 'pathe'
import { createUnplugin } from "unplugin"

const PLUGIN_NAME = 'nuxt:vitest:nuxt-root-stub'
Expand All @@ -15,7 +16,7 @@ export const NuxtRootStubPlugin = createUnplugin((options: NuxtRootStubPluginOpt
vite: {
async resolveId(id) {
if (id.endsWith('nuxt-vitest-app-entry')) {
return id
return join(dirname(options.entry), 'nuxt-vitest-app-entry')
}
},
async load(id) {
Expand Down

0 comments on commit 180bb30

Please sign in to comment.