grailscoffeescript-resourceslesscss-resources

grails generate css/js resources


I am using coffeescript-resources and the lesscss-resources plugins, how can I generate the resources to get the raw js/css ?

I know I can package it then explode the war, but is there a way to get the outputs in a simpler way?


Solution

  • When dealing with resources plugins, it's always useful to take a look at the actual resourceMappers to see how the generation is done.

    It seems like the coffeescript plugin contains a CoffeeScriptEngine that compiles the coffeescript files, so you can call that directly ( Line 30 of https://github.com/edvinasbartkus/grails-coffeescript-resources/blob/master/grails-app/resourceMappers/CoffeeScriptResourceMapper.groovy ).

    Similarly, the less compiler - https://github.com/paulfairless/grails-lesscss-resources/blob/master/grails-app/resourceMappers/LesscssResourceMapper.groovy

    The way the grails resources plugin works makes it very difficult to get standalone files. You're better off using a tool in development like Codekit http://incident57.com/codekit/