kadikraman / draftjs-md-converter

Converts content from Draft.js blocks to Markdown and vice versa.
https://kadikraman.github.io/draftjs-md-converter/
MIT License
145 stars 37 forks source link

Build with parcel #56

Closed kadikraman closed 4 years ago

kadikraman commented 4 years ago

Fixes https://github.com/kadikraman/draftjs-md-converter/issues/55

The babel build step adds a duplicate function declaration, which errors then added to a web project.

Fixing this by moving to build with parcel instead of babel. It's simpler to configure and you get code minification and source maps for free.

How to test this

  1. Checkout the branch
  2. yarn && yarn compile
  3. Copy the contents of the dist folder to your project ./node_modules/draftjs-md-converter/src
NLSVTN commented 4 years ago

I faced the same issue and asked Babel slack channel whether they know what to do and posted the question also on stackoverflow:

https://stackoverflow.com/questions/60105716/identifier-toconsumablearray-has-already-been-declared

I tried your proposed solution with the present branch chore/use-parcel-for-bundling but used npm instead:

git checkout origin/chore/use-parcel-for-bundling
npm i
npm run compile

Then I copied the contents of the dist folder into my _node_modules/draftjs-md-converter/src/. It was not working, the error stayed the same for me. Then I saw that the error is actually happening in the node_modules/draftjs-md-converter/dist/_ and not in src, so I copied newly generated index.js there and it started to work.

kadikraman commented 4 years ago

Oops, that was a typo, I did mean copy it to /dist.

Thanks for validating, I'll get this released now!

kadikraman commented 4 years ago

Released in v1.4.0 🎉