yii2-assets-auto-compress icon indicating copy to clipboard operation
yii2-assets-auto-compress copied to clipboard

'File Skip' support

Open ChrGriffin opened this issue 7 years ago • 1 comments

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.

ChrGriffin avatar Nov 19 '16 16:11 ChrGriffin

@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..

vkaterusha avatar Jan 31 '17 17:01 vkaterusha