Skip to content

Commit dc349f9

Browse files
authored
Merge pull request #1397 from mathjax/issue3476
Use cjs for node-main-setup so it works in bun as well as node. (mathjax/MathJax#3476)
2 parents 86d5722 + 49d8b61 commit dc349f9

4 files changed

Lines changed: 7 additions & 9 deletions

File tree

components/mjs/node-main/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"copy": [
66
"node-main.mjs",
77
"node-main.cjs",
8-
"node-main-setup.mjs"
8+
"node-main-setup.cjs"
99
]
1010
},
1111
"webpack": {
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
global.require = require;
2+
const path = require("path");
3+
4+
if (!global.MathJax) global.MathJax = {};
5+
global.MathJax.__dirname = __dirname;

components/mjs/node-main/node-main-setup.mjs

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import './node-main-setup.mjs';
1+
import './node-main-setup.cjs';
22
import {MathJax} from './node-main.js';
33
export default MathJax;
44
export const init = MathJax.init;

0 commit comments

Comments
 (0)