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

Casted import not working #27

Closed
benweet opened this issue Aug 23, 2013 · 5 comments
Closed

Casted import not working #27

benweet opened this issue Aug 23, 2013 · 5 comments

Comments

@benweet
Copy link

benweet commented Aug 23, 2013

Doing this in my less file:

@import (less) "lib.css";

Causes this in css.js:

GET http://localhost/less 404 (Not Found) 
Uncaught TypeError: undefined is not a function 

NOTE: less.js module is already loaded from another directory. Here is my configuration:

    packages: [
        {
            name: 'css',
            location: 'libs/css',
            main: 'css'
        },
        {
            name: 'less',
            location: 'libs/less',
            main: 'less'
        }
    ],

It works fine when doing @import "lib.css";

@benweet
Copy link
Author

benweet commented Aug 23, 2013

More generally, I think import options don't work.

@guybedford
Copy link
Owner

Yes exactly - this hasn't been baked in yet unfortunately, thanks for pointing it out.

The area this would be resolved is in RequireCSS here - https://github.com/guybedford/require-css/blob/master/css.js#L416.

Basically, it inlines all the imports before sending to the less parser.

The way to change this would be to set a flag on the loadCSS function for if it is a parser or not, then assume that the parser will handle the import statements and not inline them.

It's kind of tricky to prioritise work on this module in the next week or so as I am focusing on jspm at the moment. Happy to accept pull requests though in the mean time.

@benweet
Copy link
Author

benweet commented Aug 24, 2013

Thanks but I will probably not have time to debug that. It's not blocking
for me anyway.

@guybedford
Copy link
Owner

A fix for this is being investigated in #30. Moving the discussion there as it has the same root cause.

@benweet
Copy link
Author

benweet commented Dec 1, 2013

Thx. Works perfect.

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

2 participants