【发布时间】:2016-05-28 10:05:30
【问题描述】:
我在 Visual Studio 中有一个 TypeScript 项目,通过 systemjs 安装了模块。我有以下代码:
app.ts
import { Aurelia } from 'aurelia-framework';
例如,悬停 Aurelia 并按 F12(转到定义)会打开由 systemjs 安装的正确 aurelia-framework.d.ts 文件。但是,当我单击构建时,我得到以下输出:
error TS2307: Build: Cannot find module 'aurelia-router'.
这是我的 tsconfig 供参考。
tsconfig.json
{
"version": "1.8.0",
"compilerOptions": {
"rootDir": "src/",
"outDir": "dist/",
"target": "es5",
"module": "system",
"declaration": false,
"noImplicitAny": false,
"removeComments": true,
"noLib": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true
}
}
【问题讨论】:
-
Aurelia 只是拒绝在 VS2015 中很好地使用 Typescript,不是吗?我可以让 ES2015 框架运行,但 TS 编译器甚至拒绝让我的项目启动,不管它们通过 gulp 完美编译的事实。
-
当然,.NET Core 可能会有所不同,但让我们现实一点 - 很多 webhosts 不支持 Core,有很多 MVC1-5 项目需要一个附加了现代 JS 框架...这是一个巨大的痛苦。
标签: visual-studio typescript visual-studio-2015 typescript1.8