Good to know! I guess webpack is smart enough to do the replacement earlier :-). This is still not a great future-proof approach because it relies on requires whereas the ecosystem has been moving to ES modules. It’s also much harder for any other tools to understand what’s going on in your modules.
We’re a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.