postcss / gulp-postcss

Pipe CSS through PostCSS processors with a single parse
MIT License
769 stars 65 forks source link

"silent" option #125

Closed stevenvachon closed 7 years ago

stevenvachon commented 7 years ago

It'd be great if this option were available to silence debug logging. This becomes important when building the same files multiple times with different options, and only needing to see a set of errors once.

This is related to #93.

TrySound commented 7 years ago

@stevenvachon Can be solved via plugin.

postcss.plugin('messages', () => (css, result) => {
  const warnings = result.warnings();
  result.messages = result.messages.filter(msg => msg.type !== 'warning');
})
stevenvachon commented 7 years ago

Ok, but I don't want to add custom code to my gulpfile, or create additional files. I think that this request would be a reasonable addition to this project.

w0rm commented 7 years ago

I don't think we need to support this case, because the current options are 1 to 1 from postcss, and by introducing custom options we may accidentally end up with overlapping options.

I prefer to keep this runner as thin as possible, so if something may be achieved via postcss configuration or an additional plugin, it will not be implemented here.

stevenvachon commented 7 years ago

If postcss changes from a Promise, you could remove the option in a necessary new major release. Not implementing options for the gulp wrapper defeats the reason we use gulp.

TrySound commented 7 years ago

Gulp is not about implementing options. There is a big confusing in gulp uglify which introduced some options and they didn't worked in API. Such wrappers should reduce gap between APIs, not increase by introducing own stuff.

stevenvachon commented 7 years ago

The reason we use gulp is to abstract APIs and reduce custom code. You're proposing that I introduce more code.

TrySound commented 7 years ago

You are always introduce custom code with custom requirements. There's nothing to do with abstraction.

w0rm commented 7 years ago

For me gulp is configuration as code. Composability over configuration.