LighFusion
LighFusion

Reputation: 126

Absolute path(C:/) in tsconfig.json outDir

Is it possible to setup absolute path to a different disk drive, like i have my work on D:\work\project\tsconfig.json, and i want it to compile in c:\work\release.js If i write "outDir": "C:/work/release/" compile doesn't create .js files !

Is it possible or not ?

Upvotes: 2

Views: 490

Answers (1)

Shaun Luttin
Shaun Luttin

Reputation: 141662

Short Answer

Yes. It is possible to setup an absolute path to a different disk drive.

How?

Use either outFile or outDir.

outFile works only with AMD and System as the module setting. See the details in the --module setting description.

{
  "compilerOptions": {
    "target": "es5",
    "module": "amd",
    "outFile": "C://work/release.js"
  }
}

ourDir works with any valid module setting.

{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "outDir": "C://work/release/"
  }
}

More Details

Consider the following source file directory:

D:\work\project\
  tsconfig.json
  index.ts
  addProduct.ts
  sellProduct.ts

outFile builds the source files into a single output file:

C:\work\
  release.js

outDir builds the source files and maintains the original file names:

C:\work\release\
  index.js
  addProduct.js
  sellProduct.js

Upvotes: 1

Related Questions