yeoman 1.1.2 似乎不适用于上面的答案。
更改 Gruntfile.js 并添加:
copy: {
dist: {
files: [{
expand: true,
dot: true,
cwd: '<%= yeoman.app %>',
dest: '<%= yeoman.dist %>',
src: [
'*.{ico,png,txt}',
'.htaccess',
'*.html',
'views/{,*/}*.html',
'bower_components/**/*',
'images/{,*/}*.{webp}',
'fonts/*',
]
}, {
expand: true,
cwd: '.tmp/images',
dest: '<%= yeoman.dist %>/images',
src: ['generated/*']
}, { <--- add this start
expand: true,
cwd: '<%= yeoman.app %>/bower_components/bootstrap/fonts',
dest: '<%= yeoman.dist %>/fonts',
src: '*.*'
}] <--- end add
},
styles: {
添加一个新块,将 Bower 组件中的字体复制到 dist 目录中。
如果您使用 sass 发行版,请将 bootstrap 替换为 sass-bootstrap。