Question

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?

Était-ce utile?

La 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/

Autres conseils

Try grails-grunt plugin.

It seems that this is what you need. You can create own compilation process for CoffeeScript, LESS and others by using Grunt.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top