yeoman grunt构建错误解析模板

时间:2016-01-24 19:31:43

标签: gruntjs yeoman grunt-usemin

我使用yeoman生成器创建了webapp。在新鲜的应用程序上,我运行:<div class="row">并且出现此错误:

grunt build --verbose

这是我的package.json

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.

任何人都可以帮助我吗?我以前做的只是新设npm版本和也是yeoman ...

修改

这是index.html文件,我也试过非常基本的html,只有html头部和正文标记。

{
  "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
      ]
    }
  }
}

1 个答案:

答案 0 :(得分:0)

检查imagemin任务是否有额外的%

请参阅:https://stackoverflow.com/a/35090387/5858382