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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there plan for ES Module support? #262

Open
CaptainYouz opened this issue Oct 30, 2020 · 6 comments
Open

Is there plan for ES Module support? #262

CaptainYouz opened this issue Oct 30, 2020 · 6 comments

Comments

@CaptainYouz
Copy link

Everything in the title!

(thanks for this great fork 馃憤 )

@Ionaru
Copy link
Owner

Ionaru commented Oct 30, 2020

I did a quick test with browserify and the plugin efmify but it does not look like I can easily convert the editor to an ESM compatible package.
However I do think providing an ESM package should be a goal to work towards.

@jameschristopher
Copy link

+1 here too! Seems like there is a lot of opportunity to reduce the codemirror bundle size through selective imports.

@Warfenix
Copy link

Warfenix commented Dec 3, 2020

+1

@amcsi
Copy link

amcsi commented Jun 15, 2022

How do I import this library whether it's ES Modules or not? I don't see any examples using import in the README.

@Ionaru
Copy link
Owner

Ionaru commented Jun 16, 2022

Using npm you can import it like any other npm package: https://docs.npmjs.com/using-npm-packages-in-your-projects

Otherwise use one of the CDN scripts, the editor will then be available globally.

@amcsi
Copy link

amcsi commented Jun 16, 2022

I tried this:

import EasyMDE from "easymde";

new EasyMDE();

And I got:

TypeError: Cannot read properties of undefined (reading 'getAttribute')
push../node_modules/easymde/src/js/easymde.js.EasyMDE.render
node_modules/easymde/src/js/easymde.js:2110

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

No branches or pull requests

5 participants