Skip to content

Commit 76644d8

Browse files
committed
Dynamically import shiki and disable minification
1 parent f6b10ba commit 76644d8

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

packages/comment-widget/src/base-comment-item.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { msg } from '@lit/localize';
33
import { css, html, LitElement, unsafeCSS } from 'lit';
44
import { property, state } from 'lit/decorators.js';
55
import { unsafeHTML } from 'lit/directives/unsafe-html.js';
6-
import { codeToHtml } from 'shiki/bundle/full';
76
import baseStyles from './styles/base';
87
import contentStyles from './styles/content.css?inline';
98
import { formatDate, timeAgo } from './utils/date';
@@ -53,6 +52,8 @@ export class BaseCommentItem extends LitElement {
5352
const content = codeblock.textContent || '';
5453

5554
try {
55+
const { codeToHtml } = await import('shiki/bundle/full');
56+
5657
const html = await codeToHtml(content, {
5758
lang,
5859
theme: 'github-dark',

packages/comment-widget/vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ export default defineConfig({
1919
formats: ['es'],
2020
fileName: 'index',
2121
},
22+
minify: false,
2223
},
2324
});

0 commit comments

Comments
 (0)