79615729

Date: 2025-05-10 17:18:14
Score: 0.5
Natty:
Report link

Sass has a NPM Package available to help with migration: sass-migrator.

I recently used it on a large codebase and while it didn't do the complete migration, it did a big part of it.

You have here the link to the npm package and you can install it with npm i --save-dev sass-migrator.

Once you install it run sass-migrator <migration> <entrypoint.scss...> on the CLI.

According to the documentation:

The Sass migrator automatically updates your Sass files to help you move on to the latest and greatest version of the language. Each of its commands migrates a single feature, to give you as much control as possible over what you update and when.

--migrate-deps

This option (abbreviated -d) tells the migrator to change not just the stylesheets that are explicitly passed on the command line, but also any stylesheets that they depend on using the @use rule, @forward rule, or @import rule.

--load-path

This option (abbreviated -I) tells the migrator a load path where it should look for stylesheets. It can be passed multiple times to provide multiple load paths.

Reasons:
  • Long answer (-1):
  • Has code block (-0.5):
  • User mentioned (1): @use
  • User mentioned (0): @forward
  • User mentioned (0): @import
  • Low reputation (1):
Posted by: JoaoFCarvalho