feature request: customize client-overlay colors
jimblue opened this issue Β· comments
Hi!
First thank you for this amazing webpack middleware π !
I was wondering it it's possible to add an option to customize client-overlay
colors.
I saw it's already depending from a variable here:
Maybe it's possible to modify this variable when calling webpack-hot-middleware
?
Here is the actual look (too faded in my opinion):
This is my terminal look of the same output with custom colors:
Also is it possible to only output the error without all the at Parser... lines...?
Iβd take a PR which did this, yep
I have no idea how to π€ !
Hopefully someone else has the time or interest to pick this up then.
The options parsing would need to be added to client.js and documented in the readme, and then those colours passed over to the overlay code on init.
@glenjamin what about at Parser lines...?
The overlay handles formatting ANSI codes, so any output that isn't formatted in the source won't be coloured in.
Sorry my question was maybe not clear.
I don't want to display at Parser lines. They don't show up in the console, only in the overlay... why?
I have a PR coming for this shortly. Got the colors working. Looking into the parser lines now.
Ah, those parser lines are because we display the error.stack
property instead of just error.message
.
For this type of error, the stack trace isn't useful - but in general it is
@glenjamin is it possible to disable it?
I don't think it's possible to know in general whether a given exception's stack trace will be useful
I mean is it possible to completely disable it to have a terminal like output which is more clear.
No, because this feature shows errors.
It just so happens that a babel error contains a message with terminal formatting in it.
Hi @okcoker and thank you very much for this PR, I've just try it!
I was able to customize overlayStyles but not ansiColors.
I've try by copy paste the documention exemple to be sure.
@jimblue did you ever get the ansiColors to work? I'm having trouble as well.
@jimmynotjim nope, still don't work for me π
@jimblue @jimmynotjim opened a PR for this #355
@glenjamin I've just look to the PR, it was pretty simple in the end π€£ !
It seems to work on my side, can you confirm?
Resolved in 2.24.4
https://www.npmjs.com/package/webpack-hot-middleware/v/2.24.4 was released shortly before I posted that comment.
Where are you seeing it not be available?
Oh sorry man, it was because of npm cache on my machine... π