diff --git a/packages/nuxt/src/core/nitro.ts b/packages/nuxt/src/core/nitro.ts index 856158f2c7..99a0a4086b 100644 --- a/packages/nuxt/src/core/nitro.ts +++ b/packages/nuxt/src/core/nitro.ts @@ -70,7 +70,8 @@ export async function initNitro (nuxt: Nuxt) { nuxt.options.buildDir ]), 'nuxt/dist', - 'nuxt3/dist' + 'nuxt3/dist', + distDir ] }, alias: { diff --git a/packages/vite/src/server.ts b/packages/vite/src/server.ts index 947d6389af..2b1b2ec107 100644 --- a/packages/vite/src/server.ts +++ b/packages/vite/src/server.ts @@ -72,8 +72,8 @@ export async function buildServer (ctx: ViteBuildContext) { /\.(es|esm|esm-browser|esm-bundler).js$/, '/__vue-jsx', '#app', - /(nuxt|nuxt3)\/(dist|src|app)/, - /@nuxt\/nitro\/(dist|src)/ + /^nuxt(\/|$)/, + /(nuxt|nuxt3)\/(dist|src|app)/ ] }, build: {