-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Create separate CJS and UMD builds #2281
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/markedjs/markedjs/Cvg8tgQHQVgfWDbN9XKNiiAVpWWH |
@benmccann You have been helping out a lot recently. Would you like to join @markedjs and help maintain marked? |
Thanks for the offer, but I'll probably disappear once this conversion to ESM has settled down 😄 I've got a fair amount of open source projects on my plate already |
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.
Its an unfortunate state of the JS ecosystem but this change looks correct, thanks!
## [4.0.2](v4.0.1...v4.0.2) (2021-11-12) ### Bug Fixes * Create separate CJS and UMD builds ([#2281](#2281)) ([62faaf4](62faaf4))
🎉 This PR is included in version 4.0.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Just to understand this correctly, if we're using marked on the client side, we now will be using |
@splch if you are using marked in a script tag you should use The |
Marked version: 4.0.1
Markdown flavor: n/a
Description
Fixes #2265
This comment pointed out that it would be very weird to use a CJS file in the browser: #2265 (comment)
That's true, but it's not actually CJS. It's UMD. And I think UMD was specified for the CDNs, which makes a lot more sense. It's just really confusing the way we have it setup now because the file extension doesn't match the actual file type.
Putting a UMD file as
main
is breaking people in 4.0.1. I didn't realize we were doing that in the last PR because I was thrown off by the file extensions. Bundlers generally know how to deal with CJS and ESM, but not UMD. It's reported that this change fixes things: #2265 (comment)Contributor
Committer
In most cases, this should be a different person than the contributor.