Reputation: 50712
Generally I am using CDN (or nuget) for including Bootstrap or other client side libraries to my website
Recently I read about NPM/Bower and other modern package-management tools, and decided to try
After some time of surfing and investigating I am now completely puzzled, how to just download and include bootstrap distrib css/js files to my page like it was....
1 st Try, I install bootstrap with NPM
, it downloads whole Bootstrap with all sources/modules and etc to the node_module
directory... well, I found distributions in node_modules/Bootstrap/dist
folder
now questions:
node_modules/Bootstrap/dist/ css and js
files to my site?node_modules
folder with website?if No, and I know that npm package is modular and bla bla bla and should be included by require("bootstrap")
than lots of other questions
require("bootstrap")
node js or some oter js function?require("bootstrap")
in html in script tag? create some js and include it or what?2 nd try, Ok than I understand that npm might be package management for NodeJs server side, and got bower... but again it downloads the same files to another folder bower_components and again same questions...
Upvotes: 3
Views: 935
Reputation: 5773
As you mentioned, bower works well for this use case. Change the destination of the bower_components directory as described here How to change bower's default components folder?
then include as you normally would. Do not use the require function since that is for nodejs server side only.
Upvotes: 1