Draft-js: if can use es6?not commonjs

Created on 11 Feb 2019  Â·  4Comments  Â·  Source: facebook/draft-js

I use rollup to build one project whitch use the draft-js
but it's hard
always have this below error

Error: 'BlockMapBuilder' is not exported by node_modules/draft-js/lib/Draft.js

Most helpful comment

@butchmarshall @ckmilse Use rollup-plugin-commonjs

All 4 comments

Hi @ckmilse, thanks for reporting this issue. I'm not familiar with Rollup, can you share your dev environment setup (stripped from the non-essential parts)?

I attempted to use rollup to build DraftJS as well - it doesn't work well.

I̶ ̶b̶e̶l̶i̶e̶v̶e̶ ̶i̶n̶t̶e̶r̶n̶a̶l̶l̶y̶ ̶F̶a̶c̶e̶b̶o̶o̶k̶ ̶u̶s̶e̶s̶ ̶s̶o̶m̶e̶ ̶@̶p̶r̶o̶v̶i̶d̶e̶s̶M̶e̶t̶h̶o̶d̶ ̶m̶a̶g̶i̶c̶ ̶-̶ ̶p̶a̶t̶h̶s̶ ̶a̶r̶e̶n̶'̶t̶ ̶r̶e̶l̶a̶t̶i̶v̶e̶.̶ (this looks to be older 0.10.0 code, it's been updated in 0.11.0!)
It's also using modules.export syntax rather than export default. Rollup doesn't seem to like this either.

@butchmarshall @ckmilse Use rollup-plugin-commonjs

Thanks for chiming in @TrySound, I'll familiarize myself with this setup. I hope that unblocks you @ckmilse ? Feel free to reopen the issue if still blocked.

Was this page helpful?
0 / 5 - 0 ratings