fix(timing): include helpers only in entries

This commit is contained in:
Pooya Parsa 2020-11-15 02:34:43 +01:00
parent aa71b51538
commit f2c1589472

View File

@ -25,7 +25,7 @@ export function timing (_opts: Options = {}): Plugin {
renderChunk (code, chunk: RenderedChunk) {
let name = chunk.fileName || ''
name = name.replace(extname(name), '')
return "'use strict';" + HELPER + `${TIMING}.logStart('import:${name}');` + code + `;${TIMING}.logEnd('import:${name}');`
return "'use strict';" + (chunk.isEntry ? HELPER : '') + `${TIMING}.logStart('import:${name}');` + code + `;${TIMING}.logEnd('import:${name}');`
}
}
}