@sam I think Iāve made some pretty significant progress on this, with one significant caveat. Iām not sure where to load the desired components from. Expressed in code,
window.MathJax = {
loader: {
// This does not work:
// paths: { mathjax: getURLWithCDN("/assets/mathjax") },
// But this works great:
paths: { mathjax: "https://cdn.jsdelivr.net/npm/mathjax@4.1.0" },
load: ["core", "input/tex", "input/mml", "output/chtml", "output/svg"],
},
// More configuration ...
};
When I say the commented out version doesnāt work, I mean that I get the explicit message:
MathJax(core): Canāt load ā/assets/mathjax/core.jsā
Note that, in both cases, the loadMathJax function is pulling the MathJax startup from the local copy. That is, Iāve got the following in
/discourse/frontend/discourse/app/static/mathjax-bundle.js
export * from "mathjax/startup.js";
Then, loadMathJax defined in
/discourse/frontend/discourse/app/lib/load-mathjax.js
calls
const bundle = await import("discourse/static/mathjax-bundle");
This suggests a couple of possibilities:
- Perhaps
/assets/mathjax is not the correct location or
- Perhaps, these assets need to be registered in some way so that they appear in the dist?
Working off of the CDN version, it looks like I can make significant progress, but I assume thatās a major blocker for you.
I could share my code with you, if you like, but maybe thatās enough information for a diagnosis?