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

enable progress from config #1181

Merged
merged 3 commits into from
Dec 22, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions bin/webpack-dev-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,8 @@ function processOptions(webpackOptions) {

if (argv.socket) { options.socket = argv.socket; }

if (argv.progress) { options.progress = argv.progress; }

if (!options.publicPath) {
// eslint-disable-next-line
options.publicPath = firstWpOpt.output && firstWpOpt.output.publicPath || '';
Expand Down Expand Up @@ -368,7 +370,7 @@ function startDevServer(webpackOptions, options) {
throw e;
}

if (argv.progress) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a less impactful option would have been to set options.progress within the existing if block. keep an eye on those kinds of simple changes in the future and give them favor.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I understand what you're saying, since the progress opt is only used here and its not always common to use, it would have been less impactful to set the progress opt inside of the if block so it wouldn't be assigned on every run?

Thank you for the review! Looking forward to the v3 version :)

if (options.progress) {
compiler.apply(new webpack.ProgressPlugin({
profile: argv.profile
}));
Expand Down Expand Up @@ -445,7 +447,8 @@ function reportReadiness(uri, options) {
if (options.socket) {
startSentence = `Listening to socket at ${colorInfo(useColor, options.socket)}`;
}
console.log((argv.progress ? '\n' : '') + startSentence);

console.log((options.progress ? '\n' : '') + startSentence);

console.log(`webpack output is served from ${colorInfo(useColor, options.publicPath)}`);

Expand Down