Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

is there a karma preprocessor for jade files? #572

Closed
fschwiet opened this Issue · 2 comments

2 participants

@fschwiet

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

@fschwiet

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
@tony-kerz

i know this is old, but just in case you hadn't seen this:
https://github.com/ojdx/karma-jade-preprocessor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.