mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 23:22:02 +00:00
fix(vite): skip warming up node builtins (#24162)
This commit is contained in:
parent
9a7e8b8e68
commit
dfff6f13c4
@ -1,3 +1,4 @@
|
||||
import { isBuiltin } from 'node:module'
|
||||
import { logger } from '@nuxt/kit'
|
||||
import { join, normalize, relative } from 'pathe'
|
||||
import { withoutBase } from 'ufo'
|
||||
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user