BoxLang 🚀 A New JVM Dynamic Language Learn More...


v0.4.1 CommandBox Modules

A Commandbox module which combines and minifies JavaScript and CSS files

It uses Google Closure Compiler for compression and minification of JS files. For CSS a CFML port of YUI compressor is used.


Install the module using Commandbox:

box install commandbox-minify


box minifycss "path/to/css/files/*" or box mcss "path/to/css/files/*" for compressing css files from a location

box minifjs "path/to/js/files/*" or box mjs "path/to/js/files/*" for compressing js files from a location

Call this (if you want to use it with Coldbox)

box minify

from your project root directory. It will scan for all Theme.cfc and ModuleConfig.cfc files and sees if any contains this.minify = { "nameItAsYouLike" : {}, "nameItAsYouLike2" : {} }

Make sure that this.minify is a valid json. Currently a regex is used to find and parse it.

ADVANCED_OPTIMIZATIONS options - be carefull with this, better don"t choose it possible options are: none, WHITESPACE_ONLY, SIMPLE_OPTIMIZATIONS, ADVANCED_OPTIMIZATIONS

Configuration if used with Coldbox

put this setting in your Theme.cfc or ModuleConfig.cfc. Make sure that the syntax is valid Json.

Here is an example file:

  • nameItAsYouLike as written, name your block as you like
  • files array of files to be minified and combined
  • type can be js or css
  • name name of the file containing all minified and combined files
  • minified after executing minify the name plus and hash will be written here
  • sourceDirectory this is your base dir starting from web root. Enter e.g. modules here
  • destinationDirectory the minfied file will be placed here
  • optimization will be used for js minification only, see above ADVANCED_OPTIMIZATIONS
	this.minify = {
	"nameItAsYouLike" :  { 'files':  [
   		 "type": "js"
  		,"name": "jsall"
		,"sourceDirectory": "this is your base dir starting from web root. Enter e.g. modules here"
		,"destinationDirectory": "modules/theme/includes/js"
		,"optimization": "none"
   "nameItAsYouLike2" : { 'files': [
		"type": "css"
	 	,"name": "cssall"
		,"sourceDirectory": "modules/theme/includes"
		,"destinationDirectory": "modules/theme/includes/css"

If used without Coldbox

You can place a Theme.cfc anywhere in your project. Add at least this.minify structure as mentioned above



  • fixing an error with YuiCompressor and inline images


  • added box minifycss path/to/css/files/* or box mcss path/to/css/files/* for compressing css files from a location
  • added box minifjs path/to/css/files or box js path/to/js/files for compressing js files from a location


  • changed structure of this.minify


  • ported yui compressor to cfml
  • added css compression


  • updated Closure Compiler to latest jar
  • added progress bar
  • suppress warnings
  • fixes


  • initial

$ box install commandbox-minify

No collaborators yet.
  • {{ getFullDate("2019-03-22T08:55:58Z") }}
  • {{ getFullDate("2019-04-11T07:25:24Z") }}
  • 2,918
  • 6,077