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

Wrong build/package for Lite Player #34

Closed
gottlike opened this issue Apr 29, 2020 · 2 comments
Closed

Wrong build/package for Lite Player #34

gottlike opened this issue Apr 29, 2020 · 2 comments

Comments

@gottlike
Copy link

gottlike commented Apr 29, 2020

The UMD versions of the Lite Player package (lite.js + lite.min.js) seem to be the standard versions instead (over 70 kb uncompressed).

You can check the files after installing the package (https://vime-js.com/lite/setup#installation) - they are much bigger than specified (https://vime-js.com/getting-started#features-differences).

@mihar-22
Copy link
Contributor

mihar-22 commented Apr 30, 2020

Hey @gottlike nah that size is right, the UMD exports are legacy files so it's been transpiled with Babel to work with IE11. The files you want to be looking at are lite.esm.js and lite.esm.min.js since they are for modern browsers. In your application you would use the module/nomodule pattern so something like this

<script type="module" src="https://cdn.jsdelivr.net/npm/@vime-js/lite/dist/lite.esm.min.js"></script>
<script nomodule src="https://cdn.jsdelivr.net/npm/@vime-js/lite/dist/lite.min.js" defer></script>

Even for IE11 the file compresses well down to 25.8 kB. In addition, when you're using a bundler like Webpack or Rollup you would automatically pull in lite.esm.js. If you needed IE11 support for your web app you could transpile it with Babel, and then you would put this in a separate "chunk" so it's loaded very infrequently and cached. Frameworks like Next.js and Nuxtjs automatically do this via code-splitting. Therefore the majority of the size of lite.min.js is irrelevant I'd say.

@gottlike
Copy link
Author

Okay, makes sense.. thanks for explaining!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants