@@ -11,8 +11,8 @@ import {
1111 normalizeSlash ,
1212 withBase ,
1313} from '@rspress/shared' ;
14- import chalk from '@rspress/shared/chalk' ;
1514import { logger } from '@rspress/shared/logger' ;
15+ import picocolors from 'picocolors' ;
1616import type { HelmetData } from 'react-helmet-async' ;
1717import { PluginDriver } from './PluginDriver' ;
1818import {
@@ -100,15 +100,15 @@ export async function renderPages(
100100 // see: https://github.com/web-infra-dev/rspress/issues/1317
101101 if ( typeof ssgConfig === 'object' && ssgConfig . strict ) {
102102 logger . error (
103- `Failed to load SSG bundle: ${ chalk . yellow ( ssrBundlePath ) } .` ,
103+ `Failed to load SSG bundle: ${ picocolors . yellow ( ssrBundlePath ) } .` ,
104104 ) ;
105105 throw e ;
106106 }
107107
108108 // fallback to CSR
109109 logger . error ( e ) ;
110110 logger . warn (
111- `Failed to load SSG bundle: ${ chalk . yellow ( ssrBundlePath ) } , fallback to CSR.` ,
111+ `Failed to load SSG bundle: ${ picocolors . yellow ( ssrBundlePath ) } , fallback to CSR.` ,
112112 ) ;
113113 }
114114 }
@@ -149,14 +149,14 @@ export async function renderPages(
149149 } catch ( e ) {
150150 if ( typeof ssgConfig === 'object' && ssgConfig . strict ) {
151151 logger . error (
152- `Page "${ chalk . yellow ( routePath ) } " SSG rendering failed.` ,
152+ `Page "${ picocolors . yellow ( routePath ) } " SSG rendering failed.` ,
153153 ) ;
154154 throw e ;
155155 }
156156
157157 // fallback to CSR
158158 logger . warn (
159- `Page "${ chalk . yellow ( routePath ) } " SSG rendering error: ${ e . message } , fallback to CSR.` ,
159+ `Page "${ picocolors . yellow ( routePath ) } " SSG rendering error: ${ e . message } , fallback to CSR.` ,
160160 ) ;
161161 }
162162 }
@@ -221,7 +221,7 @@ export async function renderPages(
221221 await emptyDir ( join ( outputPath , 'html' ) ) ;
222222
223223 const totalTime = Date . now ( ) - startTime ;
224- logger . success ( `Pages rendered in ${ chalk . yellow ( totalTime ) } ms.` ) ;
224+ logger . success ( `Pages rendered in ${ picocolors . yellow ( totalTime ) } ms.` ) ;
225225 } catch ( e ) {
226226 logger . error ( `Pages render error: ${ e . stack } ` ) ;
227227 throw e ;
0 commit comments