Rollup plugin for compiling Sass/SCSS files into CSS, with support for output to file, insertion into <head>, and custom processors (e.g., PostCSS). Current version 1.15.3, released July 2024, with maintenance releases focused on dependency updates and vulnerability fixes. Key differentiators: supports both legacy `node-sass` and modern `sass` compiler via `api` option (added in v1.15.0), CSS modules via processor, and TypeScript types included. Release cadence is irregular but with periodic maintenance updates.
npm install rollup-plugin-sassVerified import paths — ran on the pinned version, not inferred.
Basic Rollup config that compiles SCSS to CSS, writes to file, and runs PostCSS with autoprefixer.
Use either `output` or `insert`, not both.
Ensure processor functions are compatible with both legacy and modern API returns.
Add `"esModuleInterop": true` to tsconfig.json.
Check the plugin documentation for the latest callback signature.
Use the `include` or `exclude` options to restrict which files are processed.
npm install sass --save-dev
Ensure the plugin is added to the Rollup plugins array and the file extension is included in the import.
Ensure processor returns an object with a `css` property, or a promise that resolves to such an object.
Create the output directory or use a path that exists.