Welsh ministers warn defence plans could strip up to £30m from capital projects.