Skip to content

Commit

Permalink
fix(vite): skip warming up node builtins (#24162)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Nov 7, 2023
1 parent 9a7e8b8 commit dfff6f1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/vite/src/utils/warmup.ts
@@ -1,3 +1,4 @@
import { isBuiltin } from 'node:module'
import { logger } from '@nuxt/kit'
import { join, normalize, relative } from 'pathe'
import { withoutBase } from 'ufo'
Expand Down Expand Up @@ -39,7 +40,7 @@ export async function warmupViteServer (
try {
url = normaliseURL(url, server.config.base)

if (warmedUrls.has(url)) { return }
if (warmedUrls.has(url) || isBuiltin(url)) { return }
const m = await server.moduleGraph.getModuleByUrl(url, isServer)
// a module that is already compiled (and can't be warmed up anyway)
if (m?.transformResult?.code || m?.ssrTransformResult?.code) {
Expand Down

0 comments on commit dfff6f1

Please sign in to comment.