skeeks-semenov / yii2-assets-auto-compress

Automatic compilation of js + css + html
https://skeeks.com/
BSD 3-Clause "New" or "Revised" License
157 stars 43 forks source link

Fixed building path to files for Yii version >=2.0.39 with non-empty BaseUrl #61

Open nomelodic opened 3 years ago

nomelodic commented 3 years ago

The issue was discussed here https://github.com/yiisoft/yii2/issues/18414.

In version 2.0.39, there was a problem with projects with non-empty BaseUrl and appendTimestamp included. In this case, when the list of files (.css and .js) was compiled, the path to the file was built incorrectly when the file modification time was received. BaseUrl was contained in both @webroot mask and relative file path. Those, it turned out something like this G: /XAMPP7/htdocs/subdomain/site/web/subdomain/site/css/custom.css instead of the prescribed G: /XAMPP7/htdocs/subdomain/site/web/css/custom.css. There it was fixed by removing BaseUrl in the relative path.

Here I found a similar problem: no compiled files were generated on projects with non-empty BaseUrl. The script that bypassed the .css and .js lists could not get any of the files, since paths contained doubled BaseUrl.

Fix #54