lucpotage / vue-katex

Vue plugin for KaTeX
MIT License
128 stars 22 forks source link

migrate to vite, replace require by import #67

Open hhaensel opened 1 year ago

hhaensel commented 1 year ago

Migration to Vite/Vitest and elimination of require

When using your brilliant vue-plugin for our package StippleLatex.jl via umd file, I stumbled across the require not found issue #59.

After I couldn't get rid of it easily with the current setup of vue-katex, partly due to outdated packages, I decided to migrate the plugin to Vite and spend myself a learning in Vue/Vite/Vitest.

I did some renaming according to Vite's recommendation and updated all packages to their latest versions that were available for Vue-2. I also moved deepmerge to the external packages as that blew up the umd file from 3 to 200 kB.

Currently the output files are named vite-plugin-katex.es.js and vite-plugin-katex.umd.js.

@lucpotage @shadskii

As I am a complete beginner in Vue/Vite, I'd be happy if you could comment on this PR. In particular, I am not sure whether it was a good choice to move deepmerge to external.

Nevertheless, I hope that this PR can make the development of a future Vue-3 plugin easier.

My learnings or biggest road blocks during development were: