Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions components/mjs/a11y/speech/speech.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import {SpeechHandler} from '#js/a11y/speech.js';
if (MathJax.loader) {
let path = Package.resolvePath('[sre]', false);
if (!hasWindow) {
if (MathJax.config.loader.require?.resolve) {
const require = MathJax.config.loader.require;
const REQUIRE = typeof require !== 'undefined' ? require : MathJax.config.loader.require;
if (REQUIRE?.resolve) {
const pool = MathJax.config.options?.worker?.pool || 'speech-workerpool.js';
path = path.replace(/\/bundle\/sre$/, '/cjs/a11y/sre');
path = require.resolve(`${path}/${pool}`).replace(/\/[^\/]*$/, '');
path = REQUIRE.resolve(`${path}/${pool}`).replace(/\/[^\/]*$/, '');
} else {
path = '';
}
Expand Down
1 change: 0 additions & 1 deletion components/mjs/a11y/sre/sre.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import './lib/sre.js';
import './sre_config.js';
import * as Sre from '#js/a11y/sre.js';

export {Sre};
20 changes: 0 additions & 20 deletions components/mjs/a11y/sre/sre_config.js

This file was deleted.

7 changes: 7 additions & 0 deletions components/sre-pack.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//
// Replacement for __dirname for sre-root directory
//

import { mjxRoot } from '@mathjax/src/components/root-pack.js';

export const sreRoot = () => mjxRoot() + '/sre';
4 changes: 4 additions & 0 deletions components/webpack.common.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ const PLUGINS = function (js, dir, target, font, jax, name) {
/mjs\/components\/mjs\/root\.js/,
'../../../components/root-pack.js'
),
new webpack.NormalModuleReplacementPlugin(
/mjs\/components\/mjs\/sre-root\.js/,
'../../../components/sre-pack.js'
),
new webpack.NormalModuleReplacementPlugin(
/mathjax-full\/js\//,
function (resource) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mathjax/src",
"version": "4.0.0-rc.1",
"version": "4.0.0-rc.2",
"description": "Beautiful and accessible math in all browsers. MathJax is an open-source JavaScript display engine for LaTeX, MathML, and AsciiMath notation that works in all browsers and in server-side node applications. This package includes the source code as well as the packaged components.",
"keywords": [
"MathJax",
Expand Down
2 changes: 1 addition & 1 deletion ts/components/cjs/root.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ declare const __dirname: string;
* @return {string} The MathJax component root directory
*/
export function mjxRoot(): string {
return __dirname.replace(/[cm]js\/components\/[cm]js$/, (_) => 'bundle');
return __dirname.replace(/[cm]js\/components\/[cm]js$/, 'bundle');
}
2 changes: 1 addition & 1 deletion ts/components/cjs/sre-root.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
declare const __dirname: string;

/**
* @return {string} The MathJax component root directory
* @return {string} The MathJax mjs SRE root directory
*/
export function sreRoot(): string {
return __dirname.replace(/components\/[cm]js$/, 'a11y/sre');
Expand Down
2 changes: 1 addition & 1 deletion ts/components/mjs/root.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
export function mjxRoot(): string {
return new URL(import.meta.url).pathname.replace(
/[cm]js\/components\/[cm]js\/root.js$/,
(_) => 'bundle'
'bundle'
);
}
2 changes: 1 addition & 1 deletion ts/components/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
* @author dpvc@mathjax.org (Davide Cervone)
*/

export const VERSION = '4.0.0-rc.1';
export const VERSION = '4.0.0-rc.2';