The moduli spaces of Calabi–Yau threefolds are conjectured to be connected by the combination of birational contraction maps and flat deformations. In this context, it is important to calculate dim Def(X) from dim Def(˜X) in terms of certain geometric information of f, when we are given a birational morphism f:˜X→X from a smooth Calabi–Yau threefold ˜X to a singular Calabi–Yau threefold X. A typical case of this problem is a conjecture of Morrison-Seiberg which originally came from physics. In this paper we give a mathematical proof to this conjecture. Moreover, by using output of this conjecture, we prove that certain Calabi–Yau threefolds with nonisolated singularities have flat deformations to smooth Calabi–Yau threefolds. We shall use invariants of singularities closely related to Du Bois's work to calculate dim Def(X) from dim Def(˜X).