mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +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) {
|
||||
let name = chunk.fileName || ''
|
||||
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}');`
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user