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

Add support for multiple importers #16

Open
marcofugaro opened this issue Jun 26, 2016 · 0 comments · May be fixed by lucasmotta/sass-glob-importer#2
Open

Add support for multiple importers #16

marcofugaro opened this issue Jun 26, 2016 · 0 comments · May be fixed by lucasmotta/sass-glob-importer#2

Comments

@marcofugaro
Copy link

Hey, I was trying to use two of your importers as an array of functions like the specs say:

importer: [globImporter(), moduleImporter()]

But it didn't work, only the first importer handled the import and so throwing an error when couldn't handle the import.
Reading the node-sass docs I found that you could return null if you want the next importer to handle it.

importer can be an array of functions, which will be called by LibSass in the order of their occurrence in array. This helps user specify special importer for particular kind of path (filesystem, http). If an importer does not want to handle a particular path, it should return null. See functions section for more details on Sass types.

Here is the PR with more info about it.

I would have done it but I don't know how to go about it, should you return null in every case or should you check if this.options.importer is an array and is not last and stuff...

How would you go about it?

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

Successfully merging a pull request may close this issue.

1 participant