This may seem silly, but if you use UMD for your node version, it would also work for vanilla browser legacy script tags. Just use Rollup with a umd target. Two for one, what a deal.