gum-tmodjs
Version:
由 [`tmodjs`](https://github.com/aui/tmodjs) 改造的 [`artTemplate`](https://github.com/aui/artTemplate) loader,用于webpack 。
17 lines (11 loc) • 379 B
JavaScript
;
var Tmod = require('./src/tmod');
module.exports = function (content) {
this.cacheable && this.cacheable();
var options = this.query||{};
var tmod = new Tmod('./', options)
var path = this.resourcePath.replace(/\\/g, "/");
var output = tmod.compile(path);
if (!output) throw new Error(output); ;
return output;
}