diff --git a/packages/vite/src/vite-node.ts b/packages/vite/src/vite-node.ts index 8485a1599c..48136f0c52 100644 --- a/packages/vite/src/vite-node.ts +++ b/packages/vite/src/vite-node.ts @@ -118,7 +118,7 @@ function createViteNodeApp (ctx: ViteBuildContext, invalidates: Set = ne const node: ViteNodeServer = new ViteNodeServer(viteServer, { deps: { inline: [ - /\/(nuxt|nuxt3)\//, + /\/node_modules\/(.*\/)?(nuxt|nuxt3)\//, /^#/, ...transpile({ isServer: true, isDev: ctx.nuxt.options.dev }) ]