In my project I need to use the npm module ipfs-api with create-react-app
.
I can run npm start
and run the proect.
But when I try to build the proect with react-scripts build
, it throws the following error
Failed to compile.
Failed to minify the code from this file:
./node_modules/ipfs-api/src/utils/module-config.js:7
Read more here: https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#npm-run-build-fails-to-minify
According to the suggestions in the provided link in eorror log, I tried using,
"dependencies": {
...
"ipfs-api": "github:atfornes/js-ipfs-api#transpiled",
...
}
instead of "ipfs-api": "^22.0.0",
. Although this solved error for ipfs-api
, other dependent modules (probably installed with ipfsapi
) kept giving same type of Failed to minify
errors which I stopped transpiling them manually.
Is there a way to transile all the dependent node modules to es5 while before using the command react-scripts build
? Or any other way to overcome this issue?