-
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
ESM (ES6 module) distribution #1288
Comments
A PR would be welcome |
Some squibbles: If I'm reading this right... if it's used in tandem with UMD (AMD+CJS) I wouldn't mind... however if marked goes JSM/ESM only and distributes on npmjs.com as a CDN only (love all these acronyms) then we'll have to reconsider. We currently use it server side and we aren't going to rely on a CDN being up or down. Already been down that road before and it's very bad. :) |
I think we would need a build step to support this because AFAIK, detecting ESM at runtime is not possible. I've used TypeScript + Rollup to support multiple builds with my project: copee But there was hesitation to add TS to marked 🤔 |
A good way of doing this, might be to leave the IIFE version in tact, but to refactor that same IIFE into modules and classes. I've already done much of the heavy lifting locally. But I'll go ahead and fork this over in my repos to show you what I'm talking about. |
Here is my version, this is just a first pass to demonstrate what I'm talking about.
To get ES6 class based functionality |
FYI, for anyone following along: work is being done in PR #1349 |
just for people having trouble how to use it: works now fine.
|
Describe the feature
Publish standard JS modules to npm, instead of UMD.
Why is this feature necessary?
All major browsers can load standard JS modules now, so importing this library becomes much easier.
The text was updated successfully, but these errors were encountered: