Webpack-dev-server: devServer.progress is only available trough cmd and not trough webpack.config

Created on 22 Jun 2015  路  25Comments  路  Source: webpack/webpack-dev-server

Hi, for example activation of progress flag happens in webpack/bin/convert-argv.js#L333 and it is called in
webpack-dev-server/bin/webpack-dev-server.js#L46 before options is merged into argv so
devServer: { progress: false } isn't working.

4 (nice to have)

Most helpful comment

Simply you can use the webpack ProgressPlugin instead of any other third party plugin.

config.plugins.push(new webpack.ProgressPlugin({ profile: false }));

Cheers!馃槣

All 25 comments

+1
I used devServer: {hot: true} in the webpack.config file and module.hot in webpack/hot/dev-server equals false which throws an error ([HMR] Hot Module Replacement is disabled.). Tried the CLI option webpack-dev-server --hot and it suddenly works great.
Would really appreciate a fix. Thanks.

I'm having the same issues as mentioned above.

Simple config to test the progress flag:

var webpack = require('webpack');
var appRoot = __dirname + '/client';

module.exports = {
    context: appRoot,
    entry: './index.js',
    output: {
        filename: 'bundle.js'
    },
    module: {
        loaders: [
            {
                test: /\.js$/,
                loaders: ['babel']
            }
        ]
    },
    devServer: {
        contentBase: appRoot,
        colors: true,
        progress: true,
        inline: true
    }
};

Running webpack-dev-server doesn't show the progress.
Only when adding --progress it shows the progress.

+1 :+1:

+1 :+1:

+1 :+1:

I think for hot you can get away with:

devServer: {
  hot: true,
  inline: true,
}

but there is no config equivalent for progress.

+1

Any update on this?

+1

+1

+1

+1

+1

+1

@sokra yo yo yo yo :)

+1

+1

+2

We can manually use the ProgressBarPlugin in the webpack config file and that should do it.

npm install --save-dev progress-bar-webpack-plugin

The in our development webpack config:

const ProgressBarPlugin = require('progress-bar-webpack-plugin');

...

plugins: plugins.concat([
  new ProgressBarPlugin({ clear: false })
])

+1

This is not something that can be fixed in webpack-dev-server. The dev-server only passes the progress flag through to the webpack CLI options, as you can see here. If you want this to be fixed, you should create an issue in the webpack repo. It will automatically also work in dev-server if it's fixed over there (since dev-server has nothing to do with compiling to a bundle).

There are a couple of workarounds for this though. The answer from @betolink is an option, or you can use webpack.ProgressPlugin. Example: new ProgressPlugin(percentage => progressBar.update(percentage)). progressBar comes from the progress package.

Simply you can use the webpack ProgressPlugin instead of any other third party plugin.

config.plugins.push(new webpack.ProgressPlugin({ profile: false }));

Cheers!馃槣

@elmorec That worked, thanks.

Note colors doesn't do anything, it's not in the plugin's code as well.

@alexilyaev Yeah, you are right, thx.

Yo, any update on this?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wojtekmaj picture wojtekmaj  路  3Comments

MJ111 picture MJ111  路  3Comments

hnqlvs picture hnqlvs  路  3Comments

subblue picture subblue  路  3Comments

adiachenko picture adiachenko  路  3Comments