仅使用包管理器(Bower,npm,Composer)下载已编译的Bootstrap?

时间:2014-07-20 04:36:39

标签: twitter-bootstrap npm composer-php bower package-managers

有没有办法获得bootstrap/cssbootstrap/jsbootstrap/fonts?但是不介意包括jQuesry。包管理器真的很重要,只要我可以在任何我喜欢的地方安装它并在Mac上运行。

1 个答案:

答案 0 :(得分:3)

使用composer,您可以定义一个软件包存储库,并利用github的svn支持来获取树的一部分。

{
    "name": "slbmeh/bootstrap-deps",
    "description": "An example to get only specific bootstrap files",
    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "slbmeh/bootstrap-css",
                "version": "3.2.0",
                "source": {
                    "type": "svn",
                    "url": "https://github.com/twbs/bootstrap",
                    "reference": "tags/v3.2.0/dist/css"
                }
            }
        },
        {
            "type": "package",
            "package": {
                "name": "slbmeh/bootstrap-fonts",
                "version": "3.2.0",
                "source": {
                    "type": "svn",
                    "url": "https://github.com/twbs/bootstrap",
                    "reference": "tags/v3.2.0/dist/fonts"
                }
            }
        },
        {
            "type": "package",
            "package": {
                "name": "slbmeh/bootstrap-js",
                "version": "3.2.0",
                "source": {
                    "type": "svn",
                    "url": "https://github.com/twbs/bootstrap",
                    "reference": "tags/v3.2.0/dist/js"
                }
            }
        },
        {
            "type": "package",
            "package": {
                "name": "slbmeh/bootstrap-all",
                "version": "3.2.0",
                "source": {
                    "type": "svn",
                    "url": "https://github.com/twbs/bootstrap",
                    "reference": "tags/v3.2.0/dist"
                }
            }
        }
    ],
    "require": {
        "slbmeh/bootstrap-all": "*",
        "slbmeh/bootstrap-css": "*",
        "slbmeh/bootstrap-fonts": "*",
        "slbmeh/bootstrap-js": "*"
    }
}

上面的composer.json为您提供了许多不同的选项来将软件包安装到供应商目录中。