babel-plugin-nornj-loader
v1.0.14
Published
make [nornj-loader](https://github.com/joe-sky/nornj/tree/master/packages/nornj-loader) enabled to run in babel.
Downloads
48
Readme
babel-plugin-nornj-loader
make nornj-loader enabled to run in babel.
Install
npm install --save-dev babel-plugin-nornj-loader
Usage
in .babelrc
file:
{
"plugins": [
["babel-plugin-nornj-loader", {
"extensions": [
".t.html"
]
}]
]
}
How It Works
import tmpls from './grid.t.html';
transform to:
/* babel-plugin-nornj-loader './grid.t.html' */
var tmpls = {
row: _nornj2.default.compileH({
_njTmplKey: -1333168606,
useString: false,
fn1: function anonymous(p1,p2,p3,p4,p5) {
return p2.d('children');
},
...
}),
rowLeft: ...,
rowRight: ...,
col: ...,
...
};
License
MIT