TypeScript - Import an external module without AMD or CommonJS

Has anyone found a way to import a module from another file without using AMD or CommonJS (using the import keyword)? I don't think this is possible, but I want to double check if there is any smart way to do this.

Assuming we don't want AMD or CommmonJS, I just use /// link syntax to pull the types into a file. This gives me types, and I don’t need to use import at all. I just have to order the script tags myself in HTML. But I'm fine with that for now.

/// <reference path="router.ts" /> 
+4
source share
1 answer

Yes - you use a reference comment when you are not using CommonJS or AMD.

How you then link your JavaScript files is entirely up to you - if you are using ASP.NET, the new script packages are a great solution.

+5
source

All Articles