C-Lodder / grunt-postcss

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

grunt.fatal #56

Closed Yuriy-Svetlov closed 3 years ago

Yuriy-Svetlov commented 3 years ago

Hello @C-Lodder

Why are you using? grunt.fatal(error);

https://gruntjs.com/api/grunt.fail

Need it use: grunt.fail.fatal(error);

Because of this, I can not catch the error according to the standards of the official documentation

C-Lodder commented 3 years ago

Hi @semiromid,

grunt.fatal is an alias for grunt.fail.fatal, meaning they are both exactly the same.

Yuriy-Svetlov commented 3 years ago

@C-Lodder Thank you for your answer!

Still, this is not quite the same.

Since you need to do the hook differently

// Instead of this
grunt.util.hooker.hook(grunt.fail, 'fatal', function(e){

});

// this
grunt.util.hooker.hook(grunt, 'fatal', function(e){

});

I think there should be a unified approach to the implementation of this task.

C-Lodder commented 3 years ago

@semiromid if you open the following file:

node_modules/@lodder/grunt-postcss/tasks/postcss.js

and replace grunt.fatal with grunt.fail.fatal, does it solve the issue?

If so, I'm happy to make that change

Yuriy-Svetlov commented 3 years ago

@C-Lodder

Yes. Thank you!

C-Lodder commented 3 years ago

Perfect, thanks.

I'll make the change and release an update