【发布时间】:2017-08-12 18:29:54
【问题描述】:
我有一个 Node.js Bot Builder 项目,其中包含 TypeScript 中的主要应用程序代码,即 app.ts。虽然我在转译的 app.js 中获得了代码完成并进入了我需要的模块代码,例如“botbuilder”,但我无法在 app.ts 中这样做。
我尝试在 tsconfig.json 中包含路径,但似乎没有帮助:
"compilerOptions": {
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"module": "commonjs",
"target": "es5",
"noImplicitAny": false,
"strictNullChecks": true,
"inlineSourceMap": true,
"inlineSources": true,
"baseUrl": ".",
"paths": {
"botbuilder": ["node_modules/botbuilder/lib/"]
}
}
【问题讨论】:
-
您的导入语句是什么样的?
import * as botbuilder from "botbuilder";应该可以在您的 TypeScript 文件中使用。
标签: node.js typescript intellij-idea visual-studio-code botframework