admin管理员组文章数量:1405170
I was tasked with figuring out how to package JavaScript and CSS into one file per each. We have a java servlet application and we use JQuery if that makes any difference. We use ant to script our builds, so easy integration with Ant would be nice. We want to do this to reduce caching issues and to reduce number of requests to the servlet.
I found few tools out there, but not sure what are pros/cons of each. Here is the list so far:
JAWR (/)
Juicer ()
JSBuilder2 (/)
JSLint (/) (JavaScript only)
Quilt () (JavaScript only)
Do you guys have any remendations, warnings, advices? Or maybe a better tool/framework?
Thanks in advance!
I was tasked with figuring out how to package JavaScript and CSS into one file per each. We have a java servlet application and we use JQuery if that makes any difference. We use ant to script our builds, so easy integration with Ant would be nice. We want to do this to reduce caching issues and to reduce number of requests to the servlet.
I found few tools out there, but not sure what are pros/cons of each. Here is the list so far:
JAWR (http://jawr.java/)
Juicer (http://cjohansen.no/en/ruby/juicer_a_css_and_javascript_packaging_tool)
JSBuilder2 (http://www.sencha./products/jsbuilder/)
JSLint (http://code.google./p/jslint4java/) (JavaScript only)
Quilt (https://github./kitgoncharov/quilt) (JavaScript only)
Do you guys have any remendations, warnings, advices? Or maybe a better tool/framework?
Thanks in advance!
Share Improve this question edited Jun 8, 2011 at 18:03 SpaceBear asked Jun 8, 2011 at 18:01 SpaceBearSpaceBear 8643 gold badges9 silver badges22 bronze badges 1- Sorry all for not voting any answer up, i've been pulled into another project, so I haven't had a chance to actually check any of these solutions out :( Thank you for responses though, much appreciated! – SpaceBear Commented Jul 26, 2011 at 16:14
4 Answers
Reset to default 4For JavaScript, the closure piler integrates with Ant. It can concatenate and minify your JS. You can also use YUI pressor. Here's an example of using YUI pressor with Ant for JS and CSS.
By far my favorite template is HTML5 Biolerplate The build script there is pretty good as a template.
Also, versioned files with long cache times will greatly improve load times.
Replace "being nice" with "a must". You absolutely want something that integrates with your build tool since you do not want to minimize your files manually again and again and again and again and again and again and again and again and again and again.
Jawr - very nice library, makes everything for you, simple to integrate (at least with its Grails PLugin). The small problem, I havn't found a way (may be it exists) to integrate ALL bundle's dependencies in a single file. (if you don't have dependencies between bundles (modules), you won't regret this decision).
本文标签: Packaging JavaScript amp CSSStack Overflow
版权声明:本文标题:Packaging JavaScript & CSS - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744274137a2598327.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论