I read through a great article series about the history of modules written by nprofile1qy2hwumn8ghj7un9d3shjtnyd968gmewwp6kyqpqrhxpgjjnjsz02ygxnjnsf08yusglvnm8rvf54x2hf3fpft6ftpgq36ckap (nprofileโฆckap) and its also part of his own story. I highly recommend it.
https://kriskowal.com/tags/modules/
It all culminates in the fantastic writeup in the last article of the series called https://kriskowal.com/designing-modules/
He is very kind to the imho epic failure of ESM that won not based on merit and I personally think it is partly responsible for breaking the steam the open source movement especially around javascript had before ESM