emersonbottero / vitepress-plugin-mermaid

Add mermaid support for Vitepress
MIT License
95 stars 22 forks source link

fix: production build in vite5 #65

Closed bonyuta0204 closed 11 months ago

bonyuta0204 commented 11 months ago

Description

This pull request addresses the issue "Diagram not Displayed in Production Build", ensuring that diagrams are properly shown in the production environment.

Cause of the Problem

The root of the problem lies in the plugin code. In the production build, the transformation method intended to replace comments and install global components fails to execute correctly. The specific issue is that the targeted comment, which is crucial for the transformation, vanishes before the process can take place.

Solution Description

I've modified the transformation logic. Now, it does not rely on comments.

emersonbottero commented 11 months ago

thanks for the fix last version published.. you can test it now 😁

bonyuta0204 commented 11 months ago

@emersonbottero Thank you for publishing the fix! I've confirmed it's working now.