When Anders Hejlsberg is talking about external modules around 35:00 in the following video...
Anders Hejlsberg: Introducing TypeScript
... why does the file
You need a triple slash reference in two scenarios:
--out
you can reference your files using /// <reference
.You need a import/require
combo when using external modules i.e. amd
/commonjs
. If you don't know what these mean (amd/commonjs are javascript terms, not specific to typescript) you don't have to care. Just use /// <reference
and compile with --out
.
PS: I have a video tutorial on internal vs. external modules: TypeScript Modules Demystified : Internal, AMD with RequireJS, CommonJS with NodeJS
Please use tsconfig.json
for new projects instead of reference comments : https://basarat.gitbook.io/typescript/project/compilation-context