Open CaptainYouz opened 4 years ago
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.
+1 here too! Seems like there is a lot of opportunity to reduce the codemirror bundle size through selective imports.
+1
How do I import this library whether it's ES Modules or not? I don't see any examples using import
in the README.
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.
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
Everything in the title!
(thanks for this great fork 👍 )