如何使用 Composer 安装 jQuery?
2022-08-30 09:30:48
我已经能够安装没有 composer.json 文件的存储库,如下所示:
{
"type": "package",
"package": {
"name": "yahoo/yui-compressor",
"version": "2.0.4",
"dist": {
"url": "http://yui.zenfs.com/releases/yuicompressor/yuicompressor-2.4.7.zip",
"type": "zip"
}
}
},
我从文档中取了“类型”:“zip”部分,但我找不到许多其他类型。例如,我需要安装jQuery,但我不知道该在类型中放入什么(“js”不起作用)。
{
"type": "package",
"package": {
"name": "jquery/jquery",
"version": "1.7.2",
"dist": {
"url": "http://code.jquery.com/jquery-1.7.2.js",
"type": "js"
}
}
}
有什么想法吗?
编辑:我正在添加完整的解决方案来帮助@CMCDragonkai:
"require": {
"vendorname/somefile": "1.2.3",
},
"repositories": [
{
"type": "package",
"package": {
"name": "vendorname/somefile",
"version": "1.2.3",
"dist": {
"url": "http://example.com/somefile.txt",
"type": "file"
}
}
}
]