gpt4 book ai didi

css - 一次压缩多个 css 和 js 文件

转载 作者:太空宇宙 更新时间:2023-11-04 00:10:22 24 4
gpt4 key购买 nike

我想一次压缩我的css和js文件。因为我每天都要修改文件并部署它们。有没有什么工具可以一次压缩这些文件?

提前致谢。

最佳答案

您可以使用 YUI compressor,如果您对 java 和命令行有所了解,这是一个很好的工具。

The YUI Compressor is written in Java (requires Java >= 1.4) and relies on Rhino to tokenize the source JavaScript file. It starts by analyzing the source JavaScript file to understand how it is structured. It then prints out the token stream, omitting as many white space characters as possible, and replacing all local symbols by a 1 (or 2, or 3) letter symbol wherever such a substitution is appropriate (in the face of evil features such as eval or with, the YUI Compressor takes a defensive approach by not obfuscating any of the scopes containing the evil statement) The CSS compression algorithm uses a set of finely tuned regular expressions to compress the source CSS file. The YUI Compressor is open-source, so don't hesitate to look at the code to understand exactly how it works.

http://developer.yahoo.com/yui/compressor/

关于css - 一次压缩多个 css 和 js 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13289562/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com