【问题标题】:Error with jspdf when using grunt uglify使用 grunt uglify 时 jspdf 出错
【发布时间】:2017-06-30 11:08:28
【问题描述】:

我有一个 AngularJS 应用程序,我在其中使用 jspdf 库。当我使用grunt serve 运行开发版时,一切都很好。但是如果我使用 grunt build 构建应用程序,使用 uglify,缩小版本会出现以下错误:

jsPDF PubSub Error Cannot read property 'annotations' of undefined TypeError: Cannot read property 'annotations' of undefined
jsPDF PubSub Error Cannot set property 'pdf' of undefined TypeError: Cannot set property 'pdf' of undefined

"grunt-contrib-uglify": "0.11.1"

我找到了对应的GitHub issue,但是没有用。

【问题讨论】:

  • 检查是否有像 // 这样的 cmets,如果他们被内联,他们会注释掉整个块

标签: javascript gruntjs jspdf uglifyjs grunt-contrib-uglify


【解决方案1】:

我更新了grunt-contrib-uglifygrunt-usemin,它为我解决了这个问题。

【讨论】:

    猜你喜欢
    • 2015-10-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多