Hey Yury,
I've found with using webpack, you
can actually use the second syntax like you suggested, so that might be an option. You can play with the webpack example here:
https://github.com/excaliburjs/example-ts-webpackRegarding your second question, we've actually since updated our codebase to use module syntax as of January. The reason we started out with triple-slash references is because Excalibur is over three years old! And at that time, we only had TS 0.9 which didn't support modules as well as it does now. After TS 1.8 is when the module story started getting better, in that you could output a single file using AMD/SystemJS and generate a single declaration file. Before then, you would have had to bundle it yourself and concatenate the declaration files using a 3rd party tool (which at the time, I don't even think existed). You can browse
the codebase at that time (0.1.1) if you want to see what we had back then.
Triple-slash references are
definitely the easiest way to create a TS project since introducing modules definitely incurs build tool overhead (bundling, concatenation, loaders, etc.). Remember also that Excalibur is only meant to be used in a browser and introducing module loaders is conceptual overhead that many new or junior developers aren't comfortable with. The philosophy of Excalibur has always been to keep it simple so even someone brand new to JS or TS can write a game. In typical browser projects, we never used module loaders until recently (think jQuery). Only now are people starting to get much more comfortable with module loaders, so now was a good time to convert the codebase over. We still kept the same backwards compatibility by including the Almond.js AMD loader as well as exporting to the "ex" namespace the entire public API. This means we can support both non-module and module loading environments.
Hopefully that provides some context. Thanks for asking!