在发布/包之前压缩CSS / JavaScript [英] Compress CSS/JavaScript before publish/package

查看:127
本文介绍了在发布/包之前压缩CSS / JavaScript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在阅读这个 post 关于在VS2010的publish / package事件中缩小和压缩静态文件,如CSS / JS。

I've been reading this post about minifying and compressing static files like CSS/JS within the publish/package event in VS2010.

想知道是否也可以将文件合并到一个CSS文件和一个JS文件?
在这个过程中如何做。

I wonder if it also is possible to combine the files to one CSS file and one JS file? And how that can be done in this process.

推荐答案

至于缩小和压缩CSS和JS文件 - 这不应该是任何问题。

As far as minifying and compressing your CSS and JS files - that shouldn't be any issue.

但是,当您将所有相关文件(CSS和JS)合并到单个文件中时,您需要小心避免任何命名冲突可能发生。

However - when it comes to actually combining all of your related files (CSS & JS) into single files, you will need to be careful to avoid any naming conflicts that can occur.

如果您使用一些已经缩小的JS文件,这是特别重要的,因为变量 a,b,c 等。)

YUI Compresser 可以处理CSS和JavaScript文件的压缩。

The YUI Compresser can handle both the compression of CSS and JavaScript files.

希望这有助于。

这篇关于在发布/包之前压缩CSS / JavaScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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