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 CSS code processing and minification #62

Open nomelodic opened 3 years ago

nomelodic commented 3 years ago

The mrclay/minify extension did not handle relative paths correctly, in particular those with ../ and ./. It has written its own function that adjusts paths based on the initial location of the file and the final one.

An example of incorrect path handling New path: /var/www/site/web/assets/css-compress Old path: /var/www/site/web/css

In CSS codes, we have the path ../images/image1.png. After processing it should look like this ../../images/image1.png, but instead mrclay/minify makes it like this.


The natxet/cssmin extension does not correctly process already minified code, so it was replaced with the matthiasmullie/minify extension.

An example of incorrect code processing Input has line @media(max-width:767px){.table-responsive ..., and the output is @media max-width:767px){.table-responsive ....

Fix #43