Composer in Symfony2 creates the same assets twice (jquery, jqueryui)

守給你的承諾、 提交于 2019-12-23 17:03:39

问题


I added jquery and jqueryui to composer.json:

"require": {
    ...
    "components/jquery": "1.11.*@dev",
    "components/jqueryui": "1.10.4"
}

and composer is downloading both libraries and puts them into vendor/components but also into components/, so I've got two copies of these libs. How can I rid off components/ directory?


回答1:


You can specify the component's output-directory with the component-dir directive in your composer.json'sconfig` section.

example:

{
    "require": {
        "components/jquery": "~1.10"
    },
    "config": {
        "component-dir": "web/assets"
    }
}

It defaults to components.

Just set it to /tmp to "disable" dumping to the second directoy.

Edit: Sadly composer refuses to accept setting the target to /dev/null.

Read more about the configuration in the component-installer documentation.



来源:https://stackoverflow.com/questions/21998144/composer-in-symfony2-creates-the-same-assets-twice-jquery-jqueryui

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!