mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-16 13:48:13 +00:00
fix(kit): handle node 14 performance behaviour (#19733)
This commit is contained in:
parent
40ad3f799b
commit
81da4cf5a2
@ -71,8 +71,8 @@ export function defineNuxtModule<OptionsT extends ModuleOptions> (definition: Mo
|
||||
const key = `nuxt:module:${uniqueKey || (Math.round(Math.random() * 10000))}`
|
||||
const mark = performance.mark(key)
|
||||
const res = await definition.setup?.call(null as any, _options, nuxt) ?? {}
|
||||
const perf = performance.measure(key, mark.name)
|
||||
const setupTime = Math.round((perf.duration * 100)) / 100
|
||||
const perf = performance.measure(key, mark?.name) // TODO: remove when Node 14 reaches EOL
|
||||
const setupTime = perf ? Math.round((perf.duration * 100)) / 100 : 0 // TODO: remove when Node 14 reaches EOL
|
||||
|
||||
// Measure setup time
|
||||
if (setupTime > 5000) {
|
||||
|
Loading…
Reference in New Issue
Block a user