Using bower install jquery
command what I get in jquery
folder are dist
folder with jquery.js
and jquery.min.js
, src
folder with the whole bunch of js files that make up jquery, I suppose, bower.json
and licence files.
How could I install jquery.js
or jquery.min.js
only?

- 967
- 2
- 11
- 17
3 Answers
You can use bower-installer and an extra "install" section in your bower.json
file like:
{
"name": "test",
"version": "0.0.0",
"dependencies": {
"jquery": "1.11.1",
"normalize-css": "latest"
},
"install" : {
"path" : {
"js": "_js/",
"css": "_css/"
}
}
}
With that "install" section you can specify the install folder.
It than automatically creates the folders - if they're not existing - and installs just the required files like jquery.js
or normalize.css
to the specified "css" or "js" folder.
-
Please post a specific example for jquery – dude Jun 19 '15 at 07:13
-
Isn't that example working for you @julmot ? Maybe the [answer](http://stackoverflow.com/a/26611521/1303917) of Colin below is more helpful. – Yves Jun 19 '15 at 09:22
-
No because in the repository is no "jquery.min.js" or "jquery.js" file. Don't know where the "dist"-folder comes from, however I am not able to filter only the dist-folder with this extension. – dude Jun 19 '15 at 09:56
-
Kind of a tedious solution since most of the packages I use I have to customize which files are installed, but better than nothing – andrewtweber Sep 21 '15 at 04:07
-
2What about minified? – Michael Ramos Dec 29 '15 at 19:05
You can also use this parameter:
"ignore": [
"source",
"spec",
".bowerrc",
".gitignore",
".jshintignore",
".jshintrc",
"bower.json",
"gruntfile.js",
"package.json",
"README.md"
],
This will ignore the unecessary files to work when you download files.

- 894
- 12
- 35
-
17+1 However, an explanation of how & why this works would probably make this answer better understood & give you more upvotes – Precastic Jun 09 '15 at 10:46
From the jQuery download page:
The jQuery Bower package contains additional files besides the default distribution. In most cases you can ignore these files, however if you wish to download the default release on it's own you can use Bower to install jQuery from one of the above urls instead of the registered package. For example, if you wish to install just the compressed jQuery 2.1.0, you can install just that file with the following command:
bower install http://code.jquery.com/jquery-2.1.0.min.js

- 22,328
- 17
- 103
- 197
-
1Not a great package name, strange index.js file, but it works perfectly – Nicolas Zozol Mar 07 '15 at 21:13
-
1as @NicolasZozol points out this is indeed interesing but instead of creating a `jquery-2.1.0.min.js` file in the specified bower directory, it creates a directory named `jquery-2.1.0.min` with inside the `index.js` along with a `.bower.json` file. Looking at the latter file, I suppose the the former is named after the `"main": "index.js"` rule. Is there anyway to override this? – Gruber Sep 29 '15 at 00:53
-
This works. (add a `--save`makes sense). Also worked for me e.g. for `bower install https://code.jquery.com/color/jquery.color-2.1.2.min.js --save` – Frank N Jan 10 '16 at 17:09