Minification in templates is done by [`spaceCompress`](https://github.com/reddit/reddit/blob/master/r2/r2/lib/c/filters.c#L217-L282).  It's pretty dumb and so semicolons are necessary in template-included JS.