2016-10-06 18 views
0

最近、私のAngular2バージョンを最終バージョンにアップグレードしました。awesome-typescript-loaderに1つの宣言ファイルが必要です。どのように私はそれを行うことができ、そのタイピングファイルをどこにリンクするのですか? 私はangular2-webpack-starterを使用しています。私はアプリの定義にいくつかの.d.tsファイルを持っています。Awesome Typescript Loaderで.d.tsファイルを処理する

Module build failed: Error: Debug Failure. False expression: Output generation failed 
at Object.assert (node_modules\typescript\lib\typescript.js:2407:23) 
at Object.transpileModule (node_modules\typescript\lib\typescript.js:54401:18) 
at State.fastEmit (node_modules\awesome-typescript-loader\src\host.ts:264:39) 
at transform (node_modules\awesome-typescript-loader\src\index.ts:164:28) 
at transformationFunction (node_modules\awesome-typescript-loader\src\index.ts:89:48) 
at compiler (node_modules\awesome-typescript-loader\src\index.ts:105:34) 
at Object.loader (node_modules\awesome-typescript-loader\src\index.ts:18:18) 
@ ./src/app/providers/socket/index.ts 6:9-40 
@ ./src/app/providers/socket/chat-service.ts 
@ ./src/app/pages/restricted/restricted.ts 
@ ./src/app/app.routes.ts 
@ ./src/app/app.module.ts 
@ ./src/app/index.ts 
@ ./src/main.browser.ts 
@ multi main 

ATLのreadmeからのアドバイス:事前に

All declaration files should be resolvable from the entry file. The easiest way to do this is to create a references.d.ts file which contains references to all of your declaration files. Then reference references.d.ts from your entry file. 

おかげで、今彼らのようなもので終わるコンパイルするためのすべての試行については

答えて

1

入力ソースから.d.tsファイルを除外し、代わりにtsconfig.jsonのtypingsRootプロパティを使用して.d.tsファイルの場所を定義しました。入力ファイルが出力されないときにエラーがスローされるべきであるとは思わしくないようです。これは、インターフェース定義のみを含むファイルのようにかなり一般的です。

0

私の.d.tsファイルにはインターフェイスしか含まれていないので、私はそれらの名前を[something] .interface.tsに変更しました。今はcustom-typings.d.tsがあり、他のもののためにtsconfig.jsonにリンクされています。

関連する問題