【问题标题】:React dead code elimination not performed on Meteor deployment using MontiAPM's recommended minify-js-sourcemaps使用 MontiAPM 推荐的 minify-js-sourcemaps 在 Meteor 部署中未执行 React 死代码消除
【发布时间】:2021-08-13 00:08:49
【问题描述】:

我的 MontiAPM 订阅检测到我的生产部署没有执行死代码消除,我怀疑 minify-js-sourcemaps 可能是问题所在。

这里是 MontiAPM 错误的链接: https://app.montiapm.com/et/8bf36546-da75-4a3b-9c00-2b0b168e619e/svZHraoAqMKmQcpkm

在调查错误时,我发现 Meteor 的这个已关闭问题,表明它已在 minifier-js 的默认版本中修复: 流星/流星#9260

但是,根据 MontiAPM 的建议,我的项目正在使用(最新版本的)minify-js-sourcemaps 而不是 minifier-js: https://github.com/radgrad/radgrad2/blob/master/app/.meteor/versions#L110-L114

我请求有关如何诊断/解决此问题的指导。

【问题讨论】:

    标签: reactjs meteor minify meteor-react


    【解决方案1】:

    问题是我的 mup.js 文件的 buildOptions 字段中有 debug: true 。设置 debug: false 可以缩小代码从而解决问题。

    感谢 Meteor Up 团队帮助我解决了这个问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-10-01
      • 2015-06-14
      • 2017-03-15
      • 1970-01-01
      • 1970-01-01
      • 2016-03-16
      • 1970-01-01
      相关资源
      最近更新 更多