Lazily require node-sass
See original GitHub issueThis issue is very closely related to #715 and #731, but I’m suggesting a different solution.
node-sass
is always installed (with all its problems) even if it won’t be used. I don’t think I have to explain why this is a bad idea, but fixing this would for one solve(/prevent) all the “dependency needs to be updated” issues.
Instead of requiring the user to always explicitly pass the compiler like @stof suggested (which I personally still think is the best solution), I suggest we at least lazily load the node-sass
module, i.e. not require
-ing it if the compiler
option is specified. We can then move node-sass
to devDependencies
so users won’t automatically install it if they’re not going to use it. Unlike @stof 's suggestion this doesn’t require a breaking change.
I see you’ve closed the aforementioned prior issues on this topic on grounds of ‘not planned’, but I fail to see a reason why one wouldn’t want to implement (or rather fix) this. I think it’s illogical to advertising this module as being compatible with both node
- and dart-sass
while actually always installing node-sass
“in the background”. You mentioned that people can use gulp-dart-sass
instead, which is entirely true, but I don’t see why we need to create (and maintain) a fork for this trivial functionality.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:18
- Comments:9 (1 by maintainers)
This is a breaking change indeed. But I think it’s worth it. Apart from dart Sass supporting the module system, dart sass also has a smaller dependency tree (
vs node-sass
). Imo
sass
should also be the default instead ofnode-sass
, since it’s recommended by Sass itself.About
gulp-dart-sass
:sass
seems to be a dependency which isn’t updated regularly, which is kind of an issue.LibSass is officially deprecated: https://sass-lang.com/blog/libsass-is-deprecated
So maybe now is the time for that breaking change …