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

'File Skip' support #25

Open ChrGriffin opened 7 years ago

ChrGriffin commented 7 years ago

Added support for the ability to skip specific files and have them render normally regardless of the assets compression.

Example:

'assetsAutoCompress' => [
    'class' => '\skeeks\yii2\assetsAuto\AssetsAutoCompressComponent',
    'enabled' => TRUE,
    'skip' => [
        'scriptname.js',
    ]
],

And the end result on the page:

<script src="/assets/d905b4ac/scriptname.js"></script>
<script src="/assets/js-compress/6dc4a89b3dc86323accc70fe63033e53.js?v=1479571730"></script>

I needed it for my own project so I went ahead and wrote it. Should work with all JavaScript and CSS files, assuming they have unique filenames.

vkaterusha commented 7 years ago

@skeeks-semenov I would need this feature too for my project. I want to exclude a css file from compression. In my case I have a fancybox gallery and it's the jquery.fancybox.css when compressed with other Yii2 assets not working as expected..