Systemjs Jade loader plugin. Jade source code is processed by the Jade compiler and returned as a Javascript function. Includes are handled (first level only).
For SystemJS use, locate jade.js
in the application, and then locate it with map configuration:
System.config({
map: {
jade: 'path/to/jade.js'
}
});
For installing with jspm, run jspm install jade
.
var fn = require('template.jade!');
var html = fn(data);
If you add a loader definition, you can dispense with the ! e.g. var fn = require('template.jade');
SystemJS.config({
transpiler: "plugin-babel",
packages: {
...
},
meta: {
"*.jade": {
"loader": "jade"
}
}
});
For esm usage, the plugin exports two named exports: fn and html. Usage:
import { html } from 'template.jade'
or:
import { fn } from 'template.jade'
let html = fn(locals)
The default export is the template function:
import fn from 'template.jade'
let html = fn(locals)
This version is compatible with jspm version 0.17
jspm install
npm install
npm test
To test jspm bundling,
jspm bundle app
npm test bundle