What is the best method to reduce the size of my Javascript and CSS files?

后端 未结 18 1017
礼貌的吻别
礼貌的吻别 2020-11-30 04:16

When working with large and/or many Javascript and CSS files, what\'s the best way to reduce the file sizes?

18条回答
  •  一整个雨季
    2020-11-30 04:36

    YUI Compressor has my vote, for the simple reason that instead of just performing regular expression transformations on the code, it actually builds a parse tree of the code, similar to a Javascript interpreter, and then compresses it that way. It is usually very careful about how it handles the compression of identifiers.

    Additionally it has a CSS compression mode, which I haven't played with as much.

提交回复
热议问题