Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

what version should be used by jsdelivr #146

Closed
mika76 opened this issue Mar 29, 2020 · 2 comments
Closed

what version should be used by jsdelivr #146

mika76 opened this issue Mar 29, 2020 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@mika76
Copy link

mika76 commented Mar 29, 2020

Is there a way to try this directly in html?

I've tried by adding <script src="//cdn.jsdelivr.net/npm/@posva/[email protected]"></script> but I get the error: "Uncaught SyntaxError: Cannot use import statement outside a module" if I add type="module" to the script tag, then I get a different error: "Uncaught TypeError: Failed to resolve module specifier "vue". Relative references must start with either "/", "./", or "../"."

I'm guessing this isn't bundled to be used directly in html?

@posva
Copy link
Member

posva commented Mar 29, 2020

To use it in HTML without type="module", you need to use the global build (like with Vue) and I'm realising both, vue and vue-router are not correctly connected to the CDN. For vue-router you need to use the vue-router.global.js (same as vue)

https://cdn.jsdelivr.net/npm/[email protected]/dist/vue-router.global.js

(adapt the version)

What I'm unsure is what should be the version pointed by jsdelivr by default, we can change it with jsdelivr in the package.json file and should be consistent. Previously, in vue, we would expose the minified version, that would be global.prod instead global. Let's keep this open for discussion

@posva posva changed the title Use directly in html? what version should be used by jsdelivr Mar 29, 2020
@mika76
Copy link
Author

mika76 commented Mar 29, 2020

Hey this is great - thanks - will play around with it now 😄

@posva posva added the help wanted Extra attention is needed label Apr 9, 2020
@posva posva closed this as completed in d7dd3b7 May 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants