# karma-less-preprocessor

> A Karma plugin. Compile LESS on the fly.

Latest version **0.3.3** (published 2015-11-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install karma-less-preprocessor
pnpm add karma-less-preprocessor
yarn add karma-less-preprocessor
bun add karma-less-preprocessor
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.3 |
| Published | 2015-11-27 |
| First published | 2013-10-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | David Sergey |
| Maintainers | nirth |
| Keywords | karma-plugin, karma-preprocessor, less, lesscss, less-css |

## Links

- npm: https://www.npmjs.com/package/karma-less-preprocessor
- Repository: https://github.com/nirth/karma-less-preprocessor
- Homepage: https://github.com/nirth/karma-less-preprocessor#readme
- Issues: https://github.com/nirth/karma-less-preprocessor/issues
- npm.io page: https://npm.io/package/karma-less-preprocessor

## Dependencies (1)

- [less](https://npm.io/package/less.md) ~2.5

## Recent versions

- 0.3.3 (latest) — 2015-11-27
- 0.2.2 — 2014-05-08
- 0.2.1 — 2014-05-06
- 0.2.0 — 2014-01-14
- 0.1.9 — 2014-01-13
- 0.1.7 — 2013-10-22
- 0.1.4 — 2013-10-22
- 0.1.5 — 2013-10-15
- 0.1.3 — 2013-10-15
- 0.1.2 — 2013-10-15
- 0.1.1 — 2013-10-15

## README

# karma-less-preprocessor

## Configuration

### options
 
 
 * `save`: [`Boolean`] Indicates whether result of compilation should be saved in project directory.
 * `paths`: [`Array`] of paths to folders that should be used for file lookup when using `@import`.
 * `compress`: [`Boolean`] Indicates whether css should be compressed or not.

> `options` key could contain any other standard less options as well

  For exmaple, `rootpath` option is specified in below example configuration

### additionalData

 * `additionalData`:`Object` which can contain the `Object` modifyVars and/or the `Object` globalVars. With those you can tell the less compiler to add global variables or modify existing ones during compilation.
 
### Example configuration

	module.exports = (config) -> config.set {
	        basePath: 'src'
	        preprocessors:
	                '**/*.coffee': ['coffee']
	                'resources/**/*.less': ['less']
	
	        files: [
	                '**/*.coffee'
	                'resources/less/index.less'
	        ]
	
	        coffeePreprocessor:
	                options:
	                        bare: true
	                        sourceMap: false
	                transformPath: (path) -> path.replace(/\.coffee$/, '.js')
	
	        lessPreprocessor:
	                options:
	                        paths: ['resources/less']
	                        save: true
	                        rootpath: 'target/resources/img'
	                additionalData:
	                        modifyVars:
	                                'bodyColor': 'grey'
	                                'secondBoxColor': 'blue'
	                        globalVars:
	                                'globalBoxColor': 'red'
	                transformPath: (path) -> path.replace(/\.less$/, '.compiled.css')
	
	        
	        browsers: ['Chrome']
	        captureTimeout: 6000
	        hostname: 'localhost'
	        port: 9876
	
	        plugins: [
	                'karma-coffee-preprocessor'
	                'karma-less-preprocessor'
	                'karma-chrome-launcher'
	        ]
	
	        singleRun: false
	}

---
_Source: https://npm.io/package/karma-less-preprocessor · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
