skinnybrit51 skinnybrit51 - 20 days ago 8x
jQuery Question

How do I load bootstrap using npm?

I have a npm project that uses jquery.

var $ = require('jquery');

I also have an index html file that references bootstrap.

<link href="//" rel="stylesheet"/>

<script type="text/javascript" src="my-script.js"></script>
<script src="//"></script>

<script src="//"></script>

Now do I need to a separate load for jquery for bootstrap as it depends on it? I was recently using
instead of
and I did not need the separate load.

Can anyone recommend a loading pattern for bootstrap with use with require?


Bootstrap is now a supported node package by the bootstrap guys.

What this means is you can now require bootstrap in code. So.

npm install bootstrap --save

npm install jquery --save


var $ = require('jquery');
window.$ = $;