如何合并和压缩多个脚本和CSS文件供生产使用? [英] How can I combine and compress multiple script and css files for production use?

查看:165
本文介绍了如何合并和压缩多个脚本和CSS文件供生产使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 YUI压缩器来组合并压缩编译项目时,我的css和js文件集. YUI Compressor仅将单个文件作为输入.我尝试使用以下(Windows)命令附加到输出文件,但是奇怪的字符出现在发生附加的输出中.如何使用Windows命令行或Powershell来实现此目的?

I want to use YUI Compressor to combine and compress my css and js file sets when I compile my project. YUI Compressor only takes as input single files. I've tried using the following (Windows) commands to append to the output files, but strange characters appear in the output where appendage occurs. How can I use windows command line or powershell to achieve this?

java -jar yuicompressor-2.4.2.jar --charset utf-8 jquery-1.3.2.js > scripts-all.min.js
java -jar yuicompressor-2.4.2.jar --charset utf-8 jquery.superfish.js >> scripts-all.min.js

推荐答案

如果您在Windows上进行开发,请不要忘记

If you're developing on Windows, don't forget there's a .NET port of YUI Compressor. You can do all that as a post-build event in visual studio, as part of a TFS Build or just import the dll's into your application and use it in that (eg. compressing on the fly).

这篇关于如何合并和压缩多个脚本和CSS文件供生产使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆