Skip to content

How to use esm version with CDN #2276

Closed Answered by posva
juliusfriedman asked this question in Help and Questions
Discussion options

You must be logged in to vote

I recall esm.sh having more options to properly handle dependencies.
The issue you have right now is that jsdelivr imports different versions of vue. Check the vue-router cdn file:

That's why you have multiple versions of Vue and why things are breaking.

Another solution would be to use import maps like the playground.

That being said, if you want to benefit from tree shaking and load less js in your application, I would recommend you not to use a CDN version for vue, vue router and pinia (a full app). Vue router is also missing the production cdn version #2242

Replies: 4 comments 7 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@juliusfriedman
Comment options

@juliusfriedman
Comment options

@kissu
Comment options

Comment options

You must be logged in to vote
4 replies
@posva
Comment options

Answer selected by juliusfriedman
@juliusfriedman
Comment options

@juliusfriedman
Comment options

@posva
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants
Converted from issue

This discussion was converted from issue #2274 on June 19, 2024 06:02.