Home >Backend Development >PHP Tutorial >javascript - Is there any PHP class that can compress JS and CSS?

javascript - Is there any PHP class that can compress JS and CSS?

WBOY
WBOYOriginal
2016-08-23 09:17:441184browse

Because the environment requires offline compression of JS and CSS, it is impossible to use the online compression function of the network.
So I want to find a PHP class to compress JS or CSS.
I can’t find a particularly good one on github, so I want to ask everyone. I hope Recommended, thank you!

Reply content:

Because the environment requires offline compression of JS and CSS, it is impossible to use the online compression function of the network.
So I want to find a PHP class to compress JS or CSS.
I can’t find a particularly good one on github, so I want to ask everyone. I hope Recommended, thank you!

https://gist.github.com/tovic...

Yes, you can search and find it, but most of them are simple pieces of code or not very maintainable.

If the environment requires offline compression, using node is a good solution. After all, it is a mainstream compression solution.

CSS-JS-Booster
https://github.com/Schepp/CSS...

You can directly use webpack or gulp on the front end.
If you find it troublesome, just find an online compression website and go through their compression interface when submitting.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn