js: Use unminified KaTeX (and minifiy it with everything else).

Since our Webpack config passes pre-minified JS files to
script-loader, they can’t be used as modules.  Use the normal
unminified version, letting Webpack minify it and give us source maps.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2020-08-03 15:03:55 -07:00 committed by Tim Abbott
parent c523657d48
commit f63d132276
4 changed files with 4 additions and 5 deletions

View File

@ -20,7 +20,7 @@ zrequire("stream_data");
zrequire("user_groups"); zrequire("user_groups");
const markdown = rewiremock.proxy(() => zrequire("markdown"), { const markdown = rewiremock.proxy(() => zrequire("markdown"), {
"katex/dist/katex.min.js": { katex: {
renderToString: () => { renderToString: () => {
throw new Error("some-exception"); throw new Error("some-exception");
}, },

View File

@ -1,6 +1,6 @@
"use strict"; "use strict";
const katex = require("katex/dist/katex.min.js"); const katex = require("katex");
const _ = require("lodash"); const _ = require("lodash");
const moment = require("moment"); const moment = require("moment");

View File

@ -1,4 +1,4 @@
import katex from "katex/dist/katex.min.js"; import katex from "katex";
import _ from "lodash"; import _ from "lodash";
// Parsing routine that can be dropped in to message parsing // Parsing routine that can be dropped in to message parsing

View File

@ -7,7 +7,6 @@
], ],
"archive": [ "archive": [
"./static/js/bundles/portico.js", "./static/js/bundles/portico.js",
"katex/dist/katex.min.js",
"./static/js/archive.js", "./static/js/archive.js",
"./static/js/colorspace.js", "./static/js/colorspace.js",
"./static/js/floating_recipient_bar.js", "./static/js/floating_recipient_bar.js",
@ -113,6 +112,6 @@
"./static/styles/portico/stats.scss", "./static/styles/portico/stats.scss",
"./static/js/stats/stats.js" "./static/js/stats/stats.js"
], ],
"app": ["./static/js/bundles/app.js", "katex/dist/katex.min.js"], "app": ["./static/js/bundles/app.js"],
"digest": ["./static/js/bundles/portico.js"] "digest": ["./static/js/bundles/portico.js"]
} }