Inside my TypeScript application I use different import's for my own modules and node modules.
Every time i use "import" i want it to really import the module and compile it into a single js-file. Currently it looks like this:
main.ts:
import * as $ from "jquery";
$('body').css({'color': 'red'});
main.js (output)
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var $ = require("jquery");
$('body').css({ 'color': 'red' });
But what i want is that instead of var $ = require("jquery");
it really imports jQuery into this file (but only if it wasn't imported earlier).
TypeScript compile import's into a single file
You need a module bundler. e.g. Webpack or browserify.
Browser quickstart : https://basarat.gitbooks.io/typescript/content/docs/quick/browser.html