Skip to content

tsconfig "outDir" functionality #7346

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
MCKRUZ opened this issue Mar 2, 2016 · 7 comments
Closed

tsconfig "outDir" functionality #7346

MCKRUZ opened this issue Mar 2, 2016 · 7 comments
Assignees
Labels
Docs The issue relates to how you learn TypeScript Fixed A PR has been merged for this issue

Comments

@MCKRUZ
Copy link

MCKRUZ commented Mar 2, 2016

So I currently have my project setup exactly the way it is setup in this tutorial
[https://github.com/Microsoft/TypeScript/wiki/Using-TypeScript-With-ASP.NET-5]

however in my scripts folder I now want to put another level so it would look like

scripts
----app
--------foo.ts

and have it ultimately export out to my wwwroot directory like this

wwwroot
----app
---------foo.js

however I'm finding that all scripts regardless of directory structure end up sitting at the top of the wwwroot directory. Meaning that the outDir: "../wwwroot" does not take folder structure into account.

In addition I have noticed that when I delete typescript files it doesn't delete the same javascript files within my transpiled folder.

Are these known issues or am I doing something wrong?

@mhegazy
Copy link
Contributor

mhegazy commented Mar 2, 2016

use --rootDir to point to your scripts folder. if not set, it will be inferred to app.

@mhegazy
Copy link
Contributor

mhegazy commented Mar 2, 2016

need to add this to the FAQ page.

@mhegazy mhegazy self-assigned this Mar 2, 2016
@mhegazy mhegazy added the Docs The issue relates to how you learn TypeScript label Mar 2, 2016
@MCKRUZ
Copy link
Author

MCKRUZ commented Mar 2, 2016

I don't understand. Putting that setting in will perpetuate the sub level folders?

On Mar 2, 2016, at 3:46 PM, Mohamed Hegazy notifications@github.com wrote:

need to add this to the FAQ page.


Reply to this email directly or view it on GitHub.

@mhegazy
Copy link
Contributor

mhegazy commented Mar 2, 2016

from my reply in #6435 (comment)

For outDir computation, if you only specify --outDir the output structure generated by the compiler is mapped to the input, this is based on a common path calculation, which is the longest common prefix of all your input files. Obviously this changes with the input files, so to tell the compiler what is the root of your source tree that you want mapped in the output, use --rootDir.

@MCKRUZ
Copy link
Author

MCKRUZ commented Mar 2, 2016

Ok that worked. Now what about the deletion of files? If I delete something from my rootDir, it will not subsequently delete it from my outDir. Do I need to create a gulp task for this?

@mhegazy
Copy link
Contributor

mhegazy commented Mar 2, 2016

the compiler does not delete anything. so i would suggest that your clean task would blow away your output directory, this way you can always go back to a clean state.

@mhegazy
Copy link
Contributor

mhegazy commented Apr 6, 2016

@mhegazy mhegazy closed this as completed Apr 6, 2016
@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Apr 6, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Docs The issue relates to how you learn TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

2 participants