Skip to content

Add support for multiple importers #16

@marcofugaro

Description

@marcofugaro

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions