When .ts files compiled via npm?

It might be a silly question but…

ionic repository has only .ts files in the src folder.

But when I run npm install ionic-angular, the files are already compiled into .js and .d.ts, and the folder structure is also changed; the src folder disappeared, etc.
I thought it is done by the postinstall npm hook, but it wasn’t.

How is this behaviour realized?