(config: ResolvedConfig)
| 5 | import { LogLevels } from '../logger' |
| 6 | |
| 7 | export function buildReporterPlugin(config: ResolvedConfig): Plugin { |
| 8 | return perEnvironmentPlugin('native:reporter', (env) => { |
| 9 | const tty = process.stdout.isTTY && !process.env.CI |
| 10 | const shouldLogInfo = LogLevels[config.logLevel || 'info'] >= LogLevels.info |
| 11 | const assetsDir = path.join(env.config.build.assetsDir, '/') |
| 12 | return nativeReporterPlugin({ |
| 13 | root: env.config.root, |
| 14 | isTty: !!tty, |
| 15 | isLib: !!env.config.build.lib, |
| 16 | assetsDir, |
| 17 | chunkLimit: env.config.build.chunkSizeWarningLimit, |
| 18 | logInfo: shouldLogInfo ? (msg) => env.logger.info(msg) : undefined, |
| 19 | reportCompressedSize: env.config.build.reportCompressedSize, |
| 20 | warnLargeChunks: |
| 21 | env.config.build.minify && |
| 22 | !env.config.build.lib && |
| 23 | env.config.consumer === 'client', |
| 24 | }) |
| 25 | }) |
| 26 | } |
no test coverage detected