Skip to content

Commit

Permalink
fix: adjust browser build to MathJax v4
Browse files Browse the repository at this point in the history
Work in progress, cf. the discussion at mathjax/MathJax#3086
  • Loading branch information
pkra committed Aug 25, 2023
1 parent 911f6a7 commit 8636748
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 15 deletions.
18 changes: 18 additions & 0 deletions components/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"build": {
"id": "[ams]/unicode-math",
"component": "input/tex/extension/unicode-math",
"js": "../js",
"ts": "../ts",
"targets": ["unicode-math.ts"]
},
"webpack": {
"name": "unicode-math",
"js": "../js",
"libs": [
"components/src/input/tex-base/lib",
"components/src/core/lib"
],
"dist": "../browser/"
}
}
1 change: 1 addition & 0 deletions components/unicode-math.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import './lib/unicode-math.js'; // NOTE magical path for MathJax's build process
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"fromTeX": "cd bin && perl make_maps && perl make_test",
"pretest": "npx tsc",
"test": "node test/base.js && node test/corrections.js",
"build": "npx tsc && node ./node_modules/mathjax-full/components/bin/makeAll"
"build": "npx tsc && node ./node_modules/mathjax-full/components/bin/makeAll --mjs components"
},
"devDependencies": {
"jsdom": "19.0.0",
Expand Down
4 changes: 2 additions & 2 deletions test/unicode-math-browser.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
MathJax = {
loader: {
load: ['[test]/unicode-math.js'],
paths: {test: '../browser/'}
paths: {test: '../browser'}
},
tex: {
packages: {'[+]': ['unicode-math']}
}
};
</script>
<script type="text/javascript" id="MathJax-script" async
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js">
src="https://cdn.jsdelivr.net/npm/mathjax@4.0.0-beta.3/tex-chtml.js">
</script>


Expand Down
12 changes: 0 additions & 12 deletions webpack.config.js

This file was deleted.

0 comments on commit 8636748

Please sign in to comment.