Skip to content

Commit

Permalink
Fix: Do not bundle markdownit for clientside
Browse files Browse the repository at this point in the history
  • Loading branch information
3y3 committed Dec 18, 2023
1 parent 343fa45 commit 345bc7c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/plugin/transform.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import MarkdownIt from 'markdown-it';
import type MarkdownIt from 'markdown-it';
import type {
MarkdownItPluginCb,
MarkdownItPluginOpts,
Expand Down Expand Up @@ -126,7 +126,8 @@ export function transform(options: Partial<PluginOptions> = {}) {

Object.assign(plugin, {
collect(input: string, {destRoot}: InputOptions) {
const md = new MarkdownIt().use((md) => {
const MdIt = dynrequire('markdown-it');
const md = new MdIt().use((md: MarkdownIt) => {
registerTransforms(md, {
classes,
runtime,
Expand Down

0 comments on commit 345bc7c

Please sign in to comment.