This repository has been archived by the owner on Nov 3, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 therequire 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
andvite-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:
vi.spyOn()
needs asynchronous import and will only work if you import the identical path and not only the identical file as the component you are testing.@
for./src
makes testing much easier as it prevents referencing the correct file via two different paths