Skip to content
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

Doesn't work with plugins that refresh terminal #31

Open
alxtz opened this issue Nov 9, 2019 · 2 comments
Open

Doesn't work with plugins that refresh terminal #31

alxtz opened this issue Nov 9, 2019 · 2 comments

Comments

@alxtz
Copy link

alxtz commented Nov 9, 2019

Issue

plugins like friendly-errors-webpack-plugin or clean-terminal-webpack-plugin clean the terminal screen after every emit event in webpack, which would clean the current files display that's using process.stdout.write

Screenshots

the screen after refresh
image

if scroll on top, the file names are cleared
image

Solutions

I've looked at how some other plugins does this, it turns out like unused-files-webpack-plugin just outputs a long string as the message for new Error() , I didn't really found a better way to do this (maybe can dig into webpack to see what are the formats compilation.warnings supports

Proposal

I've wrote a small PoC for using long new Error() strings instead of process.stdout.write() , the output would look like
image , the output would not be cleared for those plugins

The example code is here, master...alxtz:master , if this looks fine I can clean up the code & write a PR

@zapo
Copy link

zapo commented Feb 25, 2020

Seems like a lot of PRs/issues are trying to fix the same problem.
This was for example my proposal to use the webpack logger API #34

@zapo
Copy link

zapo commented Feb 25, 2020

For other PRs trying to fix that issue also look at #36 and #35.
Their approach is to output to a file instead of stdout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants