Bower.json installs only one file

I'm a newbie newbie. How to download only one file from GitHub instead of the whole set of files? I just need the latest fuelux.min.js file from here ( https://raw.githubusercontent.com/ExactTarget/fuelux/master/dist/js/fuelux.min.js ) and I want to put it in my plugins directory.

{ "name": "my app", "version": "1.0", "dependencies": { "angular-local-storage": "latest", "fuelux":"latest" }, "install" : { "path" : { "js": "plugins" } } } 
+1
source share
4 answers

The idea of ​​the conversation is that you include all published contents of the repository / package, which is then installed by the developer through bower. You use your build system (grunt, broccoli, etc.) to select any files from what should be included in your own distribution.

If for some reason you really only need one file, you just need to include it in your application manually.

+6
source

I agree with the answer provided by @Leeft. In case of a situation when you need only one file, you can refer to the Raw file specified in github in your installation.

 bower install https://raw.githubusercontent.com/chrishunt/retinajs/master/src/retina.js --save 

This will include the dependency in your bower.json file

 "dependencies": { "retina": "https://raw.githubusercontent.com/chrishunt/retinajs/master/src/retina.js" } 
+6
source

If you use wiredep with a gazebo, you can add an override section to your bower.json package, for example:

 "overrides": { "fuelux": { "main": [ "dist/js/fuelux.min.js" ] } } 
+2
source

I agree with simple that I don't like NPM and Bower, because they inflate the file size in each project, sometimes when not needed.

Take a look at this NPM package, which allows you to install specific files, not the entire repo:

https://github.com/blittle/bower-installer

0
source

Source: https://habr.com/ru/post/989253/


All Articles