How do you automate Javascript minification for your Java web applications?

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 … Read more

Gzip versus minify

Very simple to test. I took your js, put them in different files and ran gzip -9 on them. Here’s the result. This was done on a WinXP machine running Cygwin and gzip 1.3.12. -rwx—— 1 xxxxxxxx mkgroup-l-d 88 Apr 30 09:17 expanded.js.gz -rwx—— 1 xxxxxxxx mkgroup-l-d 81 Apr 30 09:18 minified.js.gz Here’s a further … Read more

How to minify php page html output?

CSS and Javascript Consider the following link to minify Javascript/CSS files: https://github.com/mrclay/minify HTML Tell Apache to deliver HTML with GZip – this generally reduces the response size by about 70%. (If you use Apache, the module configuring gzip depends on your version: Apache 1.3 uses mod_gzip while Apache 2.x uses mod_deflate.) Accept-Encoding: gzip, deflate Content-Encoding: … Read more

Excluding files/directories from Gulp task

Quick answer On src, you can always specify files to ignore using “!”. Example (you want to exclude all *.min.js files on your js folder and subfolder: gulp.src([‘js/**/*.js’, ‘!js/**/*.min.js’]) You can do it as well for individual files. Expanded answer: Extracted from gulp documentation: gulp.src(globs[, options]) Emits files matching provided glob or an array of … Read more

tech