Skip to content

Commit

Permalink
fix: don't return absolute path in dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Dec 2, 2023
1 parent 180bb30 commit f47dd9a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/module/plugins/entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ export const NuxtRootStubPlugin = createUnplugin((options: NuxtRootStubPluginOpt
name: PLUGIN_NAME,
enforce: 'pre',
vite: {
async resolveId(id) {
async resolveId(id, importer) {
if (id.endsWith('nuxt-vitest-app-entry')) {
return join(dirname(options.entry), 'nuxt-vitest-app-entry')
return importer?.endsWith('index.html') ? id : join(dirname(options.entry), 'nuxt-vitest-app-entry')
}
},
async load(id) {
Expand Down

0 comments on commit f47dd9a

Please sign in to comment.