Modules run in their own global scope, so they won’t automatically see a re-defined String from their importing scope.
One approach to your problem would be to modify your prototypes within the module, within every module if necessary. This has the advantage of being very simple for the rest of your code, and also avoids modifying the actual global which could affect other code.
Another way to go is to force all your module code to operate in whichever global namespace it happens to have been exported to. This has the advantage of picking up on things like your modified prototype without having to explicitly know about them, but obviously you’ve lost one of the primary reasons for using a module in the first place.
If you don’t need the namespacing features of a CommonJS module then you could import that code in a different way so that it is entirely in the same scope as the importing script.