【发布时间】:2016-12-07 10:53:13
【问题描述】:
我最近将我的 Angular2 版本升级到了最终版本,并且遇到了awesome-typescript-loader 需要一个声明文件的问题。我该怎么做以及在哪里链接该打字文件? 我使用angular2-webpack-starter。我的应用提供程序定义中有一些 .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 自述文件的建议:
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.
提前致谢!
【问题讨论】:
标签: angular typescript webpack