Bower - How to install only jquery.js and not the whole package?

Using the bower install jquery command, I get the dist folder in the jquery folder with the jquery.js and jquery.min.js , src folder with the whole bunch of js files that make up jquery, I assume bower.json and license files. How can I install only jquery.js or jquery.min.js ?

+47
jquery bower
Mar 17 '14 at 19:55
source share
3 answers

You can use bower-installer and the additional install section in your bower.json file, for example:

 { "name": "test", "version": "0.0.0", "dependencies": { "jquery": "1.11.1", "normalize-css": "latest" }, "install" : { "path" : { "js": "_js/", "css": "_css/" } } } 

In this "installation" section, you can specify the installation folder.
It automatically creates folders - if they do not exist - and installs only the necessary files, such as jquery.js or normalize.css , in the specified folder "css" or "js".

+41
May 24 '14 at 15:08
source share

You can also use this parameter:

 "ignore": [ "source", "spec", ".bowerrc", ".gitignore", ".jshintignore", ".jshintrc", "bower.json", "gruntfile.js", "package.json", "README.md" ], 

This will ignore unnecessary files that will work when downloading files.

+14
Oct 22 '14 at 18:49
source share

On the jQuery download page:

The jQuery Bower package contains additional files besides the standard distribution. In most cases, you can ignore these files, however, if you want to download the default version on your own, you can use Bower to install jQuery from one of the above URLs instead of the registered package. For example, if you want to install only compressed jQuery 2.1.0, you can install only this file with the following command:

bower install http://code.jquery.com/jquery-2.1.0.min.js

+14
Oct 28 '14 at 2:57
source share



All Articles