Fixing CJS modules and Globals (#920)

* Working CJS modules.

* Changing cjs imports to es6.
This commit is contained in:
Ryan Randall
2017-10-08 12:56:07 -04:00
committed by Kevin Barabash
parent c4fed02329
commit 141afa091a
5 changed files with 3 additions and 16 deletions

View File

@@ -99,5 +99,4 @@ const renderMathInElement = function(elem, options) {
renderElem(elem, optionsCopy);
};
export default renderMathInElement;
module.exports = renderMathInElement;

View File

@@ -63,7 +63,7 @@ const generateParseTree = function(expression, options) {
};
const katex = {
module.exports = {
render: render,
renderToString: renderToString,
/**
@@ -74,5 +74,3 @@ const katex = {
__parse: generateParseTree,
ParseError: ParseError,
};
export default katex;

View File

@@ -19,7 +19,6 @@
"babel-eslint": "^7.2.0",
"babel-jest": "^20.0.3",
"babel-loader": "^7.1.2",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-transform-class-properties": "^6.23.0",
"babel-plugin-transform-runtime": "^6.15.0",
"babel-preset-es2015": "^6.18.0",

View File

@@ -27,14 +27,7 @@ function serveBrowserified(file, standaloneName) {
}
const options = {
transform: [babelify.configure({
presets: ["es2015", "flow"],
plugins: [
"transform-runtime",
"transform-class-properties",
"add-module-exports",
],
})],
transform: [babelify],
};
if (standaloneName) {
options.standalone = standaloneName;

View File

@@ -7,7 +7,6 @@ const katexConfig = {
filename: 'katex.js',
library: 'katex',
libraryTarget: 'umd',
libraryExport: 'default',
},
};
@@ -26,7 +25,6 @@ const autoRenderConfig = {
filename: 'auto-render.js',
library: 'renderMathInElement',
libraryTarget: 'umd',
libraryExport: 'default',
},
};