can't bundle CSS files generated by Less with regular CSS files #42

Closed
domurtag opened this Issue Dec 1, 2012 · 4 comments

Comments

Projects
None yet
2 participants

domurtag commented Dec 1, 2012

I've defined the following resource module that includes a mixture of CSS files generated by Less, and regular CSS files.

    responsive {
        dependsOn 'jquery'

        resource 'js/responsive/bootstrap.js'

        resource 'css/footer.css'
        resource url: 'less/style.less', attrs: [rel: "stylesheet/less", type: 'css'], bundle: 'bundle_responsive'
    }

According to the plugin docs, bundle: 'bundle_responsive' should cause all the CSS files to be bundled together. When the page loads, I see that there is indeed only one CSS bundle

<link href="/summer-festivals/bundle-bundle_responsive_head.css" type="text/css" rel="stylesheet" media="screen, projection" />

However, the bundle file cannot be found, so I get an error:

ERROR resource.ResourceMeta - Resource not found: /bundle-bundle_responsive_head.css

And of course, none of the resources in the bundle are loaded. If I remove bundle: 'bundle_responsive', all the resources load, but the CSS files generated from Less are in a different bundle to the regular CSS files.

How can I get all CSS files to be bundled together?

Owner

paulfairless commented Jan 21, 2013

there is a bug in the grails resources, which requires a .css file to be included after the .less files (even if it is just a blank file). I have updated this in the docs

Is there a ticket for this issue in the resources plugin's issue tracker? If so, could you provide a link to it?

Owner

paulfairless commented Jan 21, 2013

There is not currently. I've been through the resources code and not been able to identify what is causing the issue to provide enough details for a fix. The transforming of files from one type into another does not appear to be a standard use-case for the platform so there are a lot of work-arounds to get this far.

It would be good if there was either an open ticket in the resources plugin or here, so that hopefully some day this will be resolved. You said

there is a bug in the grails resources,

so on that basis it seems like the ticket should be in the resources plugin. Even if you don't have enough details for a fix, perhaps you could open a ticket describing the problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment