-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add module and umd build configs for webpack/parcel/browserify/etc support #68
Conversation
This should allow (nearly) anyone with any build tool to safely It's based off the build I use for Builder pacakges that has been tested across customers across all sorts of build tools and environments, and is based off of other rollup best practice examples for npm modules like this and this |
Also worth noting - typically it's suggested to not commit those dist files and to gitignore them instead and have your CI build them, but I figured it's worth just making one change here at a time |
What's the best practice for dist files like that.. should we have them in the repo at all? We use them for the demo (demo/index.html has a script tag for one of them), but in general it's a PITA to have those checked in. We aren't quite ready to host bundled copies anywhere yet (like what jquery does). Having CI build them makes perfect sense but then what should we do with the generated files? |
Ah yes, you don't need to host them anywhere. When you These days there are many services that host NPM modules for everyone without you having to do anything, such as unpkg and jsdelivr E.g. SES is already hosted at jsdeliver via https://cdn.jsdelivr.net/npm/ses and unpkg here https://unpkg.com/ses They work great too because they allow you to import deep paths, e.g. https://unpkg.com/ses/dist/ses-shim.js, or with versions/tags like https://unpkg.com/ses@0.3.0, or even combinations of both https://unpkg.com/ses@0.3.0/dist/ses-shim.js. Jsdelivr works the same. By default they will use 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.
This looks awesome! Thanks so much for doing this.
Just a couple of changes:
- Let's remove the dist/ files and also .gitignore them.
- Let's add the code that generates them into the 'npm run build' path
- We want all PRs to meet our eslint config, so please run 'npm run lint-fix' before submitting
rollup.config.js
Outdated
|
||
export default { | ||
const deafultConfig = { |
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.
typo: s/defultConfig/defaultConfig
Gitignore dist, remove dist from git tracking, fix typo, add rollup to lint and run lint
@katelynsills no prob, updated! |
Thanks so much for the changes! Based on your feedback, I'm creating dist/ files in some of the other packages that SES uses, and testing those out. I think SES will be a bit more complicated given that it does some unusual stuff, but we should be able to get this merged in soon! |
yeah, SES is unusual because there's a Kind of a drag. It might be possible to just take the published single-file |
Hi Steve @steve8708, thanks so much for submitting this PR and getting us started on making SES work with bundlers. PR #97 adds dist files to SES based on the concepts on this PR and also adds bundler integration tests so that we can hopefully catch issues that may arise before they start affecting people. I hope this helps, and please let us know if you run across any other issues! |
Fixes https://github.com/Agoric/SES/issues/63