webpack-contrib / extract-text-webpack-plugin

[DEPRECATED] Please use https://github.com/webpack-contrib/mini-css-extract-plugin Extracts text from a bundle into a separate file

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

plugin produces a lot of empty logs while extracting

deepsweet opened this issue · comments

like this:

...
Child extract-text-webpack-plugin:

Child extract-text-webpack-plugin:

Child extract-text-webpack-plugin:

Child extract-text-webpack-plugin:

Child extract-text-webpack-plugin:
...

is it normal, or I had to see something useful? :)

Hi @deepsweet ,
You can disable the output from Child plugins by including this in your webpack config

    stats: {
      children: false  
    }

Hope this helps a bit.

advice from sokra: with the devserver: devServer: { stats: { children: false } }

children: false doesn't seem to work using the CLI tool?

works fine with gulp

gulp-webpack does some custom stuff. I think this was fixed through all this: webpack/webpack#980

I'm still seeing the Child extract-text-webpack-plugin: output even with the stats: { children: false } set on my webpack config.

@pstoica @marr

it works fine for me if I run webpack CLI with a webpack.config.js like this:

module.exports = {
    stats: { children: false },
   // other settings
}

i can confirm that this last one by @timaschew works fine.

Adding stats: { children: false } to the main context of the configuration worked for me as well. Thanks.

Doesn't work for me, but I'm sure I've set this stats: { children: false } option

@vyorkin are you sure You've added it to devServer section?

@ColCh yes, but I don't see how its related to devServer, I've looked at the plugin source but didn't find anything relevant to these messages. Here is a part of my config:

  ........................
  devtool: false,
  stats: { children: false, colors: true, reasons: false },
  devServer:
   { contentBase: '/my-awesome-project/src',
     publicPath: '/',
     hot: true,
     historyApiFallback: true,
     headers: { 'Access-Control-Allow-Origin': '*' },
     watchOptions: { aggregateTimeout: 0 },
     stats: { children: false, colors: true, reasons: true },
     noInfo: true,
     quiet: true },
  ........................

Hm... I don't know. Try to ask @sokra

@vyorkin The part you quoted there is your dev server config, not your webpack config. stats: { children: false } goes alongside the part of your config with entry, output, resolve, module, etc.

@ColCh @warrenrumak stats.toString({ children: false })); fixed it, thanks

I've updated https://github.com/webpack/docs/wiki/node.js-api to include options.children.

@sokra or anyone with permission.. can we build the documentation in gh-pages? Thanks

Extract Text Webpack Plugin is still producing quite a large amount of duplicated and unhelpful log messages. stats: {children: false} in the config and using the CLI directly.

I'm running "extract-text-webpack-plugin": "0.9.1" and "webpack": "1.12.9".

If helpful, I've got my full config and log output in this gist

Thanks, works for me. I use this for minimal logging (only valid/invalid and errors):

    stats: {
      // minimal logging
      assets: false,
      colors: true,
      version: false,
      hash: false,
      timings: false,
      chunks: false,
      chunkModules: false,
      children: false
    }

{ children: false } not work when webpack with multi config. I use follow hack:

// Hack: remove extract-text-webpack-plugin log
compiler.plugin('done', function(stats) {
  stats.stats.forEach((stat) => {
    stat.compilation.children = stat.compilation.children.filter((child) => {
      return child.name !== 'extract-text-webpack-plugin';
    });
  });
});

@helloyou2012 Could you provide a more complete example? We're drowning in hundreds of lines of this plugin. The other examples here have no effect.

Nevermind, I found the culprit in some cleverly disguised require of another webpack configuraton.

@palnes When config is array and { children: false } will block all outputs. While { children: true } will show empty logs.

Demo: https://github.com/helloyou2012/webpack-demos/tree/master/extract-text

Can someone try with webpack 2?

If you are not using webpack dev server, you can pass children: false to the stats.toString method in your webpack change handler as a workaround. Example:

$.util.log(stats.toString({
  colors: true,
  chunks: false,
  hash: false,
  version: false,
  children: false
}));

Can someone try with webpack 2?

Can confirm it works with webpack@2.2.1 + extract-text-webpack-plugin@2.0.0.

Piggybacking off of @helloyou2012 's solution which didn't work for me in webpack 2:

function SuppressExtractTextLog () {}
SuppressExtractTextLog.prototype.apply = function(compiler){
  compiler.plugin('done', function(stats) {
    stats.compilation.children = stats.compilation.children.filter((child) => {
      return child.name !== 'extract-text-webpack-plugin';
    });
  });
}

It would be great to have an option to disable the verbosity though! I don't want to disable all children stats because that also turns off things like linting output.

Adding { stats: { children: false } } won't work well when used in conjunction with the Webpack MultiCompiler, which outputs each config as its own child. All of the output is hidden in this scenario.

Output w/ Children:

Child CLIENT:
    Hash: d331439e8f84534232f5
    Version: webpack 1.14.0
    Time: 11793ms
                                               Asset       Size  Chunks             Chunk Names
                                    images/close.svg  252 bytes          [emitted]
                                images/hamburger.svg  282 bytes          [emitted]  
       scripts/client.d331439e8f84534232f5.bundle.js     451 kB       0  [emitted]  client
       scripts/common.d331439e8f84534232f5.bundle.js    1.49 MB       1  [emitted]  common
    scripts/polyfills.d331439e8f84534232f5.bundle.js     379 kB       2  [emitted]  polyfills
       scripts/vendor.d331439e8f84534232f5.bundle.js    4.43 kB       3  [emitted]  vendor
       styles/client.d331439e8f84534232f5.bundle.css     254 kB       0  [emitted]  client
                                          stats.json    1.65 kB          [emitted]  
       [0] multi common 88 bytes {1} [built]
        + 494 hidden modules
    
    Child extract-text-webpack-plugin:
            + 2 hidden modules
    Child extract-text-webpack-plugin:
            + 2 hidden modules
    Child extract-text-webpack-plugin:
            + 2 hidden modules
    Child extract-text-webpack-plugin:
            + 2 hidden modules
    Child extract-text-webpack-plugin:
            + 2 hidden modules
    Child extract-text-webpack-plugin:
            + 2 hidden modules
    Child extract-text-webpack-plugin:
            + 2 hidden modules
    Child extract-text-webpack-plugin:
            + 2 hidden modules
    Child extract-text-webpack-plugin:
            + 2 hidden modules
    Child extract-text-webpack-plugin:
            + 2 hidden modules
    Child extract-text-webpack-plugin:
            + 2 hidden modules
    Child extract-text-webpack-plugin:
            + 2 hidden modules
    Child extract-text-webpack-plugin:
            + 2 hidden modules
    Child extract-text-webpack-plugin:
            + 2 hidden modules
    Child extract-text-webpack-plugin:
            + 2 hidden modules
    Child extract-text-webpack-plugin:
            + 2 hidden modules
    Child extract-text-webpack-plugin:
            + 2 hidden modules
    Child extract-text-webpack-plugin:
            + 2 hidden modules
    Child extract-text-webpack-plugin:
            + 2 hidden modules
    Child extract-text-webpack-plugin:
            + 2 hidden modules
    Child extract-text-webpack-plugin:
            + 2 hidden modules
    Child extract-text-webpack-plugin:
            + 2 hidden modules
    Child extract-text-webpack-plugin:
            + 2 hidden modules
    Child extract-text-webpack-plugin:
            + 2 hidden modules
    Child extract-text-webpack-plugin:
            + 2 hidden modules
    Child extract-text-webpack-plugin:
            + 2 hidden modules
    Child extract-text-webpack-plugin:
            + 2 hidden modules
    Child extract-text-webpack-plugin:
            + 2 hidden modules
    Child extract-text-webpack-plugin:
            + 2 hidden modules
Child SERVER:
    Hash: 532b6d31366d08716f19
    Version: webpack 1.14.0
    Time: 11260ms
                            Asset       Size  Chunks             Chunk Names
                 images/close.svg  252 bytes          [emitted]
             images/hamburger.svg  282 bytes          [emitted]  
                 server.bundle.js    6.35 MB       0  [emitted]  server
        + 1209 hidden modules
Child ECM:
    Hash: 420fb47b15e5f3474c3d
    Version: webpack 1.14.0
    Time: 11432ms
                          Asset     Size  Chunks             Chunk Names
    scripts/ecmclient.bundle.js   813 kB       0  [emitted]  ecmclient
    styles/ecmclient.bundle.css  7.34 kB       0  [emitted]  ecmclient
        + 100 hidden modules
    Child extract-text-webpack-plugin:
            + 2 hidden modules
    Child extract-text-webpack-plugin:
            + 2 hidden modules

Output w/out Children:

Hash: d331439e8f84534232f5532b6d31366d08716f19420fb47b15e5f3474c3d
Version: webpack 1.14.0

@coreyleelarson Looks like not add the config stats: { children: false } in devServer config or webpack.base config file, stats: { children: false } it's works fine for me at webpack 1.14.0 and webpack 2

Here is devServer config:

...
var app = express()
var compiler = webpack(webpackConfig)
...
var devMiddleware = require('webpack-dev-middleware')(compiler, {
  publicPath: webpackConfig.output.publicPath,
  stats: {
    colors: true,
    chunks: false,
    children: false
  }
})
...
app.use(devMiddleware)
...

@donaldpipowitch worked fine, thanks

yeah. as stated, the idea isn't to silence the output of all plugins... because some of it is desired (eslint for instance). So the stats: { children: false } setting doesn't really work for me and probably others.

stats: "errors-only" does not work as expected with extract-text-webpack-plugin in webpack 3 https://webpack.js.org/configuration/stats/ I have also tried

stats: {
    // minimal logging
    assets: false,
    colors: true,
    version: false,
    hash: false,
    timings: false,
    chunks: false,
    chunkModules: false,
    children: false
  }

without success. I move to reopen @d3viant0ne

Also see duplicate #97

So, there are still no good solutions from extract-text-webpack-plugin, only bad one?