fast-sass-loader
raw JSON → 2.0.1 verified Sat Apr 25 auth: no javascript maintenance
A webpack loader for Sass/SCSS that claims 5-10x faster compilation than sass-loader by deduplicating @imports, merging all Sass files into a single compile unit, and caching results internally. Version 2.x switched from node-sass to dart-sass (npm 'sass') as the default compiler, with an `implementation` option to restore node-sass. It also provides built-in url() resolution, eliminating the need for resolve-url-loader. Key trade-offs include no source map support and limited loader configuration compared to sass-loader. Release cadence is low; last update was 2020. Requires webpack 1–5 and sass 1.x as peer dependencies.
Common errors
error Module not found: Error: Cannot resolve module 'sass' ↓
cause Missing peer dependency 'sass' (or 'node-sass' if configured).
fix
npm install sass --save-dev
error Error: fast-sass-loader: no implementation found, you should install 'sass' or 'node-sass' peer dependency ↓
cause Neither dart-sass nor node-sass is installed.
fix
Install either: npm install sass --save-dev OR npm install node-sass --save-dev
error TypeError: this.getOptions is not a function ↓
cause Using fast-sass-loader with webpack version below 4 (requires getOptions API).
fix
Upgrade webpack to version 4 or later, or pin fast-sass-loader to version 1.x.
Warnings
breaking In v2.x, default implementation changed from node-sass to dart-sass (npm sass). Existing projects relying on node-sass may fail. ↓
fix Set options.implementation to require('node-sass') in webpack config, or migrate to dart-sass syntax.
gotcha No source map support. If you need source maps for debugging, use sass-loader instead. ↓
fix Switch to sass-loader or disable source map requirement for Sass.
gotcha Loader configuration options like 'includePaths' are passed directly to the Sass compiler, not all sass-loader options are supported. ↓
fix Refer to the fast-sass-loader documentation for supported options; common missing options include 'sourceMap' and 'outputStyle'.
deprecated The package has not been updated since 2020 and may not be compatible with webpack 5+ or latest dart-sass. ↓
fix Consider sass-loader for active support, or fork the project to apply updates.
Install
npm install fast-sass-loader yarn add fast-sass-loader pnpm add fast-sass-loader Imports
- fast-sass-loader wrong
const FastSassLoader = require('fast-sass-loader').defaultcorrectimport FastSassLoader from 'fast-sass-loader'
Quickstart
// webpack.config.js
module.exports = {
module: {
rules: [
{
test: /\.(scss|sass)$/,
use: [
'css-loader',
{
loader: 'fast-sass-loader',
options: {
includePaths: ['src/styles'],
data: '$env: production;'
}
}
]
}
]
}
};