TypeScript 0.9.* VisualStudio TS5037: Cannot compile external modules unless the '--module' flag is provided

I do get the TypeScript compiler error TS5037: Cannot compile external modules unless the '--module' flag is provided.

I am using TypeScript 0.9.1.1 und Visual Studio 2012.

Where can I set the --module option in Visual Studio? Web Essential seems to no longer support this option in the dialog.

Thankx, Harry

Update: I have a configuration file (config.ts) for my project. This file contains many statements as the following:

export var loggedInUserId: number = 0;  

There are no other statements as the one before. Do I have to define a class or module around it?

Answers


I was having this problem in Visual Studio 2013, even with that setting above set correctly. It turns out there's a project-level setting as well. If you go to Project Settings on the project with TypeScript (highlight the project and type Alt+Enter), then go to the TypeScript Build tab, and select AMD under "Module System"


You can find the option for non project files here (Tools - options - Editor - TypeScript):

For my project based work I use grunt : https://github.com/basarat/grunt-ts


Need Your Help

Monitoring Mongo for changes with Node.js

javascript node.js mongodb events database

I'm using Node.js for some project work and I would like to monitor my Mongo database (collection) for changes, basically fire an event if something gets added.

How to print from GitHub

github markdown pretty-print

If I want to print a markdown file from GitHub as it appears on screen, for example: