Skip to content

Commit

Permalink
js: Use unminified KaTeX (and minifiy it with everything else).
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
andersk authored and timabbott committed Aug 7, 2020
1 parent c523657 commit f63d132
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion frontend_tests/node_tests/markdown_katex.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ zrequire("stream_data");
zrequire("user_groups");

const markdown = rewiremock.proxy(() => zrequire("markdown"), {
"katex/dist/katex.min.js": {
katex: {
renderToString: () => {
throw new Error("some-exception");
},
Expand Down
2 changes: 1 addition & 1 deletion static/js/markdown.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";

const katex = require("katex/dist/katex.min.js");
const katex = require("katex");
const _ = require("lodash");
const moment = require("moment");

Expand Down
2 changes: 1 addition & 1 deletion static/shared/js/fenced_code.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import katex from "katex/dist/katex.min.js";
import katex from "katex";
import _ from "lodash";

// Parsing routine that can be dropped in to message parsing
Expand Down
3 changes: 1 addition & 2 deletions tools/webpack.assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
],
"archive": [
"./static/js/bundles/portico.js",
"katex/dist/katex.min.js",
"./static/js/archive.js",
"./static/js/colorspace.js",
"./static/js/floating_recipient_bar.js",
Expand Down Expand Up @@ -113,6 +112,6 @@
"./static/styles/portico/stats.scss",
"./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"]
}

0 comments on commit f63d132

Please sign in to comment.