0

添加Karma-webpackwebpack进入我的业力茉莉花环境后,我得到了很多新信息。如 :

webpack: Compiling...
Hash: ab5614b7ed14037096b5
Version: webpack 1.14.0
Time: 42ms
          Asset    Size  Chunks       Chunk Names
test-context.js  260 kB       0       test-context.js
chunk    {0} test-context.js (test-context.js) 233 kB
    [0] ./test/test-context.js 120 bytes {0}
    [1] ./~/babel-polyfill/lib/index.js 833 bytes {0}
    [2] ./~/babel-polyfill/~/core-js/shim.js 7.38 kB {0}
    [3] ./~/babel-polyfill/~/core-js/modules/es6.symbol.js 8.93 kB {0}
    [4] ./~/babel-polyfill/~/core-js/modules/_global.js 322 bytes {0}
    [5] ./~/babel-polyfill/~/core-js/modules/_has.js 117 bytes {0}
    [6] ./~/babel-polyfill/~/core-js/modules/_descriptors.js 177 bytes {0}
    [7] ./~/babel-polyfill/~/core-js/modules/_fails.js 99 bytes {0}
    [8] ./~/babel-polyfill/~/core-js/modules/_export.js 1.6 kB {0}
    [9] ./~/babel-polyfill/~/core-js/modules/_core.js 117 bytes {0}
   [10] ./~/babel-polyfill/~/core-js/modules/_hide.js 288 bytes {0}
...
  [290] ./~/babel-polyfill/~/core-js/modules/_path.js 38 bytes {0}
  [291] ./~/babel-polyfill/~/core-js/modules/web.immediate.js 164 bytes {0}
  [292] ./~/babel-polyfill/~/core-js/modules/web.dom.iterable.js 881 bytes {0}
  [293] ./~/regenerator-runtime/runtime.js 23.8 kB {0}
  [294] ./~/process/browser.js 5.3 kB {0}
  [295] ./~/babel-polyfill/~/core-js/fn/regexp/escape.js 107 bytes {0}
  [296] ./~/babel-polyfill/~/core-js/modules/core.regexp.escape.js 232 bytes {0}
  [297] ./~/babel-polyfill/~/core-js/modules/_replacer.js 227 bytes {0}
  [298] ./test -spec\.js$ 160 bytes {0} [built]

其中一些看起来只是在编译我的脚本(text-context.js),但我不确定其余的。我发现将以下内容添加到karma.config.js将抑制所有这些信息。

webpackMiddleware: {
      noInfo: true
    }

我的问题,显示的所有信息是什么?压制这些信息有什么坏处吗?

4

1 回答 1

1

你可以通过查看stats来了解信息的含义。你也可以配置webpackMiddleware.stats让webpack只显示你想要的信息。

就像 :

webpackMiddleware: {
      stats: 'minimal'
}
于 2017-03-21T02:13:50.503 回答