Skip to content

Build your personal knowledge base with Trilium Notes

feat(ckeditor5-math): use dynamic import to reduce loading time

Elian Doranf503c4ca6ce0
diff --git a/packages/ckeditor5-math/src/index.ts b/packages/ckeditor5-math/src/index.ts
index eac4d7b223..fca15d1b00 100644
--- a/packages/ckeditor5-math/src/index.ts
+++ b/packages/ckeditor5-math/src/index.ts
@@ -1,9 +1,6 @@
import ckeditor from './../theme/icons/math.svg?raw';
import './augmentation.js';
-import "../theme/mathform.css";
-import 'mathlive';
-import 'mathlive/fonts.css';
-import 'mathlive/static.css';
+import '../theme/mathform.css';
export { default as Math } from './math.js';
export { default as MathUI } from './mathui.js';
diff --git a/packages/ckeditor5-math/src/ui/mathinputview.ts b/packages/ckeditor5-math/src/ui/mathinputview.ts
index 027b7aab9b..2eb0347e58 100644
--- a/packages/ckeditor5-math/src/ui/mathinputview.ts
+++ b/packages/ckeditor5-math/src/ui/mathinputview.ts
@@ -2,6 +2,7 @@
// and keeps them in sync for the CKEditor 5 math dialog.
import { View, type Locale, type FocusableView } from 'ckeditor5';
import 'mathlive/fonts.css'; // Auto-bundles offline fonts
+import 'mathlive/static.css'; // Static styles for mathlive
declare global {
interface Window {