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

gskalinskii picture gskalinskii · Mar 17, 2014 · Viewed 31.6k times · Source

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?

Answer

Yves picture Yves · May 24, 2014

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.