mascara
mascara copied to clipboard
Incompatible with create-react-app
Hello, when building my creat-react-app, I get this error:
> react-scripts build
Creating an optimized production build...
Failed to compile.
Failed to minify the code from this file:
./node_modules/metamascara/mascara.js:7
Read more here: http://bit.ly/2tRViJ9
=> https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#npm-run-build-fails-to-minify
Any idea?
Many thanks
=> http://bit.ly/2tRViJ9
Some third-party packages don't compile their code to ES5 before publishing to npm. This often causes problems in the ecosystem because neither browsers (except for most modern versions) nor some tools currently support all ES6 features. We recommend to publish code on npm as ES5 at least for a few more years.
It would be nice to publish a ES5 compiled version of metamascara...
For anyone experiencing the same problem as me, I forked mascara (and all its non es5 valid deps), compiled to ES5 and published to npm. You can install ES5 version by simply:
npm i metamascara-es5
the repo is here.
Hey sorry I have been away the past week with bad wifi and holiday did not see this issue get opened. Will publish as es5 in the next release next week.
Would be super cool, thanks
Hello there, any progress on this issue?
Using exclusively ES5 libraries is no longer recommended by create-react-app
, as of v2 I believe. They transpile their dependencies now instead.
As of Babel 7 compiling libraries to ES5 is no longer necessary to support applications that target ES5, because transpiling dependencies is now much easier than it was with Babel 6. See this blog post for more details.