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

Exclude files #55

Open cluwong opened 4 years ago

cluwong commented 4 years ago

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?

skeeks-semenov commented 4 years ago

There is no such opportunity now

adoerler commented 4 years ago

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.

skeeks-semenov commented 4 years ago

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.

adoerler commented 4 years ago

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

nomadtechiemike commented 3 years ago

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.

skeeks-semenov commented 3 years ago

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; ?>