我将此import语句用于类型定义。它与SystemJS一起运行良好。但现在我正在尝试Webpack,它在构建时给我带来了问题:
import {MyDef1} from "../typings/xyz";
构建modulesError:无法解析' file'或者'目录' ../typings/xyz in / Users / e / projects / angular2-webpack-starter / src / app / services
Required in /Users/e/projects/angular2-webpack-starter/src/app/services/my.service.ts Error: Cannot resolve 'file' or 'directory' ../typings/xyz in /Users/e/projects/angular2-webpack-starter/src/app/services
文件结构:
|-app
|--services
|----my.service.ts
|--typings
|----xyz.d.ts
我应该使用.d.ts文件做其他事吗?