I noticed a 762B cycles drop after running dfx deploy frontend --network ic. The backend module hash changed too, but I only deployed the frontend.
My dfx.json has:
“frontend”: {
“dependencies”: [“backend”],
…
}
Is dfx automatically redeploying the backend because of this dependency?
Can I safely remove backend from frontend dependencies if the canister IDs are already in canister_ids.json? Or is there a flag to skip dependency deploys?
1 Like
Yes, dfx deploy is written with the philosophy of doing more work in case of any doubt such that things most likely ‘just work’. In this case the reasoning would be along the lines of “the frontend depends on the backend, so let’s make sure the backend is also up to date”. I’m torn myself on whether or not I like this behavior.
The way dfx is written today this should be safe. In previous versions this would likely have broken the frontend build.
There is no flag on dfx deploy. But if you use the lower level dfx build|canister commands then only what you ask for happens. If you want to emulate dfx deploy but without touching dependencies, then you want to do dfx canister create && dfx build && dfx canister install
2 Likes
Great thanks Vivienne. I removed the dep from dfx.json, tested and it worked fine
1 Like