Skip to content

Commit c34d4a0

Browse files
committed
fix(pat-syntax-highlight): Do not load all languages.
Change the import so that no language is included by default. Instead import the languages dynamically. This reduces the download size when pat-syntaax-highlight is used significantly.
1 parent 19bbb53 commit c34d4a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/pat/syntax-highlight/syntax-highlight.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Pattern extends BasePattern {
3434
}
3535

3636
import(`highlight.js/styles/${theme}.css`);
37-
const hljs = (await import("highlight.js")).default;
37+
const hljs = (await import("highlight.js/lib/core")).default;
3838

3939
// Get the language
4040
let language = [..._el.classList, ...this.el.classList]

0 commit comments

Comments
 (0)