egoist / egoist/rollup-plugin-postcss

SASS Loader doesn't use next importer

Open
#353 0 comments 5 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
689
Forks
210
PR merge metrics
No merged PRs in 30d

Description

We've got some custom import configuration that needs to be handled outside of this plugin's SASS Loader. In reading the documentation, it appears that we can pass our own SASS importer into the plugin as an option. However, when it fails to pass the regex on https://github.com/egoist/rollup-plugin-postcss/blob/master/src/sass-loader.js#L42 it returns the same file (which doesn't let Node SASS move on to the next importer).

Node SASS says this in their documentation:
> 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.

See their [README](https://github.com/sass/node-sass#importer--v200---experimental)

The way the SASS loader is written passes `this.options.importers` to Node SASS, it just won't be called when the import doesn't match your regex. Was this intentional?

We can always specify our own loader instead of using SASS loader but it seems a bit redundant.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.