The novel nonlinear dispersive Gross–Pitaevskii (GP) mean-field model with the space-modulated nonlinearity and potential (called GPinline image equation) is investigated in this paper. By using self-similar transformations and some powerful methods, we obtain some families of novel envelope compacton-like solutions spikon-like solutions to the GPinline image equation. These solutions possess abundant localized structures because of infinite choices of the self-similar function inline image. In particular, we choose inline image as the Jacobi amplitude function inline image and the combination of linear and trigonometric functions of space x so that the novel localized structures of the GP(2, 2) equation are illustrated, which are much different from the usual compacton and spikon solutions reported. Moreover, it is shown that GP(m, 1) equation with linear dispersion also admits the compacton-like solutions for the case inline image and spikon-like solutions for the case inline image.