yii2-assets-auto-compress
yii2-assets-auto-compress copied to clipboard
Exclude files
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?
There is no such opportunity now
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.
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.
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
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.
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; ?>