Reputation: 22338
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 in case there is some clever way to do it.
Assuming we don't want AMD nor CommmonJS I am just using the ///references syntax to pull the types into the file. That gives me the types and I don't have to use import at all. Just means I have to order the script tags properly myself in the HTML. But I'm OK with that for now.
/// <reference path="router.ts" />
Upvotes: 4
Views: 679
Reputation: 251222
Yes - you use the reference comment when you are not using CommonJS or AMD.
How you then bundle your JavaScript files is totally up to you - if you are using ASP.NET the new script bundles are a great solution.
Upvotes: 5