Twitter Bootstrap 3.0.1 将 bower.json 的“main”属性更改为如下所示:
"main": ["./dist/js/bootstrap.js", "./dist/css/bootstrap.css", "./dist/fonts/*"],
他们在 3.0.1 中添加了“./dist/fonts/*”项 - 它在 3.0.0 中不存在。
现在,当我从 Gruntfile 运行 bower:install 时,出现以下错误:
Running "bower:install" (bower) task
bower cached https://github.com/twbs/bootstrap.git#3.0.1
bower validate 3.0.1 against https://github.com/twbs/bootstrap.git#>= 3.0.0
bower cached https://github.com/components/jquery.git#2.0.3
bower validate 2.0.3 against https://github.com/components/jquery.git#>= 2.0.0
bower cached https://github.com/components/jquery.git#2.0.3
bower validate 2.0.3 against https://github.com/components/jquery.git#>= 1.9.0
bower install jquery#2.0.3
bower install bootstrap#3.0.1
>> Installed bower packages
grunt-bower copying bower_components/bootstrap/dist/js/bootstrap.js -> public/bootstrap/bootstrap.js
grunt-bower copying bower_components/bootstrap/dist/css/bootstrap.css -> public/bootstrap/bootstrap.css
/Users/hoytk/git/titanium_ui/node_modules/grunt-bower-task/node_modules/bower/node_modules/tmp/lib/tmp.js:261
throw err;
^
Error: ENOENT, no such file or directory 'bower_components/bootstrap/dist/fonts/*'
似乎 grunt-bower-task 无法处理 ./dist/fonts/*,但我认为我缺少一些简单的东西。这是我的 Gruntfile.js:
module.exports = function(grunt) {
// Project configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
bower: {
install: {
options: {
targetDir: './public',
verbose: true
}
}
}
});
// Load bower task plugin
grunt.loadNpmTasks('grunt-bower-task');
// The default task - install the bower dependencies
grunt.registerTask('default', ['bower:install']);
}