scss-loader
raw JSON → 0.0.1 verified Sat Apr 25 auth: no javascript deprecated
A webpack loader that compiles SCSS files into CSS with additional features like source maps and custom functions. Version 0.0.1 is an initial release with minimal documentation. It differentiates from sass-loader by offering built-in goodies but remains unmaintained and experimental. Release cadence is unknown. Status is deprecated due to lack of maintenance and limited features compared to sass-loader.
Common errors
error Module not found: Error: Can't resolve 'scss-loader' ↓
cause Package not installed in node_modules.
fix
Run npm install scss-loader --save-dev
error TypeError: scss-loader is not a function ↓
cause Incorrect import or webpack loader format.
fix
Use webpack's use array with object syntax: { loader: 'scss-loader', options: {} }
Warnings
deprecated Package is deprecated and no longer maintained. Use 'sass-loader' instead. ↓
fix Switch to sass-loader: npm install sass-loader sass --save-dev
gotcha No README or documentation provided, making configuration guesswork. ↓
fix Refer to source code for options; consider using better-documented alternatives.
gotcha Package version 0.0.1 suggests unstable API; unexpected breaking changes may occur. ↓
fix Pin exact version and test thoroughly if you must use it.
Install
npm install scss-loader yarn add scss-loader pnpm add scss-loader Imports
- default wrong
const scssLoader = require('scss-loader')correctimport scssLoader from 'scss-loader' - ScssLoaderOptions wrong
import { ScssLoaderOptions } from 'scss-loader'correctimport type { ScssLoaderOptions } from 'scss-loader' - sassFunctions wrong
const sassFunctions = require('scss-loader').sassFunctionscorrectimport { sassFunctions } from 'scss-loader'
Quickstart
// webpack.config.cjs
const scssLoader = require('scss-loader');
module.exports = {
module: {
rules: [
{
test: /\.scss$/,
use: [
'style-loader',
'css-loader',
{
loader: 'scss-loader',
options: {
sourceMap: true,
functions: {}
}
}
]
}
]
}
};