Magnetic field disturbances are typical measurement imperfections in NMR experiments and can strongly affect spectral quality. In routine measurements, the magnetic field is typically stabilized using a deuterium "lock" 21 sometimes supported by additional systems. The spatial homogeneity of a magnetic field within the receiver coil is ensured by setting appropriate currents in the correction coils, i.e., by "shimming". However, both "locking" and "shimming" can be difficult or even impossible in the case of reaction monitoring. The former usually requires deuterated solvents, which may affect the studied reaction. The latter is time-consuming and thus cannot be performed if the studied reaction is fast. For the reaction monitoring performed in a flow mode, the imperfections can be even more pronounced. In this paper, we propose a method of spectral analysis that is suited for NMR reaction monitoring since it is robust to lineshape imperfections. The method is based on the Wasserstein distance, which is a mathematical notion taken from the optimal transport theory. It has been previously shown that the specific properties of this metric make it a suitable tool for analysis of difficult spectroscopic data. The Wasserstein distance can be calculated between any two spectra and no assumptions about the shapes of peaks are needed. Moreover, the metric is robust to overlap of signals from different reagents and to small changes in position along the chemical shift axis. Our method treats the problem of estimating relative amounts of components changing in time as the problem of regression with the Wasserstein distance. As a result, we get a sequence of proportions in consecutive time points, allowing us to infer the kinetics of the monitored reaction.