Comment by inbx0
3 hours ago
> And you cannot distribute an app as as HTML file.
<script type="module">
console.log('Hello World!')
export const a = 5
</script>
Inline module scripts work fine in HTML. You can't import this, but if you'd anyway need to do some "building" (at least doing some string concatenation as a build script) to get any JS baked into the HTML, so why not just concat the library and your own code to one module script in the HTML. Works fine.
I think it's good that folks are starting to end distributing prebuilt code in every possible format that somebody could ask for. Waste of disk space for most people.
ESM is how it's done now. If you don't like it, build it yourself to some other format.
No comments yet
Contribute on Hacker News ↗