[英]Improving the imports in Webstorm 11 using JSPM and Typescript
I am using JSPM and Typescript for an Angular2 project and Webstorm 11 seems confused about the import paths of the TS classes. 我使用JSPM和Typescript作为Angular2项目,Webstorm 11似乎对TS类的导入路径感到困惑。
The first import is the correct one: 第一个导入是正确的:
import {Component} from "angular2/core";
But the other two are referencing directly from the jspm_packages
folder importing this two paths incorectly: 但另外两个是直接从
jspm_packages
文件夹引用,直接导入这两个路径:
import {Component} from "../../jspm_packages/npm/angular2@2.0.0-beta.0/src/core/metadata";
import {Component} from "../../jspm_packages/npm/angular2@2.0.0-beta.0/ts/src/core/metadata";
I have ignored both node_modules
and jspm_packages
in tsconfig.json
as Webstorm seems to recognize it, but no luck so far. 我忽略了这两个
node_modules
和jspm_packages
在tsconfig.json
作为Webstorm似乎认识到它,但至今没有运气。
Is there any way i can configure Webstorm to automatically import the correct module and ignore the other two? 有什么方法可以配置Webstorm自动导入正确的模块而忽略其他两个?
jspm is currently not supported by Webstorm. Webstorm目前不支持jspm。 But node.js is.
但是node.js是。 If you install angular2 via npm the imports work:
如果您通过npm安装angular2,则导入工作:
npm i angular2@2.0.0-beta.2 es6-promise@^3.0.2 es6-shim@^0.33.3 reflect-metadata@0.1.2 rxjs@5.0.0-beta.0 zone.js@0.5.10 --save
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.