@alasdair/karma-scss-preprocessor

Karma preprocessor to compile SCSS on the fly with sass

Usage no npm install needed!

<script type="module">
  import alasdairKarmaScssPreprocessor from 'https://cdn.skypack.dev/@alasdair/karma-scss-preprocessor';
</script>

README

@alasdair/karma-scss-preprocessor

Latest Stable Version License NPM Downloads dependencies Status devDependencies Status peerDependencies Status

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.

Installation

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.

Configuration

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']
      }
    }
  });
};