JSmin plugin question/trouble

Hello,

working on a local workflow for JS/CSS minifying during deployment I
stumbled across the JSmin plugin. So why do all the work myself? :wink:

But when testing this I run into one problem - perhaps someone can
shed some light on this:

- ColdBox 3.0.0 RC 1
- JSmin plugin downloaded from ForgeBox today. It says "version 1.4"
in the source code

Here's a snippet from one of the layouts in the <head> section:

<cfoutput>
#getMyPlugin("JSMin").minify('includes/css/layout.css','includes/css/
jquery.tooltip.css','includes/css/jcarousel-skin.css','includes/css/
jquery.tweet.css')#
</cfoutput>

So you see I try to concatenate/compress 4 CSS files. Everything seems
to work at first glance, and the compressed file is generated in the
configured cache directory.
BUT: It only contains the first CSS file, the other 3 are ignored.

The same problem exists for compressing about 10 JS files in the same
layout.

I don't see any obvious errors, and just don't see the error (which I
suppose is on my side).

Christian

Christian,

Change this

#getMyPlugin("JSMin").minify('includes/css/layout.css','includes/css/
jquery.tooltip.css','includes/css/jcarousel-skin.css','includes/css/
jquery.tweet.css')#

to this

#getMyPlugin("JSMin").minify('includes/css/layout.css,includes/css/
jquery.tooltip.css,includes/css/jcarousel-skin.css,includes/css/
jquery.tweet.css')#

and you should be good to go. Let me know if you need further help.

Curt Gratz
Computer Know How
ColdBox Alliance Partner

Hi Christian,

As an aside you might want to also take a look at Aaron Greenlee’s blog post around a workflow he designed for this sort of thing. Cool stuff.

http://aarongreenlee.com/share/coldfusion-coldbox-client-source

Nolan

Yeah - I’d strongly recommend moving these kind of tasks into an automated build process. Ant is OK as a starting point, but I’ve got to recommend Gradle. Much more powerful and maintainable, and almost as easy to get started with.

Best Wishes,
Peter

@Curt:
Thanks, that was it. Makes me feel like a first-day CFer :wink:
The docs in the wiki are wrong though, as they show it exactly the way
I did. I have put a comment there to correct it.

@the rest:
Thanks for an interesting read. I was playing with Ant and
minification, too. In that process I stumbled upon the JSmin plugin...

Christian

Thanks for the heads up on Gradle, Peter. Looks interesting, I'll have
to play around with it.

I agree with Peter to automate the build process. We use Ant and use
the yuicompressor to minify js and css files.

Ernst