Skip to content

Commit 2359913

Browse files
matthieusiebenjonathantneal
authored andcommitted
Allow configuring the sass engine to use
According to [this article](https://davidgracieweb.co.uk/node-sass-vs-grunt-sass-vs-dart-sass-vs-ruby-sass/) `node-sass` may be behind in terms of features but is still faster by a factor of around 2.
1 parent 71c47cc commit 2359913

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,15 @@ export default postcss.plugin('postcss-sass', opts => (root, result) => {
1616
// include paths
1717
const includePaths = [].concat(opts && opts.includePaths || []);
1818

19+
// sass engine to use
20+
const sassEngine = opts && opts.sass || sass
21+
1922
// sass resolve cache
2023
const cache = {};
2124

2225
return new Promise(
2326
// promise sass results
24-
(resolve, reject) => sass.render(
27+
(resolve, reject) => sassEngine.render(
2528
// pass options directly into node-sass
2629
Object.assign({}, opts, requiredSassConfig, {
2730
file: `${postConfig.from}#sass`,

0 commit comments

Comments
 (0)