@@ -12,6 +12,7 @@ import { prepare } from '../prepare'
1212import { RollupWatcher } from 'rollup'
1313import { logOutputState } from '../plugins/output-state-plugin'
1414import { normalizeError } from '../lib/normalize-error'
15+ import { createSpinner } from 'nanospinner'
1516
1617const helpMessage = `
1718Usage: bunchee [options]
@@ -258,18 +259,15 @@ async function run(args: CliArgs) {
258259 // lint package by default
259260 await lint ( cwd )
260261
261- const { default : ora } = await import ( 'ora' )
262-
263- const oraInstance = process . stdout . isTTY
264- ? ora ( {
265- text : 'Building...\n\n' ,
262+ const spinnerInstance = process . stdout . isTTY
263+ ? createSpinner ( 'Building...\n\n' , {
266264 color : 'green' ,
267265 } )
268266 : {
269267 start : ( ) => { } ,
270268 stop : ( ) => { } ,
271269 clear : ( ) => { } ,
272- stopAndPersist : ( ) => { } ,
270+ success : ( ) => { } ,
273271 isSpinning : false ,
274272 }
275273
@@ -279,19 +277,19 @@ async function run(args: CliArgs) {
279277 }
280278
281279 function startSpinner ( ) {
282- oraInstance . start ( )
280+ spinnerInstance . start ( )
283281 }
284282
285283 function stopSpinner ( text ?: string ) {
286- if ( oraInstance . isSpinning ) {
287- oraInstance . clear ( )
284+ if ( spinnerInstance . isSpinning ) {
285+ spinnerInstance . clear ( )
288286 if ( text ) {
289- oraInstance . stopAndPersist ( {
290- symbol : '✔' ,
287+ spinnerInstance . success ( {
288+ mark : '✔' ,
291289 text,
292290 } )
293291 } else {
294- oraInstance . stop ( )
292+ spinnerInstance . stop ( )
295293 }
296294 }
297295 }
0 commit comments