{"library":"sass-loader","title":"sass-loader","description":"Webpack loader that compiles Sass/SCSS files to CSS, using Dart Sass, Node Sass, or Sass Embedded. Current stable version is 16.0.7, released in February 2026, with a monthly release cadence. Since v16, the default Sass API is the modern JS API (breaking change from legacy). It uses webpack's module resolution for @import and @use, eliminating the need for `~` prefix. Key differentiators: seamless integration with webpack ecosystem, support for multiple Sass implementations, and automatic resolution of Sass partials.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install sass-loader"],"cli":null},"imports":["module.exports = { module: { rules: [ { test: /\\.s[ac]ss$/i, use: ['style-loader', 'css-loader', 'sass-loader'] } ] } }","import type { SassLoaderOptions } from 'sass-loader'","import sassLoader from 'sass-loader'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"// webpack.config.js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.s[ac]ss$/i,\n        use: [\n          'style-loader',\n          'css-loader',\n          {\n            loader: 'sass-loader',\n            options: {\n              // Use modern API (default since v16)\n              api: 'modern-compiler',\n              sassOptions: {\n                // Dart Sass options\n                style: 'compressed',\n                sourceMap: true,\n              },\n            },\n          },\n        ],\n      },\n    ],\n  },\n};\n\n// style.scss\n$body-color: red;\nbody {\n  color: $body-color;\n}\n\n// app.js\nimport './style.scss';","lang":"javascript","description":"Basic webpack configuration for compiling Sass/SCSS with Dart Sass via sass-loader, using the modern-compiler API introduced in v16.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}