我正试着用打字本和SystemJS来工作SystemJS,但我在进口方面遇到了麻烦。
使用此导入(或任何其他angular2导入)
import {bootstrap} from 'angular2/platform/browser';我得到了Webstorm和tsc编译器错误(WS:无法解决目录,tsc:无法找到模块),即使在jspm_packages/npm/angular2@2.0.0-beta.0中有angular2
我的目录结构是
browser
components
app.component.ts
bootstrap.ts
index.html
node_modules
jspm_packages
jspm.config.js
package.json
tsconfig.jsontsconfig.json
{
"compilerOptions": {
"target": "ES5",
"module": "system",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false
},
"filesGlob": [
"!./node_modules/**/*.ts",
"!./jspm_packages/**/*.ts",
"./**/*.ts"
]
}和jspm.config.js中的配置
System.config({
defaultJSExtensions: true,
transpiler: "typescript",
paths: {
"github:*": "../jspm_packages/github/*",
"npm:*": "../jspm_packages/npm/*"
}})这段代码在某种程度上是可行的,但编译器似乎很困惑,有没有更好的(或正确的)方法来做到这一点?谢谢
发布于 2016-01-03 13:51:29
这在Webstorm 11中是不可能的。有一种解决办法是可行的,参见David在:https://youtrack.jetbrains.com/issue/WEB-18904上的评论。
顺便说一下,请+1这个问题,也许这有助于加快事情的Jetbrains想出一个解决办法。
https://stackoverflow.com/questions/34414316
复制相似问题