9

I've just learn I should use @use instead of @import in sass. But as I understood, I should use npm sass instead of npm node-sass to do that. What is the difference between these two ? Why @use and @forward doesn't work on node-sass

El Ronnoco
  • 11,753
  • 5
  • 38
  • 65
utkuonursahin
  • 249
  • 4
  • 10

1 Answers1

11

Popularity

Blue line is node-sass, orange is sass popularity.

enter image description here

Id docs of sass you can see these comparison:

  • Dart Sass, from which this package is compiled, can be used either as a stand-alone executable or as a Dart library. Running Dart Sass on the Dart VM is substantially faster than running the pure JavaScript version, so this may be appropriate for performance-sensitive applications. The Dart API is also (currently) more user-friendly than the JavaScript API. See the Dart Sass README for details on how to use it.
  • Node Sass, which is a wrapper around LibSass, the C++ implementation of Sass. Node Sass supports the same API as this package and is also faster (although it's usually a little slower than Dart Sass). However, it requires a native library which may be difficult to install, and it's generally slower to add features and fix bugs.

Performance

There is answer where is comparison for Bootstrap 4

enter image description here

In this particular case, two seconds is not a big deal; but consider Dart-Sass(JS) is nine times slower than Dart-Sass(Dart VM) and three times slower than node-sass.

More details about this benchmark is article.

Maintenance

Node-sass is considered as depreciated, but you can see frequent updates for both packages.

Why @use and @forward doesn't work on node-sass

Because of in node-sass you have c implementation (LibSass) that is not updated that frequently like dart implementation used in sass.

Daniel
  • 7,684
  • 7
  • 52
  • 76