-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
31 lines (22 loc) · 803 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
'use strict';
var Mincer = require('mincer'),
env = new Mincer.Environment(process.cwd()),
prop = require('mincer/lib/mincer/common').prop;
// export environment
module.exports = env;
// sources
env.appendPath('priv/source/js');
env.appendPath('priv/source/css');
// autoprefixer
env.enable("autoprefixer");
// React JSX engine
var JsxEngine = Mincer.JsxEngine = function JsxEngine() {
Mincer.Template.apply(this, arguments);
this.jsx = Mincer.Template.libs.jsx || require('react-tools');
};
require('util').inherits(JsxEngine, Mincer.Template);
JsxEngine.prototype.evaluate = function evaluate(context, locals) {
this.data = this.jsx.transform(this.data);
};
env.registerEngine('.jsx', Mincer.JsxEngine);
prop(Mincer.JsxEngine, 'defaultMimeType', 'application/javascript');