Karma preprocessor to compile Sass files on the fly with sass. In contrast of karma-sass-preprocessor, it does not write any intermediate file to the disk, and does not use any Gulp plugin.
npm install @alasdair/karma-scss-preprocessor sass --save-dev
This is a fork of karma-scss-preprocessor. The main difference is that sass
is used instead of node-sass
.
Note: since v5.0, sass is used as a peer dependency. That is why you need to install it along with this module.
See sass options for more details.
module.exports = function (config) {
config.set({
// You may need to configure the plugin like this since
// older verisons of karma don't support scopes out of the box
plugins: [ '@alasdair/karma-scss-preprocessor', 'karma-*' ],
preprocessors: {
'src/**/*.scss': ['scss']
},
scssPreprocessor: {
options: {
sourceMap: true,
includePaths: ['bower_components']
}
}
});
};