webpack eslint 错误信息

webpack eslint error messages

这可能是一个奇怪的问题,但由于我是 Webpack 的新手,我想知道这是否正常,例如eslint 错误消息似乎很长,错误消息上方有一些 "chunks" ?在某些情况下,顶部的 "chunks" 甚至比我的示例中的还要长,我找不到任何方法来摆脱它们(我不明白为什么我需要它们)。有没有我忘记添加的配置?

我正在使用 VueJS webpack simple template 并向其添加了 eslint 加载程序。我还尝试了 Webpack 的 Stylelint 插件,错误消息看起来是一样的(由于所有 "chunks" 而造成混淆/不清楚)。

   Hash: 84d43d1c3599310c692c
    Version: webpack 2.1.0-beta.28
    Time: 227ms
    chunk    {0} build.js (main) 481 kB [entry]
       [46] ./~/babel-loader/lib!./~/vue-loader/lib/selector.js?type=script&index=0!./src/component/Component.vue 182 bytes {0} [built]
       [88] ./src/component/Component.vue 1.76 kB {0} [built] [1 error]
       [89] ./~/vue-loader/lib/template-compiler.js?id=data-v-104cb767!./~/vue-loader/lib/selector.js?type=template&index=0!./src/component/Component.vue 412 bytes {0} [built]
         + 94 hidden modules

    ERROR in ./src/App.vue

    /Users/dd/Documents/vue/src/App.vue
      16:5   error  Expected indentation of 4 spaces but found 2  indent
      19:8   error  Missing semicolon                             semi
      21:4   error  Missing semicolon                             semi

    ✖ 3 problems (3 errors, 0 warnings)

     @ ./src/main.js 2:0-28
     @ multi main

    ERROR in ./src/component/Component.vue

    /Users/dd/Documents/vue/src/component/Component.vue
       9:5  error  Expected indentation of 4 spaces but found 2  indent
      13:8  error  Missing semicolon                             semi
      15:4  error  Missing semicolon                             semi

    ✖ 3 problems (3 errors, 0 warnings)

     @ ./~/babel-loader/lib!./~/vue-loader/lib/selector.js?type=script&index=0!./src/App.vue 11:0-50
     @ ./src/App.vue
     @ ./src/main.js
     @ multi main

来自Webpack 2 docs on Stats

The stats option lets you precisely control what bundle information gets displayed. This can be a nice middle ground if you don't want to use quiet or noInfo because you want some bundle information, but not all of it.

在您的 webpack.config.js 中,您可以在具有 属性 stats.

的顶级导出中提供一个 devServer 对象

要关闭块的显示,请将其添加到您的配置中:

module.exports = {
  ...,

  devServer: {
    stats: {
      chunks: false
    }
  },

  ...
}