Revert "katex: Update the `require` path to point to the new one."

This implementation never worked, for two reasons:

(1) The logic for getting the path to the katex package had invalid
syntax in the version of Node we use.

(2) The KaTeX package bundled by webpack doesn't seem to be importable
from Node at all.
This commit is contained in:
Tim Abbott 2018-01-23 12:02:53 -08:00
parent 15dd94035c
commit 852af0e3c5
1 changed files with 1 additions and 9 deletions

View File

@ -36,15 +36,7 @@ SOFTWARE.
let katex;
try {
// Attempt to import KaTeX from the production bundle
const paths = require('/home/zulip/deployments/current/staticfiles.json').paths.values();
var katexPath = paths[paths.lastIndexOf('webpack-bundles/katex-')];
if (!katexPath.endsWith('js')) {
// This is to anticipate that the webpack staticfiles ordering may not be
// deterministic, that katex-somehash.js.map gets selected instead of
// katex-somehash.js
katexPath = paths[paths.indexOf('webpack-bundles/katex-')];
}
katex = require('/home/zulip/prod-static/' + katexPath);
katex = require("/home/zulip/prod-static/min/katex.js");
} catch (ex) {
// Import KaTeX from node_modules (development environment) otherwise
katex = require("../../node_modules/katex/dist/katex.js");