【问题标题】:grunt ngtemplates task 100% cpugrunt ngtemplates 任务 100% cpu
【发布时间】:2014-10-22 14:00:42
【问题描述】:

grunt 任务 ngtemplates 以 100% 的 cpu 利用率无限期地运行(几乎一个小时且未完成)。如果我评论此任务,则构建完成。 并且带有 ngtemplates 的构建任务在另一台机器上运行并完成。 非常感谢任何想法/线索。

节点版本:0.10.29 咕噜声:v0.1.13 咕噜声:v0.4.5

ngtemplates: {
            app: {
                cwd: '<%= yeoman.app %>',
                src: ['views/{,*/}*.html', 'views/inbox/{,*/}*.html' , 'scripts/directives/*.html'],
                dest: 'scripts/templates.js',
                options: {
                    usemin: 'scripts/scripts.js', // <~~ This came from the <!-- build:js --> block
                    htmlmin: {
                        collapseBooleanAttributes: true,
                        collapseWhitespace: true,
                        removeAttributeQuotes: true,
                        removeComments: true, // Only if you don't use comment directives!
                        removeEmptyAttributes: true,
                        removeRedundantAttributes: true,
                        removeScriptTypeAttributes: true,
                        removeStyleLinkTypeAttributes: true
                    }
                }
            }
        }

非常感谢,

【问题讨论】:

  • 如果您需要帮助,请发布您的 Gruntfile.js/task 代码。

标签: node.js angularjs gruntjs


【解决方案1】:

我遇到了同样的问题,我真的不知道,但这应该通过从 "node_modules/grunt-angular-templates/task/lib/compiler.js" 中删除关于 73 .map (this.minify) 的行来解决

【讨论】:

  • 如果你找到了干净的解决方案,记得发布它;)
【解决方案2】:

使用@isidro-martinez 解决方案,您可能会发现真正的问题。我的问题是我的 JS 上未检测到的语法错误。感谢 temporarilly 删除了之前评论中的行,我能够找到它:

我有同样的问题,我真的不知道,但这应该通过从“node_modules/grunt-angular-templates/task/lib/compiler.js”中删除关于 73 .map (this.minify) 的行来解决"

【讨论】:

    【解决方案3】:

    我在使用 grunt 运行构建时遇到了类似的问题,并且 ngtemplates 任务无法完成。

    我可以确认上面注释掉“node_modules/grunt-angular-templates/task/lib/compiler.js”第73行的答案确实允许任务完成。但是,这不太可能是问题(如果您评论该行,您会丢失文件的缩小)。

    对我来说,我的一个 HTML 文件中有一个 HTML 语法错误。我通过w3's HTML validator 运行我的文件发现了这一点。修复语法错误后,ngtemplates 任务为我完成。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-11-28
      • 2013-02-23
      • 2021-10-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-09
      相关资源
      最近更新 更多