roxy icon indicating copy to clipboard operation
roxy copied to clipboard

RFE: Add minification option to deploy modules process

Open peterskim12 opened this issue 12 years ago • 5 comments

Interesting thought came up during an interview... she mentioned they minify their CSS and JS files during the deployment process.

Might be an interesting feature to have these options available in the build properties file:

minify_js=true/false minify_css=true/false

that perform minification during the deploy process.

peterskim12 avatar May 23 '13 16:05 peterskim12

Paxton & I kicked that around in the past. We got stuck on how to identify references to JS and CSS inside of XQuery files. Or in HTML. Definitely a problem worth solving.

dmcassel avatar May 23 '13 20:05 dmcassel

Looks like there are some Grunt plugins that implement this. For pure XQuery-based apps, we'd have to integrate the Grunt plugins with Roxy. For hybrid apps where the front-end is HTML/CSS/JavaScript, it's probably better to manage the front-end app code using Grunt, then rely on Roxy simply to push the Grunt dist output to some MarkLogic app server instance.

peterskim12 avatar Jun 13 '13 14:06 peterskim12

How hard would it be to set up Roxy's ml deploy modules command to call Grunt?

dmcassel avatar Jun 13 '13 17:06 dmcassel

I'm actually guessing that Grunt wouldn't know how to handle the mixed XQuery/HTML files in a pure XQuery/MVC app but I could be wrong...

peterskim12 avatar Jun 20 '13 13:06 peterskim12

The big problem you run into is knowing which js/css files to minify. Often these tools like to minify a bunch of js into one big file. Order matters. I looked into doing this with some ruby gems at one time and found the problem to be more involved than it seemed on the surface. This Grunt approach sounds interesting but I suspect you will alienate people with the node.js requirement. There's been plenty of pushback already over using Ruby.

paxtonhare avatar Jun 22 '13 15:06 paxtonhare