我正在使用Palantir Eclipse TypeScript Plug-in(v1.8.0.v20160223-1645),只要我的d.ts
文件位于同一源文件夹/src
中,它就能正常运行由于JSPM,它们位于另一个文件夹中,无法再找到并导入模块:
/src <-- My .ts files are here (no js here)
/dist <-- This is where the transpiled js ends up
/jspm_packages/npm <-- External d.ts files are here
在项目TypeScript属性(Eclipse UI)中,我有:
Source folder(s): src
Exported folders(s): src;jspm_packages/npm
Output folder: dist
Output file name: (nothing here)
所以在com.palantir.typescript.prefs
中有:
...
build.path.exportedFolder=src; jspm_packages/npm
build.path.sourceFolder=src
compiler.outputDirOption=dist
...
答案 0 :(得分:3)
(这里是Eclipse TypeScript的作者)我想你想要将jspm_packages / npm添加到源文件夹中。您可能不需要导出的文件夹 - 这些文件夹用于从项目中导出内容,仅用于项目相互依赖的多项目工作区。