I've been using factor-bundle to wrap my common JS files:
browserify index.js bar-charts.js list-filter.js dashboard.js
-p [ factor-bundle -o ../../static/js/index.js -o ../../static/js/bar-chart.js -o ../../static/js/list-filter.js -o ../../static/js/dashboard.js ]
-o ../../static/js/common.js
Then I've included common.js in my HTML, along with a Bootstrap alert:
<div class="alert alert-danger alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
Alert alert!
</div>
<script src="/static/js/common.js"></script>
But the alert close button does not work, so Bootstrap is clearly not being picked up.
if I include the Bootstrap and jQuery from a CDN instead, in the same HTML page, it works just fine:
<div class="alert alert-danger alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
Alert alert!
</div>
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
Here is a JSFiddle with my common.js file, not working: http://jsfiddle.net/2v9easbz/
And here is a JSFiddle with direct CDN links, working fine: http://jsfiddle.net/vkf027z2/
What is wrong with my common.js file?