Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ghost opened this issue Dec 1, 2012 · 4 comments
Closed

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

ghost opened this issue Dec 1, 2012 · 4 comments

Comments

@ghost
Copy link

ghost 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?

@paulfairless
Copy link
Owner

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

@ghost
Copy link
Author

ghost commented Jan 21, 2013

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

@paulfairless
Copy link
Owner

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.

@ghost
Copy link
Author

ghost commented Jan 21, 2013

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant