This is the short story of how I integrated two modified NPM packages with (lots of) transitive dependencies into my Thunderbird Plugin. I managed to overcome the Babel dependency of each package. Everything I show is running on Thunderbird 128esm.
I packaged the NPM packages with esbuild
npm install esbuild
esbuild entry_file.js --bundle --outfile=bundled_entry_file_and_dependencies.js --format=esm