Just downloaded the new JSMin plugin (v1.5), however when I do a 2nd
fwreinit on my site it blows up the css and js.
It appears the jsmin keeps trying it concatenate the compressed file
even though it was already done on the 1st fwreinit.
To fix, I went back and wrapped the code that does concatenation in
the JSMin.cfc (lines 229 - 239) with an IF-ELSE code block. So now it
reads:
// Concatenate Files into a single compressed one
if( arrayLen(compressedFiles) gt 1) {
sb = createObject("java","java.lang.StringBuilder").init('');
tempFileName = hash(sb.toString(), "MD5") & "." &
listLast(compressedFiles[1],".");
for(x=1; x lte arrayLen(compressedFiles); x++){
sb.append( fileRead(instance.cacheDiskLocation & "/" &
compressedFiles[x]) );
fileDelete(instance.cacheDiskLocation & "/" & compressedFiles[x]);
}
//write out buffer
fileWrite(instance.cacheDiskLocation & "/" & tempFileName,
trim( sb.toString() ));
returnAsset = tempFileName;
}
else {
returnAsset = compressedFiles[1];
}
This IF-ELSE code was in the previous JSMin plugin (v1.4) but was left
out of this new version.
Thanks,
Marcus Cox