Arsen Mkrtchyan
Arsen Mkrtchyan

Reputation: 50712

get bootstrap by NPM and include to html

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:

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

Answers (1)

cs01
cs01

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

Related Questions