When importing this library into a project using create-react-app, I end up getting the following error when running npm run build:
static/js/main.4b40bb14.js from UglifyJs
Unexpected token: operator (>) [./~/emoji-tree/lib/parse.js:5,0][static/js/main.4b40bb14.js:18284,32]
It looks like it's related to an issue that the UglifyJS library (which currently ships with create-react-app) has with building modules that use ES6.
Hopefully this will be fixed inside UglifyJS in the near future (though this was reported as an issue back in 2015 and it's still not fixed!). I love using ES6 myself, but it seems like the recommended approach is that we still need to transpile npm modules to ES5 for maximum compatibility.
When importing this library into a project using create-react-app, I end up getting the following error when running
npm run build
:It looks like it's related to an issue that the UglifyJS library (which currently ships with
create-react-app
) has with building modules that use ES6.Hopefully this will be fixed inside UglifyJS in the near future (though this was reported as an issue back in 2015 and it's still not fixed!). I love using ES6 myself, but it seems like the recommended approach is that we still need to transpile npm modules to ES5 for maximum compatibility.