-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Allow silent/minimal/standard output when building #3603
Comments
Please allow this for
|
Alternative SolutionSimilar to #1284. // vue.config.js
// ...
module.exports = {
chainWebpack: config => {
// remove vue-cli-service's progress output
config.plugins.delete('progress')
// optionally replace with another progress output plugin
// `npm i -D simple-progress-webpack-plugin` to use
config.plugin('simple-progress-webpack-plugin').use(require.resolve('simple-progress-webpack-plugin'), [
{
format: 'minimal', // options are minimal, compact, expanded, verbose
},
])
}
} For those interested in PR's...Here's the current implementation defining the progress output, and here is where it's instantiated. It's just a customization of webpack's internal ProgressPlugin. |
@ashrafhadden 👍 👍 👍 I'll definitely check out the plugin! |
The 'build' action definitely needs a 'no progress bar' option - for a lot of CI systems, they just append all output text to log, and a progress bar is a lot of output text as it is rewritten constantly. An append-only log doesn't care about the 'clear line' character used in dynamic status bars. I've got some builds at the moment that have 1.2MB worth of buildlog... about 1.1MB of which is progress bar spam. Just piping up with another use case... |
bump! :) |
I was able to accomplish basically what this thread is asking for simply by passing the
This has the advantage of still printing errors, but doesn't give me an ultra long list of all the file chunks that have been built. |
Is there any updates about it? |
@MKorostoff that didn't change anything for me on v3.11.0 (still has the animated/changed-in-place progress line). Regardless, though, a |
The verbose line logging now started happening for me in Vue-UI (of CLI) - didn't happen before - any way to fix? Doesn't happen when running same command from terminal though. |
It took me some digging to figure it out, but there does seem to be a way to get this working with |
Please allow this for vue-cli-service test:unit as well!According to https://cli.vuejs.org/config/#devserver
But trying to set any output options like devServer.stats and devServer.noInfo via vue.config.js have no effect. A simple --silent and --verbose option for serve, build and test:unit would be awesome! |
Adding this reduces the majority of logs.
Also |
My use-case is using I settled with this conf:
// vue.config.js
const SimpleProgressWebpackPlugin = require('simple-progress-webpack-plugin')
module.exports = {
configureWebpack: {
plugins: [
new SimpleProgressWebpackPlugin({
format: 'minimal'
})
]
},
devServer: {
progress: false
}
} |
Just wanted to emphasize this aspect of the initial issue:
So far I have been able to figure out how to silence the majority of the unnecessary logs, but this doesn't fully fix the issue. There appears to be no way to prevent the builder from clearing the terminal window after the build is complete. This is a pretty serious issue because it doesn't play nice with other dev tools. For example, we are running Vue in a Docker container within docker-compose, which aggregates logs from multiple services to a single terminal window in development. As it stands this clobbers the output from all the other services, which is not ideal. |
Double 👍 to @jswinarton 's comment about clearing the console... We are booting our dev processes with overmind, and vue is nuking the output from the other processes. "not ideal" is a huge understatement I'd also like to stress the importance that whatever output-supression option ends up being chosen, it must be something configurable on the command line (not necessarily in place of, but at least in addition to configuration file). The desirability of the additional output is heavily influenced by what is spawning the dev server. Running it from a process manager like overmind? output is desired because overmind can segregate output per process. Running the dev server from, say, asp.net's dev server? output is definitely not desired because it's interleaved with the rest of the application output. Just keep that in mind, that merely having the ability to configure in json config is not sufficient to cover use cases. |
When trying to run
Every time I start the frontend. Please advise. I am wondering if it is possible to get the fancy auto-updating single-line output I get when running this outside of docker. That way I wouldn't need to turn off progress, but have the same experience I get when running it outside of docker |
My hack (for building within emacs which sets if (process.env.TERM === 'dumb') {
const t = require('@vue/cli-shared-utils');
process.env.CI = 't';
t.logWithSpinner = () => {};
t.stopSpinner = () => {};
t.pauseSpinner = () => {};
t.resumeSpinner = () => {};
}
module.exports = {
// ... in top of |
I've found a solution to the console nuking during serve. It's down to the "friendly-errors" plugin, so you can tap the config and remove the console clearing. In chainWebpack: config => {
// Prevent HMR nuking the console.
config
.plugin('friendly-errors')
.tap(args => {
return [{
...args,
clearConsole: false
}]
})
} You still get the "App running at ..." every time it compiles but there's no way around that. |
What problem does this feature solve?
First: thank you guys so much for your time and effort on this project. It's seriously a life-saver.
So, I'm not sure if this is a feature request or actually kind of a bug report... maybe a little of both. But I think whatever bug I'm experiencing would be made moot were this feature to exist.
I'm looking for an option for "minimal output" from
vue-cli-service build [--watch]
which does not have a progress status line which is neither animated nor changed in-place.When running
vue-cli-service build --watch
, it does something funky with the standard output. First you see "building for development", then a progress status line which changes in place:...before finally logging the build output, something like:
A similar thing happens when doing a plain, unwatched,
vue-cli-service build
.If I try to redirect the output to a file and tail that file (e.g.,
yarn run vue-cli-service build > foo.log
,tail -f foo.log
), I still see the dynamically-replaced progress line appear in the terminal where I ran the build command, and infoo.log
I see a logged line from the TypeScript type-checking service starting up, and then I see the build output appear appended to the file. When I make a change to a watched file (if I usebuild --watch
), I see the progress line in the previous terminal appear and I see another build "DONE" output in the log file.See the following gif for an example:
Also, if I use a process-management program (e.g.,
node-foreman
) to start thevue-cli-service build --watch
, it logs a line for every single time the progress line changes, which easily fills my terminal buffer in just a few seconds—thousands of lines of output... 10-11 lines to one "XX% building ..." line. Even if the feature provided a way for each "1% building ...", "2% building ...", etc. line to be simply appended to standard output, that would be fine (for me). I can always filter the lines by piping togrep
/sed
/awk
/whatever if I'm logging to a file or running the process with foreman. But currently there's no way to do that.See the following gif for an example:
So, if there were a way to simply log output "traditionally", line-by-line to STDOUT, without the observed hijacking (not sure what's going on), it would make it a heck of a lot easier to use
vue-cli-service
with other common development tools and basic utilities. I'm having a hard time setting up a simple local dev setup with vue-cli that reflects the workflow/practices of my team, so this feature would make our lives a lot smoother.What does the proposed API look like?
I'm picturing something like:
But I'm sure there's a better idea than that. Not quite sure how it should look.
The text was updated successfully, but these errors were encountered: