I\'m trying to figure out how to import modules. When I write a statement at the top of my .ts file such as:
import a = require(\"a\");
I get t
Here are the steps to configure typescript per project:
Unload your project. If your project is based on the MVC 6 template, you will find that the MSBuild
configuration is pretty minimal.
Navigate to:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\TypeScript
*
* This assumes you installed VS in the default location.
Locate the Microsoft.TypeScript.Default.props
file and open it up. No need for elevated privileges, we will only be reading from it.
It should look something like:
ES5
true
false
none
false
false
true
true
Copy the entire PropertyGroup
element, and paste it somewhere in your .kproj
file; it needs to be under the Project element.
Modify the TypeScriptModuleKind
from none to your module definition. The options are AMD
or CommonJS
.
Save the .kproj file, and reload your project.
You should no longer get the compile-time error about including modules.