TypeScriptで複数ファイル構成のプロジェクトを扱う方法について書いてみる。日本語の入門記事や試してみました系の記事で勘違いされてることがたまに見受けられるので、整理してみる。 公式のModules in TypeScriptを既に読んでおられるような御仁は回れ右していただいても結構です。 やりたいこと ソースファイルをモジュールごとに分割して管理したい 実行環境はNode.js or ブラウザ 例えば、こういう処理があって、 // main.ts function trimLeft(str: string): string { return str.replace(/^\s+/, ''); } var input = document.getElementsByTagName('input')[0]; input.value = trimLeft(input.value); tri
![TypeScriptで複数ファイル構成する2つの方法 - teppeis blog](https://cdn-ak-scissors.b.st-hatena.com/image/square/5cc69cd31ce80f7c829b85659279ea5415815421/height=288;version=1;width=512/http%3A%2F%2Fecx.images-amazon.com%2Fimages%2FI%2F51pGATfH-gL.jpg)