is there a karma preprocessor for jade files? #572

fschwiet opened this Issue Jun 13, 2013 · 2 comments


None yet

2 participants


I was wondering if there is a karma preprocessor for jade files?


I'm pretty sure there is not, so I'm closing this out. I did write something that seems to be working for me, though I'm not sure if the solution is general enough that it'd work for anyone wanting to use jade. I do look forward to being able to inject the preprocessor in the manner described here: #565

This is working for me though, in case someone else searches for the same:

var fs = require("fs");
var jade = require("jade");

module.exports = function(content, file, basePath, done) {

    file.path = file.path + '.js';

    var jadeOptions = {
        filename: file.originalPath,
        client: true,
        pretty: true

    done("define(['jadeRuntime'], function(jade) { return " + jade.compile(content, jadeOptions) +"; });");

Besides using the jade module, I am also using the jade-amd module to package up jade's runtime.js so it can be included as well.

@fschwiet fschwiet closed this Jun 13, 2013

i know this is old, but just in case you hadn't seen this:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment