【问题标题】:yeoman grunt build error with parsing template使用解析模板的 yeoman grunt 构建错误
【发布时间】:2016-01-24 19:31:43
【问题描述】:

我使用 yeoman 生成器创建了 webapp。在我运行的新应用程序上:grunt build --verbose 并且出现此错误:

Files: app/index.html -> html
Options: dest="dist"
Going through app/index.html to update the config
Looking for build script HTML comment blocks
Warning: An error occurred while processing a template (Unexpected token )). Use --force to continue.

Aborted due to warnings.

这是我的 package.json

{
  "private": true,
  "devDependencies": {
    "autoprefixer": "^6.0.2",
    "babel-preset-es2015": "^6.1.18",
    "grunt": "^0.4.5",
    "grunt-babel": "^6.0.0",
    "grunt-browser-sync": "^2.1.2",
    "grunt-concurrent": "^1.0.0",
    "grunt-contrib-clean": "^0.6.0",
    "grunt-contrib-concat": "^0.5.1",
    "grunt-contrib-copy": "^0.8.0",
    "grunt-contrib-cssmin": "^0.12.2",
    "grunt-contrib-htmlmin": "^0.4.0",
    "grunt-contrib-imagemin": "^1.0.0",
    "grunt-contrib-uglify": "^0.8.0",
    "grunt-contrib-watch": "^0.6.1",
    "grunt-eslint": "^17.0.0",
    "grunt-filerev": "^2.2.0",
    "grunt-mocha": "^0.4.12",
    "grunt-newer": "^1.1.0",
    "grunt-postcss": "^0.6.0",
    "grunt-sass": "^1.0.0",
    "grunt-svgmin": "^2.0.1",
    "grunt-usemin": "^3.0.0",
    "grunt-wiredep": "^2.0.0",
    "jit-grunt": "^0.9.1",
    "time-grunt": "^1.1.0"
  },
  "engines": {
    "node": ">=0.10.0"
  },
  "scripts": {
    "test": "grunt test"
  },
  "eslintConfig": {
    "extends": [
      "eslint:recommended"
    ],
    "env": {
      "node": true,
      "browser": true,
      "es6": true,
      "jquery": true,
      "mocha": true
    },
    "rules": {
      "quotes": [
        2,
        "single"
      ],
      "indent": [
        2,
        2
      ]
    }
  }
}

谁能帮帮我?我之前所做的只是更新到 newset npm 版本和 yeoman 太......

编辑

这是 index.html 文件,我也尝试了非常基本的 html,只有 html 头和正文标签。

<!doctype html>
<html lang="">
  <head>
    <meta charset="utf-8">
    <title>test2</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">

  </head>
  <body>

  </body>
</html>

【问题讨论】:

  • 我假设 index.html 中出现错误。你能添加这个文件的代码吗?

标签: gruntjs yeoman grunt-usemin


【解决方案1】:

检查您的imagemin 任务以获取额外的%

见:https://stackoverflow.com/a/35090387/5858382

【讨论】:

猜你喜欢
  • 2016-01-23
  • 2014-05-12
  • 1970-01-01
  • 2018-01-27
  • 1970-01-01
  • 1970-01-01
  • 2014-01-06
  • 1970-01-01
  • 2014-02-09
相关资源
最近更新 更多