Skip to content

Commit 180bb30

Browse files
committedDec 2, 2023
fix: return absolute path for stub entry
1 parent 129d833 commit 180bb30

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎src/module/plugins/entry.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { readFileSync } from 'node:fs'
2+
import { dirname, join } from 'pathe'
23
import { createUnplugin } from "unplugin"
34

45
const PLUGIN_NAME = 'nuxt:vitest:nuxt-root-stub'
@@ -15,7 +16,7 @@ export const NuxtRootStubPlugin = createUnplugin((options: NuxtRootStubPluginOpt
1516
vite: {
1617
async resolveId(id) {
1718
if (id.endsWith('nuxt-vitest-app-entry')) {
18-
return id
19+
return join(dirname(options.entry), 'nuxt-vitest-app-entry')
1920
}
2021
},
2122
async load(id) {

0 commit comments

Comments
 (0)
Please sign in to comment.