Skip to content
Home / Migrations / Sass legacy JS APISass modern API

Sass legacy JS API Sass modern API

easy

The Sass legacy JS API (renderSync/render) is deprecated. Modern API (compile/compileString) is faster, required by Vite 6+, and supports custom importers.

Estimated: 0.5-1h · 4 steps
Progress0%
Step 1: Update sass package
npm install sass@latest
Step 2: Update bundler config

Vite: css.preprocessorOptions.scss.api = 'modern-compiler'. Webpack sass-loader: api: 'modern-compiler'.

Step 3: Fix custom Sass usage

If calling Sass directly: sass.renderSync() → sass.compile(). sass.render() → sass.compileAsync(). Options format changed.

Step 4: Test styles
All SCSS compiles. No deprecation warnings. Build output unchanged.

What this migration involves

Moving from Sass legacy JS API to Sass modern API is rated easy and takes about 0.5-1h on a typical project. The guide breaks it into 4 steps, 1 of which ship with runnable commands and 1 with a verification check.

FAQ

How long does migrating from Sass legacy JS API to Sass modern API take?

Around 0.5-1h for a typical project — 4 steps, difficulty rated easy, 1 of them with copy-paste commands.

Is moving from Sass legacy JS API to Sass modern API reversible?

No reverse guide is tracked yet, so treat this as a one-way move and keep a full export of your Sass legacy JS API data before you start.

What does Sass modern API cost compared to Sass legacy JS API?

Pricing for both tools is contact-based or not tracked yet.