-
Notifications
You must be signed in to change notification settings - Fork 518
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
Use microbundle standard packaging #445
Conversation
I wonder if we should also run prettier over the dist files, because the output isn't very pretty. Although sourcemaps kind of alleviate that anyway |
I wonder if we should also support a "modern" package that uses ES2017 syntax (the one where Also I think we need to update the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool 👍
It can be done with |
@KubaJastrz can you push to this branch with this? |
After thinking about it more, going to remove the Also we need to support browser-only |
Browser ESM versionI'm thinking we can have:
No bundling of Popper.js. Some post-rollup build step can just replace this line: - import Popper from 'popper.js'
+ import Popper from 'https://unpkg.com/popper.js@1/dist/esm/popper.min.js' Same extra HTTP request as the UMD version. And users can still import Popper.js themselves without extra size. And it won't become outdated. Modern version (ES2017)
For users to place in bundles that use |
Okay the "modern mode" is pointless because it doesn't keep the default params/destructuring (looking around, seems like Edge didn't support it for a while). So it ended up being like 5 bytes larger 🤦♂️ I've added a browser ESM version though |
Turns out unpkg already does browser ESM properly, although it's not minified. Seems to be an open thread on it though. Gonna close this out... 😪 |
This doesn't switch to microbundle, but uses microbundle packaging fields as suggested in README.
Adds
unpkg
field. The code in themain
field should be unminified.Note: It doesn't use the same directory format, microbundle uses
dist/*
with format file names. We're using directories here because there are a bunch of different formats and it's easier to import this way.import tippy from 'tippy.js/esm'
=> import without CSSInstead of:
import tippy from 'tippy.js/dist/tippy.mjs'
=> 😕