Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When I run serve command with lerna I got enormous of outputs rows

Im using lerna to run serve command. this command call vue/cli which call webpack to analyze all the files and build the bundle.

So I run lerna run serve --stream in vue/cli application and I get output of lot of rows in webpack progress:

myapp-vue: <s> [webpack.Progress] 93% asset optimization
myapp-vue: <s> [webpack.Progress] 94% after asset optimization
myapp-vue: <s> [webpack.Progress] 94% after seal
myapp-vue: <s> [webpack.Progress] 95% emitting
myapp-vue: <s> [webpack.Progress] 95% emitting HtmlWebpackPlugin
myapp-vue: <s> [webpack.Progress] 95% emitting vue-cli:pwa-html-plugin
myapp-vue: <s> [webpack.Progress] 95% emitting CopyPlugin
myapp-vue: <s> [webpack.Progress] 95% emitting fork-ts-checker-webpack-plugin

What can I do to not have all the rows? (just to have in one line - every time the line will erase and have new information) and I don't want to lose the webpack progress. maybe to create a buffer for every 3 seconds?

like image 605
Jon Sud Avatar asked Sep 09 '19 16:09

Jon Sud


1 Answers

It might be possible to write some kind of debounce-throttle for stdout. Or run gnu-screen with custom config. screen -c ./lerna-screen

But multiview package did the trick for me. It outputs spawned processes to independent columns

npm i multiview -D

{
  "name": "root",
  "private": true,
  "scripts": {
    "dev": "multiview [npm run dev:app] [npm run dev:web] -e",
    "dev:app": "lerna run dev --stream --no-prefix --ignore=@therobot/*-web",
    "dev:web": "lerna run dev --stream --no-prefix --scope=@therobot/*-web"
  }
}

enter image description here

like image 184
Yevhenii Ponomar Avatar answered Oct 23 '22 05:10

Yevhenii Ponomar