karma-pug-preprocessor
Preprocessor to compile Pug templates on the fly.
Installation
The easiest way is to keep karma-pug-preprocessor
as a devDependency in your package.json
.
You can simple do it by:
npm install karma-pug-preprocessor --save-dev
Configuration
Following code shows the default configuration...
// karma.conf.jsmodule { config;};
As with other preprocessors, One can further configure the options passed to Pug either by adding an extra property to your karma.conf.js
:
pugPreprocessor: options: pretty: false
Or by abstracting this into a custom preprocessor:
customPreprocessors: myPug: base: 'pug' options: pretty: false
Chaining preprocessors
The pug preprocessor can be used in conjunction with others (eg. karma-ng-html2js-preprocessor). Simply include it in an array that specifies the chain of processors.
// karma.conf.jsmodule { config;};
For more information on Karma see the homepage.