首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Webpack 4:日志

Webpack 4:日志
EN

Stack Overflow用户
提问于 2018-07-03 20:12:44
回答 1查看 1.1K关注 0票数 4

在与webpack一起构建代码时,我遇到了下面提到的日志

代码语言:javascript
复制
[../node_modules/lodash/lodash.js] 504 KiB {main} [built]
    harmony import specifier lodash [./client.js] 82:13-14
    harmony import specifier lodash [./selectors/buyInsuranceSelectors.js] 49:42-43
    harmony import specifier lodash [./client.js] 84:7-8
    harmony import specifier lodash [./client.js] 86:6-7
    harmony import specifier lodash [./client.js] 88:6-7
    harmony import specifier lodash [./client.js] 97:27-28
    harmony import specifier lodash [./client.js] 99:16-17
    harmony import specifier lodash [./client.js] 129:19-20
    harmony import specifier lodash [./client.js] 164:29-30
    harmony side effect evaluation lodash [./store/configureStore.js] 5:0-23
    harmony import specifier lodash [./store/configureStore.js] 12:23-24
    harmony import specifier lodash [./store/configureStore.js] 51:14-15
    harmony side effect evaluation lodash [./selectors/userInfoSelector.js] 8:0-23
    harmony import specifier lodash [./selectors/userInfoSelector.js] 10:25-26
    harmony import specifier lodash [./selectors/userInfoSelector.js] 12:9-10
    harmony side effect evaluation lodash [./services/GTMUtil.js] 8:0-23
    harmony import specifier lodash [./services/GTMUtil.js] 363:27-28
    harmony import specifier lodash [./services/GTMUtil.js] 440:15-16
    harmony import specifier lodash [./services/GTMUtil.js] 452:15-16
    harmony import specifier lodash [./services/GTMUtil.js] 460:15-16

有没有办法删除这些日志,例如"harmony side effect evaluation lodash./services/GTMUtil.js 8:0-23“,因为它们太多了,终端输出变得太拥挤了?

EN

回答 1

Stack Overflow用户

发布于 2018-11-28 07:10:09

要删除这些日志,您可以在您的webpack配置中添加一个统计数据对象。在该对象中,您必须将modules属性设置为false。

所以在你的webpack.config.js中应该是这样的

代码语言:javascript
复制
stats: { 
  modules: false
}

一旦你这样做,这些将被删除。如果您想了解更多信息,请访问以下所有统计数据:https://webpack.js.org/configuration/stats/

票数 6
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51154356

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档