Comment by TheAceOfHearts

3 years ago

HTML imports were part of the original concept of Web Components, and I think they were supported in Chrome. If you look up examples of things built with Polymer 1.x, it was used extensively.

It was actually pretty neat, because you could have an HTML file with a template, style, and script section.

Safari rejected the proposal, so it had to get dropped.

But ESM makes it a bit redundant anyway. The end-goal is to allow you to import any kind of asset, not just JS. There have been demos and examples of tools supporting this going back over half a decade at this point.