ravenq / markdown-it-vue

The vue lib for markdown-it.
MIT License
348 stars 67 forks source link

Bundle size is massive #18

Closed douglasg14b closed 4 years ago

douglasg14b commented 4 years ago

The bundle size of markdown-it-vue is enormous at 5MB. In our web app markdown-it-vue makes up more than 60% of it's total size. And that's with a couple of already heavy libraries.

wxk6b1203 commented 4 years ago

Does the author of this bundle have any idea to make it smaller? The graph below is my analysis result: image

wxk6b1203 commented 4 years ago

I guess MAYBE there is a strong relevance between this situation of large size and syntax highlighting. At markdown-it's official demo, the size of markdown-it.js is simply 69.5k. The highlight style looks like: image After switching to markdown-it-vue, it looks like: image

With some other bundle and plugins, my App becomes a huge package and need to transfer more than 3.2MB data. It is really annoying.

What if detach this bundle into some pieces and allow users to import them? I found that you import a lot. Just a suggestion. I am not pro on js and from-end. image

muhsalaa commented 4 years ago

im following this

tincho425 commented 4 years ago

I had the same problem, bundle size up to 5MB, non-viable.

wxk6b1203 commented 4 years ago

image

After removing flowchart, echarts and mermaid, the size of this bundle becomes more acceptable after gzipped. I forked this proj. It becomes useful upon my personal development.

tincho425 commented 4 years ago

Thanks for the advice! It seems It's the only solution. 🤔

douglasg14b commented 4 years ago

In my case I just rewrote it for our project.

ravenq commented 4 years ago

I has reduce the boudle size, see #24

ravenq commented 4 years ago

and mardown-it-vue-light is avaliable.