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

SASS Loader doesn't use next importer #353

Open
WalterWeidner opened this issue Jan 7, 2021 · 0 comments
Open

SASS Loader doesn't use next importer #353

WalterWeidner opened this issue Jan 7, 2021 · 0 comments

Comments

@WalterWeidner
Copy link

WalterWeidner commented Jan 7, 2021

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

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.

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