YUI 压缩? 贵? 并与欧洲字母兼容?

发布于 2024-07-24 17:36:25 字数 466 浏览 4 评论 0原文

我正在尝试找到某种 gui 或批处理实用程序,我可以在其中 YUI 压缩我拥有的 JS 文件..我有一个实用程序,可以将我的所有 js 合并为 1 个单个 js ..并且效果很好,但我需要压缩它文件..

我以前使用过类似的东西来压缩,但它在欧洲字符上失败了,即在字母上带有重音的字符...比如 Día , Sábado 等

所以基本上发生的事情是它工作得很好,但是当我有一个带有欧洲单词的字符串时它会在其中添加转义字符...我必须手动编辑它..这是一场噩梦.-..

任何人都可以为我指出一个与 YUI 或类似工具一起使用的良好 GUI 的正确方向吗所以我可以将它指向我的文件(和文件,我有多个文件),这样我就可以像在批处理模式或类似模式下那样使用它。它也需要压缩 jquery...我想 yui 对此没有问题吗?

有谁知道这样的事情是否存在?

我真的不想使用这个命令,因为我有几个文件......

非常感谢任何帮助

I am trying to find some sort of gui or batch utility where i can YUI compress a JS file i have.. I have a utility that sort of consolidates all my js into 1 single js .. and works great but i need to compress this file..

I was using something similar before to compress but it failed on european character i.e. character with accents over letters... like Día , Sábado etc

So basically what happend was it worked great but when i had a string with a european word with accents on it.. it would put escape characters in etc... I had to manually edit it.. it was a nightmare.-..

Can anyone point me in the right direction of a good GUI that works with YUI or somehtign similar so i can point it to my file (and files and i have more than one) so i can just one it like in batch mode or similar.. It needs to compress jquery also... i suppose yui has no issues with this?

Does anyone know if something like this exists at all?

I didn't really want to use the command like as i have a few files...

Any help really appreciated

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

别再吹冷风 2024-07-31 17:36:25

我的建议可能不完全是您正在寻找的,但我正在使用批处理文件来驱动多个 JS 文件的压缩/打包。

没有任何特殊的批处理文件 fu,并且假设您在 Windows 上,您可以编写一个与此类似的批处理文件(按照您希望文件在浏览器中加载的顺序):

compress.cmd:

echo. > compressed.js
java -jar yuicompressor-2.4.2.jar jquery.js >> compressed.js
java -jar yuicompressor-2.4.2.jar file1.js >> compressed.js
java -jar yuicompressor-2.4.2.jar file2.js >> compressed.js

然后您可以随时运行它需要将所有内容“重新打包”到单个部署文件“compress.js”中。

顺便说一句,请确保所有 JavaScript 源文件都是 UTF8,然后使用 --charset UTF-8 选项运行压缩器; 这应该可以解决字符编码问题。

My suggestion may not be exactly what you are looking for, but I am using batch file(s) to drive the compression/packaging of multiple JS files.

Without any special batch file fu, and assuming your on Windows, you could write a batch file similar to this (in the order in which you want the files to load in the browser):

compress.cmd:

echo. > compressed.js
java -jar yuicompressor-2.4.2.jar jquery.js >> compressed.js
java -jar yuicompressor-2.4.2.jar file1.js >> compressed.js
java -jar yuicompressor-2.4.2.jar file2.js >> compressed.js

You can then run this anytime you need to "re-package" everything into the single deployment file "compress.js".

BTW, make sure all your JavaScript source files are UTF8 and then run the compressor with the --charset UTF-8 option; this should take care of character encoding issues.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文