I'm trying to exclude momentjs from the project as much as possible, but this does not give results

On a large project (Reactjs / Nextjs) momentjs was used. I first excluded it completely from client pages, then from the project as a whole, but it has not disappeared anywhere and is displayed in the bandle of pages. Is also present in node_modules (apparently some other library uses it as a dependency).

enter image description here

How to remove momentjs from the bundle of the page where it is not even used? Please tell me the correct way to optimize the bundle size. (I have already removed the locale).

Thanks for any help!