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

Exclude files

Open cluwong opened this issue 5 years ago • 6 comments

There are some css and js files in the project that should not compress. I can't seem to find an option to exclude these files. Is there a way to do this?

cluwong avatar Nov 29 '19 03:11 cluwong

There is no such opportunity now

skeeks-semenov avatar Nov 29 '19 07:11 skeeks-semenov

Hi cluwong,

as I'm looking for a way to exclude some files too, I've found this pull request which seems to do what we need: https://github.com/skeeks-semenov/yii2-assets-auto-compress/pull/25

FYI: I didn't try this yet. Please let me now, if it works for you.

adoerler avatar Dec 02 '19 09:12 adoerler

Perhaps this is what you need. But I don’t really like this solution, because you cannot control the order of the connected files in it.

And ideally, you need to do something more serious this task.

skeeks-semenov avatar Dec 02 '19 09:12 skeeks-semenov

Hi skeek-semenov,

unfortunately you are right, the #25 approach is not ideal. Additionally it will not work if appendTimestamp is enabled in AssetManager.

BR

adoerler avatar Dec 02 '19 18:12 adoerler

So there is currently no way to not compress certain assess from being compressed, I am using tinymce widget but it will not load if I am using this, how about an option to only run on front/landing page? it works great for site load times.

nomadtechiemike avatar Nov 12 '20 23:11 nomadtechiemike

You can choose not to use this component on a specific page of the site.

Use a construct call at the beginning of the page

<?php \Yii::$app->assetsAutoCompress->enabled = false; ?>

skeeks-semenov avatar Nov 13 '20 07:11 skeeks-semenov