Edit: The problem occurs upon 'grunt serve' not upon closing and re-opening webstorm as I first suspected.
In the code block below, I manually added the ui-bootstrap.js files. The rest was scaffolded using Yeoman. When, index.html defaults back to its original state (removing the code I added). However, the rest of the project saves and reloads normally. What is causing this and how to I remedy it?
<!-- build:js scripts/vendor.js -->
<!-- bower:js -->
<script src="bower_components/jquery/jquery.js"></script>
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/sass-bootstrap/dist/js/bootstrap.js"></script>
<script src="bower_components/angular-resource/angular-resource.js"></script>
<script src="bower_components/angular-cookies/angular-cookies.js"></script>
<script src="bower_components/angular-sanitize/angular-sanitize.js"></script>
<script src="bower_components/angular-route/angular-route.js"></script>
<script src="bower_components/angular-bootstrap/ui-bootstrap.js"></script>
<script src="bower_components/angular-bootstrap/ui-bootstrap-tpls.js"></script>
<!-- endbower -->
<!-- endbuild -->
I believe this is because grunt-bower-install
runs on grunt serve
. Anything between <!-- bower:js -->
and <!-- endbower -->
is controlled by grunt-bower-install
. That's the Grunt task that looks for dependencies from your Bower packages, and injects them into your HTML.
You can either do everything manually -- find and insert all the scripts you need in your HTML -- and remove grunt-bower-install
(uninstall and remove from Gruntfile.js
), or place some of your dependencies manually outside of the comment block.
bower install angular-ui-bootstrap-bower
Can fix this problem.
The reason is that the lib you installed dosen't configure the main js file in the config file named "bower_components/ui-bootstrap/bower.json
".