element-plus/build/size-reporter.ts
jeremywu 16f069ebbe
Revert "build!: simplify build & support native esm import (#3900)" (#3945)
* Revert "build!: simplify build & support native esm import (#3900)"

This reverts commit fb94222bb4.

* remove module

* Fix linter

* Add @element-plus/icons as dependency

* update pnpm lock file

* temporary lock element-plus at 1.1.0-beta.20
2021-10-20 09:42:32 +08:00

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