element-plus/build/size-reporter.ts
三咲智子 0636e1e240
style: add import and stricter lint (#3440)
* style: add import lint

* chore: apply eslint rules

* chore: add stricter lint

* chore: lint all files

* auto fix

* manually fix

* restore build-indices.ts
2021-09-17 15:27:31 +08:00

18 lines
499 B
TypeScript

import chalk 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 `${chalk.cyan(chalk.bold(values[0]))}: bundle size ${chalk.yellow(
values[1]
)} -> minified ${chalk.green(values[2])}`
}
export default reporter