简体   繁体   English

PHP上的简单JS压缩程序

[英]Simple JS minifier on php

I want to minify and possibly compress JavaScript while running a website in dev mode. 在开发模式下运行网站时,我想缩小JavaScript并压缩它。

The most popular solutions seem to be too comprehensive (Assetic, minify) or based on tools I don't have access to (Assetic: symfony, Uglify.js: nodeJS). 最受欢迎的解决方案似乎过于全面(Assetic,minify)或基于我无法使用的工具(Assetic:symfony,Uglify.js:nodeJS)。

I would like to: 我想要:

  • Manually pass in paths of several js files 手动传递几个js文件的路径
  • Get one compressed, minified js file back that can be written to the filesystem 取回一个压缩的,精简的js文件,该文件可以写入文件系统

How can I do this? 我怎样才能做到这一点?

Why don't use yuicompressor.jar? 为什么不使用yuicompressor.jar? Correct compression of the code with high ratio is non-trivial task and it's already done in yuicompressor. 正确地压缩具有高比率的代码是一项艰巨的任务,并且已经在yuicompressor中完成了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM