-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.js
48 lines (37 loc) · 1004 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/* jshint node: true */
/**
* @module ember-katex
* */
'use strict';
var fs = require('fs');
var path = require('path');
module.exports = {
name: 'ember-katex',
included: function(app) {
this._super.included.apply(this, ...arguments);
var libPath = path.join(app.bowerDirectory, 'KaTeX', 'dist');
var fontPath = path.join(libPath, 'fonts');
app.import(path.join(libPath, 'katex.min.js'), {
exports: {
katex: [
'default',
'render',
'renderToString',
'ParseError',
]
}
});
app.import(path.join(libPath, 'contrib', 'auto-render.min.js'), {
exports: {
renderMathInElement: ['default']
}
});
app.import(path.join('vendor', 'katex', 'shim.js'));
app.import(path.join(libPath, 'katex.min.css'));
fs.readdirSync(fontPath).forEach(function(font) {
app.import(path.join(fontPath, font), {
destDir: path.join('assets', 'fonts')
});
});
}
};