I ran into many similar problems, sadly I don't think your example is an outlier. I had to write my own simple HTML bundler (https://github.com/jeff-hykin/html-bundle), not cause I want to or because I care about bundling, but just to know that it was done correctly.
This is why I basically never trust npm packages unless I know the authors, like the standard library from the Deno team, or people like Ryan Carniato or Evan Yu.
This is why I basically never trust npm packages unless I know the authors, like the standard library from the Deno team, or people like Ryan Carniato or Evan Yu.