Prequantization of field theory