» npm install gulp-sass
Videos
» npm install gulp-scss
» npm install gulp-dart-sass
import gulpSass from "gulp-sass";
import nodeSass from "node-sass";
const sass = gulpSass(nodeSass);
Try this. But I still don't know if this is the best.
- I know "node-sass" should be deprecated. Just an example. use "dart-sass" or "sass"
From sass github repository
import dartSass from 'sass';
import gulpSass from 'gulp-sass';
const sass = gulpSass( dartSass );
» npm install @types/gulp-sass
The difference between them is that gulp-sass has node-sass as a dependency :)
gulp-sass is a plugin for Gulp - an excellent build tool.
And it uses node-sass which it itself is using lib-sass which is a Sass compiler written in C or C++.
That makes it faster than Ruby Sass, but it is not as feature complete I think, but they are pretty close to each other.
I think that the Sass project recently switched from Ruby Sass to LibSass as the 'official' compiler / tool - but don't arrest me on that. :)
The cons of gulp-sass is that you get more than just node-sass - you also get gulp-utils and other things - which is a problem if you are not using Gulp in the first place. ...
And if you are using Gulp, then you are all set with gulp-sass, obviously.
To complicate this answer even further, there is also gulp-ruby-sass which uses Ruby Sass directly.
That means that you have to install Ruby and Sass before you can use it, but you will be able to use Compass and other Ruby Sass stuff with it.
It is going to be slower, though..
This question is better phrased as "what are the differences between Libsass and Ruby Sass" - or any other implementation.
The differences are potentially significant, as they may support different features: see https://sass-compatibility.github.io/
node-sass uses LibSass under the hood.
In the long run, it looks like Dart Sass is the future: http://sass.logdown.com/posts/2026639-sass-35-is-released