Bower-如何仅安装jquery.js而不是整个软件包? [英] Bower - How to install jquery.js only and not the whole package?
问题描述
使用bower install jquery
命令,我在jquery
文件夹中得到的是dist
文件夹,其中包含jquery.js
和jquery.min.js
,src
文件夹中包含构成jQuery的所有js文件,我想,bower.json
和许可证文件.
如何仅安装jquery.js
或jquery.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.js
或normalize.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屋!