Skip to content

--outDir and --rootDir #7958

@farfromrefug

Description

@farfromrefug

TypeScript Version:
1.8.9

I am generating a library using the outDir option. The idea is mostly not to pollute my src dir.
But the issue is that i still want reference relative path to be relative as if the files where in src
The problem mostly happens with existing definition files in src
I think the problem is related to this one

let's say src is assets
and outDir is build/assets

my src :

test.d.ts
test.ts
test2.ts

test2.ts reference ./test.d.ts

my ouptut dir (build/assets) looks like this

test.js
test.js.map
test2.js
test2.js.map
test.d.ts
test2.d.ts

the problem appears in test2.d.ts and test2.js.map and test.js.map
in test2.d.ts it references ../../assets/test.d.ts when i want ./test.d.ts
in test2.js.map it references its sources ../../assets/test2.ts when i want test2.ts
same in test.js.map

I tried the option rootDir and set it to assets as i thought that was what it was for : to force all relative output path to be related to it. But it doesn't work.

Is there any way to do this? I need this because even if i build inside a different dir i still want to package it as if it was in the source dir.

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions