Reduce Rebuilds During Dev
preferSyncOverRebuild
The preferSyncOverRebuild
option expects a boolean which decides if DevSpace should skip rebuilding an image during devspace dev
in case the file sync is configured for a container which references this image using the imageName
option.
Development Only
Using preferSyncOverRebuild: true
does not affect devspace deploy
because file sync is not being started even if it may be configured in devspace.yaml. So, this option takes effect during image builds via devspace dev
.
Regular Skip Check
Even if this option is enabled, DevSpace may still skip building an image if neither the Dockerfile nor any files within the context have changed since the latest rebuild.
Trigger Rebuild Manually
DevSpace will still rebuild when the -b / --force-rebuild
flag is explicitly provided.
preferSyncOverRebuild
Default Value For Example: Prefer Sync Over Rebuild
Explanation:
When running devspace dev
using the above configuration, DevSpace would:
- not build the image
backend
becausedev.sync[0].imageName
is referencing this image andpreferSyncOverRebuild: true
is configured - build the image
frontend
because althoughpreferSyncOverRebuild: true
is configured, no sync configuration is referencing this image - build the image
cache
becausepreferSyncOverRebuild
is not set totrue