The novel nonlinear dispersive Gross–Pitaevskii (GP) mean-field model with the space-modulated nonlinearity and potential (called GP 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 GP equation. These solutions possess abundant localized structures because of infinite choices of the self-similar function . In particular, we choose as the Jacobi amplitude function 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 and spikon-like solutions for the case .