How to build js files from vendor

If you check lib/private/legacy/template.php, you will notice that in line 123 code checks if app is whether in debug mode or not.
If so, it will try to load vendor files from core.json 's vendor property if not, it will try to load core.js file.
Now, core.js file is obviously a minified, built file. So how it it built? and what are sources that these files are built from?