您正面临 Yeoman 错误build
尚未确定的任务。我相信没有干净的解决方案,因此这里有一些解决方法。
首先,图像转速:
只需从其中删除图像rev
任务,你就可以开始了。
rev: {
dist: {
files: {
src: [
'<%= yeoman.dist %>/scripts/{,*/}*.js',
'<%= yeoman.dist %>/styles/{,*/}*.css',
// '<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}', <- remove that line
'<%= yeoman.dist %>/styles/fonts/*'
]
}
}
},
其次,bootstrap-sass 字体不会复制到 dist 文件夹中。我花了几个小时研究这个错误,但找不到合适的解决方案。最后我决定添加一条新规则copy
task:
copy: {
dist: {
files: [{
// your existing rules...
},
// add this rule to copy the fonts:
{
expand: true,
flatten: true,
cwd: '<%= yeoman.app %>',
dest: '<%= yeoman.dist %>/fonts',
src: ['bower_components/sass-bootstrap/fonts/*.*']
}]
},
...
}
Run grunt build
在这些更改之后再次进行,它应该可以工作。