File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,4 +2,4 @@ if (!global.MathJax) global.MathJax = {};
22
33global . MathJax . __dirname = __dirname ;
44
5- module . exports = require ( './node-main.js' ) ;
5+ module . exports = require ( './node-main.js' ) . MathJax ;
Original file line number Diff line number Diff line change @@ -27,8 +27,10 @@ import '../core/core.js';
2727import '../adaptors/liteDOM/liteDOM.js' ;
2828import { source } from '../source.js' ;
2929
30- const path = eval ( 'require("path")' ) ; // get path from node, not webpack
31- const dir = global . MathJax . config . __dirname ; // set up by node-main.mjs or node-main.cjs
30+ const MathJax = global . MathJax ;
31+
32+ const path = eval ( 'require("path")' ) ; // get path from node, not webpack
33+ const dir = MathJax . config . __dirname ; // set up by node-main.mjs or node-main.cjs
3234
3335/*
3436 * Set up the initial configuration
@@ -78,7 +80,7 @@ MathJax._.mathjax.mathjax.asyncLoad = function (name) {
7880 * The init() function returns a promise that is resolved when MathJax is loaded and ready, and that
7981 * is passed the MathJax global variable when it is called.
8082 */
81- const init = ( config = { } ) => {
83+ const init = MathJax . init = ( config = { } ) => {
8284 combineConfig ( MathJax . config , config ) ;
8385 return Loader . load ( ...CONFIG . load )
8486 . then ( ( ) => CONFIG . ready ( ) )
@@ -88,6 +90,6 @@ const init = (config = {}) => {
8890}
8991
9092/*
91- * Export the init() function
93+ * Export MathJax (with its init() function)
9294 */
93- export { init } ;
95+ export { MathJax } ;
Original file line number Diff line number Diff line change 11import './node-main-setup.mjs' ;
2- export * from './node-main.js' ;
2+ import { MathJax } from './node-main.js' ;
3+ export default MathJax ;
4+ export const init = MathJax . init ;
Original file line number Diff line number Diff line change 11module . exports = ( pkg ) => {
22 pkg . output . library = {
3- name : 'init ' ,
3+ name : 'MathJax ' ,
44 type : 'commonjs' ,
5- export : 'init'
5+ export : [ 'MathJax' ] ,
66 }
77 return pkg ;
8- }
8+ }
You can’t perform that action at this time.
0 commit comments