使用SystemJS模块系统时从索引文件导入WebStorm
问题描述:
假设我有以下源结构。使用SystemJS模块系统时从索引文件导入WebStorm
/home
home.component.ts
/shared
/domain
car.domain.ts
house.domain.ts
person.domain.ts
index.ts
所有域文件包含有类似
export interface Car {
someProperty: number;
}
索引文件看起来像这样
export * from './car.domain';
export * from './house.domain';
export * from './person.domain';
然后在工作完全正常导入像这样在我家的组成部分。
import { Car, Person } from '../shared/domain';
或
import { Car, Person } from '../shared/domain/index';
但是,当自动导入WebStorm上导入接口,这样
import { Car } from '../shared/domain/car.domain';
import { Person } from '../shared/domain/person.domain';
坚持有什么办法有WebStorm喜欢从索引文件导入?
神奇。我半期待WebStorm不支持这一点。很高兴我错了。 – Hampus
从Webstorm 2017.2开始,此设置将迁移到* File |设置|编辑|代码样式| Typescript(Imports标签)* – FunkyOne