You should be able to construct this 'directly' in a similar way to the construction of the one-point compactification. Explicitly, you put $E' = E \cup (B'\setminus B)$, and take the open sets as follows: for each open set $U$ of $B'$, and each open set $V$ of $E$ with $\pi(V) = U \cap B$, take $V \cup (U \setminus B)$ as an open set.

The proof that this defines a valid topology and that $E'$ is compact should go similarly to the analogous proofs for the one-point compactification.