Closed ydatech closed 6 years ago
@ydatech CRA uses Webpack@^3 which is bundled with a version of UglifyJS that does not support ES6. Webpack@^4 is bundled with a new version of UglifyJS that can parse ES6.
Four solutions here :
electron-push-receiver
electron-push-receiver
@MatthieuLemoine
I have fixed the issue by moving constants from src/constants/index.js
file to local variable in entrypoint src/index.js
.. and also I changed the dependency of push-receiver to dev-master because it also causes build error if we use latest stable version..
Note: Create React App can consume both CommonJS and ES modules. For Node.js compatibility, it is recommended that the main entry point is CommonJS. However, they can optionally provide an ES module entry point with the module field in package.json. Note that even if a library provides an ES Modules version, it should still precompile other ES6 features to ES5 if it intends to support older browsers.
this is my fork: https://github.com/ydatech/electron-push-receiver
Fixed in v2.1.2 thanks to @NBoychev #36
I'm trying to build my electron app bootstraped by create-react-app (cra). and get this error: