mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-15 01:41:20 +08:00
19 lines
500 B
TypeScript
19 lines
500 B
TypeScript
import { cyan, bold, yellow, green } from 'chalk'
|
|
|
|
import type { FileSizeReporter } from 'rollup-plugin-filesize'
|
|
|
|
const reporter: FileSizeReporter = (opt, outputOptions, info) => {
|
|
const values = [
|
|
info.fileName ? [`${outputOptions.file?.split('packages/').pop()}`] : [],
|
|
|
|
[`${info.bundleSize}`],
|
|
...(info.minSize ? [`${info.minSize}`] : []),
|
|
]
|
|
|
|
return `${cyan(bold(values[0]))}: bundle size ${yellow(
|
|
values[1]
|
|
)} -> minified ${green(values[2])}`
|
|
}
|
|
|
|
export default reporter
|