I am trying to reduce the bundle size of a React application. I deploy a smart contract during the project build pipeline. The contract needs to be inside the project folder of the React app so that it can access the contract ABI. So I have this in the dependencies:
"dependencies": {
...
"@openzeppelin/contracts": "^4.3.2",
...
}
If I move this into devDependencies
, my Solidity smart contract (^0.8.11 in case it matters) still compiles and deploys with yarn hardhat run path/to/deploy.js
. I'm worried that maybe features from OpenZeppelin might not work correctly though. Their documentation says to run $ npm install @openzeppelin/contracts
, without --save-dev
or -D
.
I was just wondering, why would they say to make it a non-devDependency if everything works fine as a devDependency? Perhaps it actually doesn't work as intended, and I just don't see Ownable
not working. Does anyone know if I can safely place the OpenZeppelin dependency in devDependencies without unforeseen consequences?
Thanks for your help.