Skip to content

Commit

Permalink
fix: more consistent outDir formatting
Browse files Browse the repository at this point in the history
close #1497
  • Loading branch information
yyx990803 committed Jan 12, 2021
1 parent cf5f3ab commit 50bff79
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/vite/src/node/plugins/reporter.ts
Expand Up @@ -3,6 +3,7 @@ import chalk from 'chalk'
import { Plugin } from 'rollup'
import { ResolvedConfig } from '../config'
import { sync as brotliSizeSync } from 'brotli-size'
import { normalizePath } from '../utils'

const enum WriteType {
JS,
Expand Down Expand Up @@ -38,8 +39,13 @@ export function buildReporterPlugin(config: ResolvedConfig): Plugin {
).toFixed(2)}kb`
: ``

let outDir = path.posix.relative(process.cwd(), config.build.outDir)
if (!outDir.endsWith('/')) outDir += '/'
const outDir =
normalizePath(
path.relative(
config.root,
path.resolve(config.root, config.build.outDir)
)
) + '/'
config.logger.info(
`${chalk.gray(chalk.white.dim(outDir))}${writeColors[type](
filePath.padEnd(maxLength + 2)
Expand Down

0 comments on commit 50bff79

Please sign in to comment.