yiisoft / yii2

Yii 2: The Fast, Secure and Professional PHP Framework
http://www.yiiframework.com
BSD 3-Clause "New" or "Revised" License
14.24k stars 6.9k forks source link

Common asset grouping with multiple webroots #9695

Open nirvana-msu opened 9 years ago

nirvana-msu commented 9 years ago

Hello,

I'm using advanced application template with two separate webroots: for frontend and backend. I tried following the guide on grouping assets, in particular the example with allShared, allBackEnd and allFrontEnd targets, as I have some common assets used by both frontend and backend. This example actually does not work as basePath and baseUrl properties are required for all targets, but it becomes rather obvious once you try running it.

The problem is that it can only work this way if you have a single webroot. When you have multiple ones, you need common assets to be published to both webroots, which asset/compress command apparently cannot handle using a single template.

Am I right the the only solution is to actually create two independent templates, one for each webroot, and run the compressing command two times for each template?

samdark commented 9 years ago

Yes.

nirvana-msu commented 9 years ago

Thanks. Would be nice to explicitly state that in the guide, as it's really not obvious.