For those not familiar with TypeScript, it can be a little daunting to start using it with a Dynamics 365 environment. As with most things, there are many ways to approach this task. This tutorial walks through one approach that is easy to start with and that integrates with XrmToolkit seamlessly.
Notice the '//# sourceMapping...' at the end of the file. This means that Visual Studio generated this from the TypeScript code.
Once the window opens, select the option to link the file to an "Existing Item" (assuming that this is an already existing D365 asset).
Select the file that you would like to link to and set any other actions as you deem appropriate.
Regardless of whether you use Gulp (or some other post processor), XrmToolkit will use the 'Gulp Output File' as the source of the content to push to D365.
Once the file has been linked, you can publish the file content to D365 in the usual manner.
Having to 'Build' the project everytime before publishing a TypeScript file is quite cumbersome. Luckily, there are ways to avoid this. You can simply turn on the option to 'Compile on Save' in the project properties of the 'TypeScript Build' tab: