
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
@metahub/karma-sass-preprocessor
Advanced tools
Karma preprocessor to compile sass and scss files with sourcemap and watch support
Karma preprocessor to compile sass and scss files with node-sass.
npm install node-sass @metahub/karma-sass-preprocessor --save-dev
All the node-sass options can be passed to sassPreprocessor.options.
In addition the preprocessor accept a transformPath function, to rewrite the path on which the files are deployed on the Karma webserver. If not specified, the processed files will be accessible with the same paths as the originals with the extension .css instead of .sass or .scss. For example test/fixtures/myStyle.scss will be deployed as base/test/fixtures.myStyle.css.
module.exports = function(config) {
config.set({
files: ['src/sass/main.scss'],
plugins: ['@metahub/karma-sass-preprocessor', 'karma-*'],
preprocessors: {
'**/*.scss': ['sass']
},
sassPreprocessor: {
options: {
// To include inlined sourcemaps as data URIs
sourceMap: true,
// If compiled sass/scss files import external libraries
includePaths: ['node_modules', 'path/to/imported/lib'],
outputStyle: 'expanded',
},
// File src/sass/main.sccs will be accessible in the unit test on path base/styles/main.css
transformPath: filePath => filePath.replace(/\.sccs$/, '.css').replace('src/sass', 'styles')
},
});
};
Note: Karma can auto-load plugins named karma-* (see plugins). Unfortunatly it doesn't work with scoped packages, therefore @metahub/karma-sass-preprocessor has to be explicitly added to the plugins configuration. In order to continue to automatically load other plugins you can add karma-* to the plugins configuration.
Note: @metahub/karma-sass-preprocessor embed its own watcher to monitor sass dependency, therefore only the sass entry point has to be configured in Karma. If Karma is configured with autoWatch: true, the modification of an imported sass partial will trigger a new build and test run.
module.exports = function(config) {
config.set({
files: ['src/sass/main.scss', 'test/fixtures/myFixture.scss'],
plugins: ['@metahub/karma-sass-preprocessor', 'karma-*'],
preprocessors: {
'src/**/*.scss': ['sass_1'],
'test/fixtures/**/*.scss': ['sass_2'],
},
customPreprocessors: {
sass_1: {
base: 'sass',
options: {
sourceMap: true,
precision: 5,
outputStyle: 'expanded',
},
},
sass_2: {
base: 'sass',
// File test/fixtures/myFixture.sccs will be accessible in the unit test on path base/2/myFixture.css
transformPath: filePath => filePath.replace(/\.sccs$/, '.css').replace('test/fixtures', '2')
options: {
sourceMap: false,
precision: 8,
outputStyle: 'compressed',
},
},
},
});
};
FAQs
Karma preprocessor to compile sass and scss files with sourcemap and watch support
The npm package @metahub/karma-sass-preprocessor receives a total of 0 weekly downloads. As such, @metahub/karma-sass-preprocessor popularity was classified as not popular.
We found that @metahub/karma-sass-preprocessor demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.