Something that I keep seeing everywhere is new tutorials popping up, telling developers to install and use node-sass
in their projects.
This package is long deprecated and should no longer be used. I'll walk you through the why and what to use instead.
We developers tend to be lazy. We sometimes forget that we should, from time to time, read the readme
of the packages we use in our projects.
Lets head over to node-sass on npm and check what we find there.
Warning: LibSass and Node Sass are deprecated. While they will continue to receive maintenance releases indefinitely, there are no plans to add additional features or compatibility with any new CSS or Sass features. Projects that still use it should move onto Dart Sass.
Big oopsie. 🤦♂️ The package officially states (since Oct, 2020) that we should't use this package anymore. It even gives us a link to the sass blog article.
Turns out we would be missing out on a ton of new features, if we used node-sass
. By using dart-sass
we make sure that we get access to the newest sass language features.
In most build setups you can just install dart-sass
as a drop-in replacement. If you're using vite
and co, you most likely dont have to worry about this anyway.
If you're using open source packages, make sure you at least read their readme
files. And drop them a 💵 dollar or two, if you profit from their work.
PS:
@import
in sass is discouraged too, use@use
instead. source