csegames/cu-ui — pull request #17 by jcdickinson (2014-07-22 00:45:23+00:00)
Title: Feature better build

## Purpose

Ultimately reduce the line count of `cu.ts`. This is the first step in that process.

## Caveats

Only tested in a browser (source maps work!).

## What it Does

Any files in the project compiled with "Build Action" of "SingleTypeScriptCompile" will be placed into a single .js file. This .js file is what you would typically ship as the "mod SDK" once the game ships. All other TS files (chat etc.) remain self-contained as though they were mods.

## How to Include .ts Files in The SDK

1. Right click on the file in the solution explorer.
2. Click "Properties."
3. On the properties window navigate to the "Build Action".
4. Click the dropdown and select "SingleTypeScriptCompile".
- Remember that `/// ` will be automatically inlined by TSC, you just need to add "entry point" .ts files. Take a look at `cu.ts` (SingleTypeScriptCompile) and `CallbackSet.ts` (TypeScriptCompile) as an example.
5. In GruntFile.js add it to `ts:sdk:src`.

![How to](https://cloud.githubusercontent.com/assets/522465/3652322/a559820e-1138-11e4-8c12-b356240c1cfe.png)

## Still Remaining

Any .d.ts you add as `/// ` items will still point to the old location. In terms of shipping an SDK it makes sense to copy them to the SDK direction. Additionally the .d.ts will need to be updated with the new relative path.

**This shortcoming does not affect the .js file or development at this stage.** I'll push through this tomorrow but it requires a custom MSBuild task and some gruntfile.js work.