您如何为您的 Java Web 应用程序自动化 Javascript 缩小? [英] How do you automate Javascript minification for your Java web applications?

查看:25
本文介绍了您如何为您的 Java Web 应用程序自动化 Javascript 缩小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很想知道您更喜欢如何为您的 Java 网络应用程序自动化 Javascript 缩小.以下是我特别感兴趣的几个方面:

I'm interested in hearing how you prefer to automate Javascript minification for your Java web apps. Here are a few aspects I'm particularly interested in:

  • 它是如何集成的?它是您的构建工具、servlet 过滤器、后处理 WAR 文件的独立程序的一部分,还是其他什么?
  • 启用和禁用是否容易?尝试调试一个缩小的脚本是非常无趣的,但对于开发人员来说,能够测试缩小不会破坏任何东西也很有用.
  • 它是否透明地起作用,或者它是否有我在日常工作中必须考虑的任何副作用(除了缩小固有的那些)?
  • 它使用哪种压缩器?
  • 它是否缺少任何您能想到的功能?
  • 你喜欢它的什么地方?
  • 喜欢它的哪些方面?
  • How does it integrate? Is it part of your build tool, a servlet filter, a standalone program post-processing the WAR file, or something else?
  • Is it easy to enable and disable? It's very unfunny to try and debug a minified script, but it's also useful for a developer to be able to test that the minification doesn't break anything.
  • Does it work transparently, or does it have any side effects (apart from the ones inherent in minification) that I have to consider in my day-to-day work?
  • Which minifier does it use?
  • Does it lack any features that you can think of?
  • What do you like about it?
  • What don't you like about it?

这将主要作为我未来项目的参考(希望其他 SOer 也能从中找到有用的信息),因此各种工具都很有趣.

This will mostly serve as a reference for my future projects (and hopefully other SOer's will find it informative, too), so all kinds of tools are interesting.

(请注意,这不是关于哪种缩小器最好的问题.我们已经有很多这样的缩小器了.)

(Note that this is not a question about which minifier is best. We have plenty of those around already.)

推荐答案

综述帖子

如果您在此主题中发布了新内容,请编辑此帖子以链接到您的帖子.

Round-up post

If you post something new in this thread, edit this post to link to yours.

  • Ant apply task (using YUI Compressor)
  • Custom YUI Compressor Ant task
  • Maven YUI Compressor plugin
  • Granule (for JSP, JSF, Grails, Ant)
  • Ant macros for Google Closure compiler
  • wro4j (Maven, servlet filters, plain Java, etc)
  • ant-yui-compressor (ant task for compressing JS+CSS)
  • JAWR
  • Minify Maven Plugin
  • humpty
  • Ant exec task using Terser

这篇关于您如何为您的 Java Web 应用程序自动化 Javascript 缩小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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