I'm using yeoman's backbone generator, and I ran this:
bower install backbone.localStorage -S
And I manually had to insert this into index.html:
<script src="bower_components/backbone.localStorage/backbone.localStorage.js"></script>
Is there some way for bower to automatically insert <script>
tags? I thought part of the benefit of bower was not having to figure out in which order to include your scripts?
Just run
grunt bowerInstall
after bower install
You can use wiredep to push dependencies into your HTML code from bower. This is the approach used by generator-angular when you run yo angular
:
var wiredep = require('wiredep'); wiredep({ directory: 'app/bower_components', bowerJson: JSON.parse(fs.readFileSync('./bower.json')), ignorePath: 'app/', htmlFile: 'app/index.html', cssPattern: '<link rel="stylesheet" href="{{filePath}}">' });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With