Skip to content

Commit fd697b1

Browse files
authored
Merge pull request #55 from NaverPayDev/chore/log-color
tsup log에 색상 반영
2 parents 753d50f + 1fdb575 commit fd697b1

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

.changeset/clean-cars-end.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@naverpay/pite": patch
3+
---
4+
5+
tsup log에 색상 반영
6+
7+
PR: [tsup log에 색상 반영](https://github.com/NaverPayDev/pite/pull/55)

src/vite-tsup-plugin.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* eslint-disable no-console */
22

3+
import chalk from 'chalk'
34
import {build, Format} from 'tsup'
45
import {Plugin} from 'vite'
56

@@ -45,7 +46,7 @@ export default function vitePluginTsup({formats, entry: rawEntry, outDir}: ViteP
4546
name: 'vite-plugin-tsup',
4647
async closeBundle() {
4748
try {
48-
console.log('Starting tsup to generate .d.ts files...')
49+
console.log(chalk.blue('\nStarting tsup to generate .d.ts files...\n'))
4950

5051
if (hasEsm) {
5152
await build(createConfig({entry, format: 'esm', outDir: outDir.esm}))
@@ -55,9 +56,9 @@ export default function vitePluginTsup({formats, entry: rawEntry, outDir}: ViteP
5556
await build(createConfig({entry, format: 'cjs', outDir: outDir.cjs}))
5657
}
5758

58-
console.log('tsup finished successfully.')
59+
console.log(chalk.green('\ntsup finished successfully.'))
5960
} catch (error) {
60-
console.error('Error running tsup plugin:', error)
61+
console.error(chalk.red('Error running tsup plugin:'), error)
6162
}
6263
},
6364
}

0 commit comments

Comments
 (0)