Skip to content
Snippets Groups Projects
Commit 2f0335e1 authored by Jose Ivan Vargas Lopez's avatar Jose Ivan Vargas Lopez
Browse files

Removed the remains of katex from vendor assets and load everything via webpack

parent ad9e3dfe
No related branches found
No related tags found
No related merge requests found
Showing
with 30 additions and 8 deletions
// import katex from 'katex';
// import katexCSS from 'katex/dist/katex.css';
import Flash from './flash';
 
// Renders math using KaTeX in any element with the
Loading
Loading
@@ -28,16 +29,13 @@ function renderWithKaTeX(elements, katex) {
 
export default function renderMath($els) {
if (!$els.length) return;
import(/* webpackChunkName: 'katex' */ 'katex').then((katex) => {
$.get(gon.katex_css_url, () => {
const css = $('<link>', {
rel: 'stylesheet',
type: 'text/css',
href: gon.katex_css_url,
});
css.appendTo('head');
import(/* webpackChunkName: 'katex' */ 'katex/dist/katex.css')
.then(() => {
renderWithKaTeX($els, katex);
})
.catch((err) => {
Flash(`Can't load katex css ${err}`);
});
}).catch((err) => {
Flash(`Can't load katex module: ${err}`);
Loading
Loading
Loading
Loading
@@ -128,6 +128,29 @@ var config = {
name: '[name].[hash].[ext]',
}
},
{
test: /katex.css$/,
include: /node_modules\/katex\/dist/,
exclude: /(vendor\/assets)/,
use: [
{ loader: 'style-loader' },
{
loader: 'css-loader',
options: {
name: '[name].[hash].[ext]'
}
},
],
},
{
test: /\.(eot|ttf|woff|woff2)$/,
include: /node_modules\/katex\/dist\/fonts/,
exclude: /(vendor\/assets)/,
loader: 'file-loader',
options: {
name: '[name].[hash].[ext]',
}
},
{
test: /monaco-editor\/\w+\/vs\/loader\.js$/,
use: [
Loading
Loading
Loading
Loading
@@ -69,6 +69,7 @@
"react-dev-utils": "^0.5.2",
"select2": "3.5.2-browserify",
"sql.js": "^0.4.0",
"style-loader": "^0.19.1",
"svg4everybody": "2.1.9",
"three": "^0.84.0",
"three-orbit-controls": "^82.1.0",
Loading
Loading
File deleted
File deleted
File deleted
File deleted
File deleted
File deleted
File deleted
File deleted
File deleted
File deleted
File deleted
File deleted
File deleted
File deleted
File deleted
File deleted
File deleted
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment