Skip to content

Repository files navigation

jade

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).

Installing

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.

Basic use

varfn=require('template.jade!');varhtml=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"
}
}
});

Module use

For esm usage, the plugin exports two named exports: fn and html. Usage:

import{html}from'template.jade'

or:

import{fn}from'template.jade'lethtml=fn(locals)

The default export is the template function:

importfnfrom'template.jade'lethtml=fn(locals)

jspm versions

This version is compatible with jspm version 0.17

Tests

jspm install
npm install
npm test

To test jspm bundling,

jspm bundle app
npm test bundle
* Thanks to Vsevolod Strukchinsky. plugin-jade was based on his jsx plugin https://github.com/floatdrop/plugin-jsx.

About

Jade loader plugin for jspm

Resources

Stars

13 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages