diff --git a/packages/vite/src/server.ts b/packages/vite/src/server.ts index 0caba90c4c..a6eedeb21a 100644 --- a/packages/vite/src/server.ts +++ b/packages/vite/src/server.ts @@ -3,7 +3,7 @@ import { resolve } from 'pathe' import * as vite from 'vite' import vuePlugin from '@vitejs/plugin-vue' import viteJsxPlugin from '@vitejs/plugin-vue-jsx' -import { logger, resolveModule } from '@nuxt/kit' +import { logger, resolveModule, resolvePath } from '@nuxt/kit' import { joinURL, withoutLeadingSlash, withTrailingSlash } from 'ufo' import { ViteBuildContext, ViteOptions } from './vite' import { wpfs } from './utils/wpfs' @@ -14,7 +14,7 @@ import { ssrStylesPlugin } from './plugins/ssr-styles' export async function buildServer (ctx: ViteBuildContext) { const useAsyncEntry = ctx.nuxt.options.experimental.asyncEntry || (ctx.nuxt.options.vite.devBundler === 'vite-node' && ctx.nuxt.options.dev) - ctx.entry = resolve(ctx.nuxt.options.appDir, useAsyncEntry ? 'entry.async' : 'entry') + ctx.entry = await resolvePath(resolve(ctx.nuxt.options.appDir, useAsyncEntry ? 'entry.async' : 'entry')) const _resolve = (id: string) => resolveModule(id, { paths: ctx.nuxt.options.modulesDir }) const serverConfig: vite.InlineConfig = vite.mergeConfig(ctx.config, { diff --git a/packages/vite/src/vite-node.ts b/packages/vite/src/vite-node.ts index e28f05c131..4dc849abcc 100644 --- a/packages/vite/src/vite-node.ts +++ b/packages/vite/src/vite-node.ts @@ -123,11 +123,6 @@ function createViteNodeMiddleware (ctx: ViteBuildContext, invalidates: Set