mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-05 11:18:39 +00:00
Fixing CJS modules and Globals (#920)
* Working CJS modules. * Changing cjs imports to es6.
This commit is contained in:
committed by
Kevin Barabash
parent
c4fed02329
commit
141afa091a
@@ -99,5 +99,4 @@ const renderMathInElement = function(elem, options) {
|
||||
renderElem(elem, optionsCopy);
|
||||
};
|
||||
|
||||
|
||||
export default renderMathInElement;
|
||||
module.exports = renderMathInElement;
|
||||
|
4
katex.js
4
katex.js
@@ -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;
|
||||
|
@@ -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",
|
||||
|
@@ -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;
|
||||
|
@@ -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',
|
||||
},
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user