MDB
MDB

Reputation: 341

Typescript: --outDir does not seem to work

I am using typescript in vs2015 and I have the following structure in my project:

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

There is a tsconfig.json in my app directory with the following values:

{
  "compilerOptions": {
    "noImplicitAny": true,
    "module": "system",
    "moduleResolution": "node",
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "noEmitOnError": true,
    "removeComments": false,
    "sourceMap": true,
    "target": "es5",
    "outDir": "../lib/spa"
  }
}

I have set up vs2015 to compile my ts files on save. But the compiled js files are generated in the same app dir, and not in the desired /lib/spa folder. Suggestions ?

Upvotes: 1

Views: 1986

Answers (1)

toskv
toskv

Reputation: 31600

In TypeScript versions lower than 1.8 the out option does not work together with the module option.

You an check the issue here.

In version 1.8 you will be able to use out when the module option is amd or system.

You can use the typescript@next version of TypeScript and make use of the feature now. To install it run:

$ npm install -g typescript@next

Upvotes: 1

Related Questions