关于Visual Studio 2015:typescript:–outDir似乎不起作用

Typescript: --outDir does not seem to work

我在vs2015中使用typescript,我的项目中具有以下结构:

1
2
3
4
in my wwwroot
           app - it containts some ts files
           lib
               spa - this is where I want all my compiled js to be

我的应用程序目录中有一个tsconfig.json,其值如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
 "compilerOptions": {
   "noImplicitAny": true,
   "module":"system",
   "moduleResolution":"node",
   "experimentalDecorators": true,
   "emitDecoratorMetadata": true,
   "noEmitOnError": true,
   "removeComments": false,
   "sourceMap": true,
   "target":"es5",
   "outDir":"../lib/spa"
  }
}

我已设置vs2015在保存时编译我的ts文件。但是,已编译的js文件是在相同的应用程序目录中生成的,而不是在所需的/ lib / spa文件夹中生成的。建议?


在低于1.8的TypeScript版本中,out选项不能与module选项一起使用。

您可以在此处检查问题。

在1.8版中,当模块选项为amd或system时,您将无法使用。

您可以使用TypeScript的typescript @ next版本并立即使用该功能。要安装它,请运行:

1
$ npm install -g typescript@next