我对弓箭和咕哝都很陌生,所以基本的东西对我不好。
我有bower install --save bootstrap,并希望grunt-bower-install更新我的js & css文件,根据文档
它可以很好地处理.js文件,并且我已经成功地更新了index.html。
<!-- bower:js -->
<script src="bower_components/bootstrap/dist/js/bootstrap.js"></script>
<!-- endbower -->但是我的dist/application.css .just没有改变(只是空文件)
我的Gruntfile.coffee
module.exports = (grunt) ->
grunt.initConfig
pkg: grunt.file.readJSON('package.json')
coffee:
compile:
files:
'dist/application.js': 'app/assets/javascripts/*.coffee'
bowerInstall:
target:
src: [
'index.html'
'dist/application.css'
]
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-bower-install'我应该对我的application.css做什么自动要求引导的.css文件?
发布于 2015-05-27 07:20:00
完成了!
把这个放在head标签里就行了
<!-- bower:css -->
<!-- endbower -->
<!-- bower:js -->
<!-- endbower -->并再次运行grunt bowerInstall
发布于 2017-03-01 12:44:49
更改bower.json文件,位于bower_模块/引导程序/
在后面添加另一个属性:
"overrides": {
"bootstrap": {
"main": [
"dist/css/bootstrap.css"
]
}
}重写告诉bowerInstall插件在dist/css/bootstrap/css中查找文件,以便在html文件中创建链接路径。
第二个选项是通过在bower.json文件中指定引导版本,将引导版本降到3.3.4。
https://stackoverflow.com/questions/30465295
复制相似问题