This same script was replicated to near every repository I have worked on, including making its way into a few different production services where Node.js + ESM was used for deployment
Eventually I had turned into a utility module that could be used wider, which starts to lean into import map generation