Babel plugin that converts SCSS/SASS imports to inline CSS and injects them into the document head at runtime. Current stable version 1.2.0, released sporadically. Replaces webpack sass-loader by transforming style imports into JavaScript functions that create <style> tags. Unique for Babel-centric builds without webpack, but requires peer dependencies node-sass ^8.0.0 and sass ^1.3.0. Limited maintainer activity and sparse documentation.
npm install babel-plugin-transform-scssVerified import paths — ran on the pinned version, not inferred.
Shows how to install and configure the plugin, and how it transforms SCSS imports into inline styles at runtime.
Install sass instead of node-sass, and ensure both are listed as peer dependencies.
Do not use in server-side rendering (SSR) without checking for window.
Ensure all SCSS imports start with './' or '../'.
Add include option if you want to restrict transformation to specific folders.
Update selectors or tests to use generated unique IDs.
Upgrade to v1.0.11 or later.
Run 'npm install --save-dev node-sass' or switch to sass.
Use sass (dart-sass) instead of node-sass.