I wrote an npm package blokus
that uses ES6 syntax.
I used create-react-app
to run a project web-blokus
that depends on blokus
.
I can start npm start
without errors and view my application web-blokus
in my browser, and it has all the features of using the package blokus
.
The problem is that I get a UglifyJS error on startup npm build
.
static/js/main.8afd34e2.js from UglifyJs
SyntaxError: Name expected [./~/blokus/blokus/blokus.js:3,0]
It seems that there is a known situation where UglifyJS does not support ES6 dependencies (several related problematic issues here and here ). But I read these topics, as well as several others, and I was very confused about what was planned to update and what people do as workarounds.
So i wanted
1) confirm that create-react-app
it will not work out of the box (after switching to npm build
) if your application has any ES6 dependencies
2) ask what people are doing to fix / work around the problem (do I need to banish and replace something for UglifyJS?)
Since create-react-app
ES6 is now so popular, I assume that I either misunderstand the restriction, or the standard method for resolving this restriction is discussed and known.