mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 07:05:11 +00:00
perf(kit,nuxt): remove handling for node 14 perf api (#27396)
This commit is contained in:
parent
c2702ef98d
commit
7c5e25f81b
@ -73,8 +73,8 @@ export function defineNuxtModule<OptionsT extends ModuleOptions> (definition: Mo
|
|||||||
const key = `nuxt:module:${uniqueKey || (Math.round(Math.random() * 10000))}`
|
const key = `nuxt:module:${uniqueKey || (Math.round(Math.random() * 10000))}`
|
||||||
const mark = performance.mark(key)
|
const mark = performance.mark(key)
|
||||||
const res = await module.setup?.call(null as any, _options, nuxt) ?? {}
|
const res = await module.setup?.call(null as any, _options, nuxt) ?? {}
|
||||||
const perf = performance.measure(key, mark?.name) // TODO: remove when Node 14 reaches EOL
|
const perf = performance.measure(key, mark.name)
|
||||||
const setupTime = perf ? Math.round((perf.duration * 100)) / 100 : 0 // TODO: remove when Node 14 reaches EOL
|
const setupTime = Math.round((perf.duration * 100)) / 100
|
||||||
|
|
||||||
// Measure setup time
|
// Measure setup time
|
||||||
if (setupTime > 5000 && uniqueKey !== '@nuxt/telemetry') {
|
if (setupTime > 5000 && uniqueKey !== '@nuxt/telemetry') {
|
||||||
|
@ -85,8 +85,8 @@ export async function generateApp (nuxt: Nuxt, app: NuxtApp, options: { filter?:
|
|||||||
changedTemplates.push(template)
|
changedTemplates.push(template)
|
||||||
}
|
}
|
||||||
|
|
||||||
const perf = performance.measure(fullPath, mark?.name) // TODO: remove when Node 14 reaches EOL
|
const perf = performance.measure(fullPath, mark.name)
|
||||||
const setupTime = perf ? Math.round((perf.duration * 100)) / 100 : 0 // TODO: remove when Node 14 reaches EOL
|
const setupTime = Math.round((perf.duration * 100)) / 100
|
||||||
|
|
||||||
if (nuxt.options.debug || setupTime > 500) {
|
if (nuxt.options.debug || setupTime > 500) {
|
||||||
logger.info(`Compiled \`${template.filename}\` in ${setupTime}ms`)
|
logger.info(`Compiled \`${template.filename}\` in ${setupTime}ms`)
|
||||||
|
Loading…
Reference in New Issue
Block a user