Optimize resources for dist.