shama / webpack-stream

:tropical_drink: Run webpack through a stream interface
MIT License
1.39k stars 122 forks source link

Switch to supports-color over chalk #179

Closed lgladdy closed 6 years ago

lgladdy commented 6 years ago

At some point, chalk.supportsColor changed so that it returns an object rather than a boolean or webpack changed so that it requires a boolean. This results in a WebpackOptionsValidationError error thrown after the first run of webpack-stream as it mutates the configuration option with it's defaults.

When trying to figure out if/what version of chalk made this change to check for backwards compatibility issues, I realised we don't use any other aspects of chalk, and given chalk uses supports-color to power supportsColor anyway it seemed to make sense to just use that dependancy directly.

This PR changes to support-color, and fixes the issue where an invalid object is passed into webpack's configuration if your own webpack.config.js doesn't contain stats.colors.

shama commented 6 years ago

Cool I like it, thanks!