Skip to content

Commit 2d4f4a4

Browse files
committed
transpile files imported by webpack
1 parent cf19a75 commit 2d4f4a4

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

mdxToComponent.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
const React = require('react');
1+
var React = require('react');
2+
3+
module.exports = function (code) {
4+
var module = { exports: null };
5+
var createFactory = React.createFactory,
6+
createElement = React.createElement;
27

3-
module.exports = (code) => {
4-
const module = {exports: null};
5-
const {createFactory, createElement} = React;
68
eval(code); /* eslint no-eval: 0 */
79
return module.exports;
810
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-static-markdown",
3-
"version": "0.0.1",
3+
"version": "0.0.2",
44
"description": "Markdown files utils for react-static",
55
"main": "index.js",
66
"scripts": {

renderMdx.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
const MDXC = require('mdxc');
1+
var MDXC = require('mdxc');
22

3-
const mdxc = new MDXC({
3+
var mdxc = new MDXC({
44
commonJS: true,
55
pragma: 'createElement',
66
linkify: true,
7-
typographer: true,
7+
typographer: true
88
});
99

10-
module.exports = markdown => mdxc.render(markdown);
10+
module.exports = function (markdown) {
11+
return mdxc.render(markdown);
12+
};

0 commit comments

Comments
 (0)