-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(karma-webpack): unify webpack
and karma
color config
#356
feat(karma-webpack): unify webpack
and karma
color config
#356
Conversation
webpack
and karma
color config
|
||
// Set webpack's color config to value specified in Karma's config for consistency | ||
webpackMiddlewareOptions.stats = webpackMiddlewareOptions.stats || {}; | ||
webpackMiddlewareOptions.stats.colors = colors; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this always override the default webpack
colors config ? This would be a breaking change then... Could this eventually be made an option intead ? e.g
if (config.colors) {
webpackDevMiddlewareOptions.stats.colors = colors
}
⚠️ Not sure if this works correctly, but to illustrate the idea :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michael-ciniawsky Thanks for the response :) What do you mean by a breaking change?
It should work in a similar way that webpack's watch config is being overridden by Karma's singleRun config https://github.com/webpack-contrib/karma-webpack/blob/master/src/karma-webpack.js#L56
If you specify colors: false
on Karma, you probably don't want colors on webpack's output either
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm honstely not too familiar with in this particular area, so I might misunderstand the changes made here... My current understanding is that webpackDevMiddlewareOptions.stats.colors = colors
always 'overrides' the webpack
defaults (?) What are the webpack
defaults? No colors at all (then everthing should be fine as-is)? Could you maybe post a screenshot before/after to clearify?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Below are some images to illustrate the changes
I have a simple project setup you can play around with https://github.com/spicalous/color-example
First image: No configs (Karma and webpack output color)
Second image: Karma color:false (Karma outputs no color, webpack outpus color)
Third image: Karma color:false after changes (Karma and webpack both output no color)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
webpackMiddlewareOptions.stats
could be string
. This breaks configuration i.e.:
//...
stats: 'errors-only'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in rc.5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Unifies the color config between webpack and Karma. See #332
Type
Issues
SemVer