Refactor the condition test of webassets version everywhere