Bower-如何仅安装jquery.js而不是整个软件包? [英] Bower - How to install jquery.js only and not the whole package?

查看:135
本文介绍了Bower-如何仅安装jquery.js而不是整个软件包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用bower install jquery命令,我在jquery文件夹中得到的是dist文件夹,其中包含jquery.jsjquery.min.jssrc文件夹中包含构成jQuery的所有js文件,我想,bower.json和许可证文件. 如何仅安装jquery.jsjquery.min.js?

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?

推荐答案

您可以使用 bower-installer bower.json文件中的额外安装"部分,例如:

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/"
        }
    }
}

通过安装"部分,您可以指定安装文件夹.
然后,它会自动创建文件夹(如果不存在),并仅将所需的文件(如jquery.jsnormalize.css)安装到指定的"css"或"js"文件夹.

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.

这篇关于Bower-如何仅安装jquery.js而不是整个软件包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆