Webpack-dev-server忽略node_modules

时间:2016-09-01 04:22:29

标签: webpack webpack-dev-server

运行webpack-dev-server时:

webpack-dev-server --config ./webpack.config.dev.js

终端将像这些,很多控制台一样控制台。 如何忽略node_modules?

bundle.js  4.11 MB       0  [emitted]  main
chunk    {0} bundle.js (main) 1.43 MB [rendered]
    [0] multi main 64 bytes {0} [built]
    [1] ./~/babel-polyfill/lib/index.js 907 bytes {0} [built]
    [2] ./~/core-js/shim.js 7.38 kB {0} [built]
    [3] ./~/core-js/modules/es6.symbol.js 8.93 kB {0} [built]
    ...
   [18] ./~/core-js/modules/_redefine.js 1.05 kB {0} [built]
   [19] ./~/core-js/modules/_uid.js 158 bytes {0} [built]
   [20] ./~/core-js/modules/_ctx.js 505 bytes {0} [built]
   [21] ./~/core-js/modules/_a-function.js 120 bytes {0} [built]
   ...
  [648] ./~/ansi-regex/index.js 135 bytes {0} [built]
  [649] (webpack)/hot/only-dev-server.js 2.25 kB {0} [built]
  [650] (webpack)/hot/log-apply-result.js 813 bytes {0} [built]

1 个答案:

答案 0 :(得分:0)

我修好了。在我的webpack.config.dev.js中添加如下配置:

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