File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ const chokidar = require('chokidar')
1111
1212const postcss = require ( 'postcss' )
1313const postcssrc = require ( 'postcss-load-config' )
14+ const reporter = require ( 'postcss-reporter/lib/formatter' ) ( )
1415
1516const logo = `
1617 /|\\
@@ -224,11 +225,6 @@ function css (css, file) {
224225 return postcss ( config . plugins )
225226 . process ( css , options )
226227 . then ( ( result ) => {
227- if ( result . messages ) {
228- result . warnings ( )
229- . forEach ( ( warning ) => chalk . bold . yellow ( `${ warning } ` ) )
230- }
231-
232228 const tasks = [ ]
233229
234230 if ( options . to ) {
@@ -253,7 +249,10 @@ function css (css, file) {
253249 spinner . text = chalk . bold . green (
254250 `Finished ${ file } (${ Math . round ( process . hrtime ( time ) [ 1 ] / 1e6 ) } ms)`
255251 )
256- spinner . succeed ( )
252+ if ( result . warnings ( ) . length ) {
253+ spinner . fail ( )
254+ console . warn ( reporter ( result ) )
255+ } else spinner . succeed ( )
257256
258257 return result
259258 } )
Original file line number Diff line number Diff line change 2121 "ora" : " ^1.1.0" ,
2222 "postcss" : " ^5.2.11" ,
2323 "postcss-load-config" : " ^1.1.0" ,
24+ "postcss-reporter" : " ^3.0.0" ,
2425 "yargs" : " ^6.6.0"
2526 },
2627 "devDependencies" : {
You can’t perform that action at this time.
0 commit comments