Angular2 + TypeScript + webpackでmoduleを読み込んでくれない

📅 2016/02/07

TypeScript Angular2 webpack

以下のようなエラーが出てwebpack –progress –profile –colors –display-error-details –display-cachedでbuildが出きなかった。

ERROR in /Users/epy0n0ff/git/github.com/epy0n0ff/angular2-typescript-webpack/src/top/top.component.ts
(1,25): error TS2307: Cannot find module 'angular2/core'.
ERROR in ./src/main.ts
(1,28): error TS2307: Cannot find module 'angular2/platform/browser'.

tsconfig.jsonの項目不足で"moduleResolution”: “node"compilerOptionsに追加してやるとnode_modulesから読み込んでくれるようになった。

参考