mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-18 09:25:54 +00:00
feat: improved sever timing
This commit is contained in:
parent
04fc395149
commit
dbce482b7e
@ -30,7 +30,7 @@ export function timing (_opts: Options = {}): Plugin {
|
|||||||
renderChunk (code, chunk: RenderedChunk) {
|
renderChunk (code, chunk: RenderedChunk) {
|
||||||
let name = chunk.fileName || ''
|
let name = chunk.fileName || ''
|
||||||
name = name.replace(extname(name), '')
|
name = name.replace(extname(name), '')
|
||||||
const logName = name === 'index' ? 'entry' : name
|
const logName = name === 'index' ? 'Cold Start' : ('Load ' + name)
|
||||||
return "'use strict';" + (chunk.isEntry ? HELPER : '') + `${TIMING}.logStart('${logName}');` + code + `;${TIMING}.logEnd('${logName}');`
|
return "'use strict';" + (chunk.isEntry ? HELPER : '') + `${TIMING}.logStart('${logName}');` + code + `;${TIMING}.logEnd('${logName}');`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user