mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 13:45:18 +00:00
fix(vite): use isBuiltin
polyfill for greater node support (#24512)
This commit is contained in:
parent
fdc75fecb4
commit
4b3892117f
@ -1,4 +1,4 @@
|
|||||||
import { isBuiltin } from 'node:module'
|
import { builtinModules } from 'node:module'
|
||||||
import { logger } from '@nuxt/kit'
|
import { logger } from '@nuxt/kit'
|
||||||
import { join, normalize, relative } from 'pathe'
|
import { join, normalize, relative } from 'pathe'
|
||||||
import { withoutBase } from 'ufo'
|
import { withoutBase } from 'ufo'
|
||||||
@ -28,6 +28,12 @@ function normaliseURL (url: string, base: string) {
|
|||||||
return url
|
return url
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: remove when we drop support for node 18
|
||||||
|
const builtins = new Set(builtinModules)
|
||||||
|
function isBuiltin (id: string) {
|
||||||
|
return id.startsWith('node:') || builtins.has(id)
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: use built-in warmup logic when we update to vite 5
|
// TODO: use built-in warmup logic when we update to vite 5
|
||||||
export async function warmupViteServer (
|
export async function warmupViteServer (
|
||||||
server: ViteDevServer,
|
server: ViteDevServer,
|
||||||
|
Loading…
Reference in New Issue
Block a user