Skip to content

Commit

Permalink
node-sass accepts importer as single function or array of functions (#…
Browse files Browse the repository at this point in the history
…1409)

The current implementation sets an importer, so you cant add other importers via `.sassrc.js, ...`.
  • Loading branch information
amrnt authored and Jasper De Moor committed May 22, 2018
1 parent 3988ffc commit 1e9556c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/assets/SASSAsset.js
Expand Up @@ -38,7 +38,9 @@ class SASSAsset extends Asset {
}
});

opts.importer = (url, prev, done) => {
opts.importer = opts.importer || [];
opts.importer = Array.isArray(opts.importer) ? opts.importer : [opts.importer];
opts.importer.push((url, prev, done) => {
let resolved;
try {
resolved = syncPromise(
Expand All @@ -50,7 +52,7 @@ class SASSAsset extends Asset {
return done({
file: resolved
});
};
});

return await render(opts);
}
Expand Down

0 comments on commit 1e9556c

Please sign in to comment.