halo-sigs / plugin-text-diagram

为默认编辑器和文章渲染提供文本绘图支持。
GNU General Public License v3.0
5 stars 1 forks source link

Remove mermaid imports to resolve bundle size issue #12

Closed ruibaby closed 10 months ago

ruibaby commented 10 months ago

This PR removes the import of the mermaid dependency and does not build it into the main.js file, as this causes the main.js file to become very large. Additionally, due to the current front-end plugin mechanism of Halo, we cannot use es module and dynamic import, resulting in an increasingly large bundle.js for plugins.

This PR changes the loading of mermaid resources in the editor to be consistent with the loading method used on the theme side.

Before:

image

After:

image

/kind improvement

Remove mermaid imports to resolve bundle size issue
f2c-ci-robot[bot] commented 10 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JohnNiang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/halo-sigs/plugin-text-diagram/blob/main/OWNERS)~~ [JohnNiang] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment