C-Lodder / grunt-postcss

Apply several post-processors to your CSS using PostCSS.
MIT License
39 stars 7 forks source link

Added error event #55

Closed Yuriy-Svetlov closed 3 years ago

Yuriy-Svetlov commented 3 years ago

grunt.event.emit('grunt-postcss-error', error);

grunt.event.on('grunt-postcss-error', function(err){

});
C-Lodder commented 3 years ago

I've released v3.0.1 which uses grunt.fail.fatal. Is this PR still needed?

Yuriy-Svetlov commented 3 years ago

@C-Lodder

Thank you!

I am also interested in the unformatted error message.

grunt.event.emit('grunt-postcss-error', error);

But maybe should do:

if (grunt.event.emit.listeners('grunt-postcss-error').length > 0) {
    grunt.event.emit('grunt-postcss-error', error);
}
Yuriy-Svetlov commented 3 years ago

@C-Lodder

Warning: grunt.event.emit.listeners is not a function

Yuriy-Svetlov commented 3 years ago

@C-Lodder

Additional information:

In your Readme.md written

This plugin requires Grunt ~1.0.3

~1.0.3 is equivalent >=1.0.3 <1.1.0

I use Grunt v1.2.0

C-Lodder commented 3 years ago

Closing in favour of: https://github.com/C-Lodder/grunt-postcss/pull/59