Skip to content

TypeScript needs a baseDir option #287

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
basarat opened this issue Jul 28, 2014 · 4 comments
Closed

TypeScript needs a baseDir option #287

basarat opened this issue Jul 28, 2014 · 4 comments
Labels
Declined The issue was declined as something which matches the TypeScript vision Out of Scope This idea sits outside of the TypeScript language design constraints Suggestion An idea for TypeScript

Comments

@basarat
Copy link
Contributor

basarat commented Jul 28, 2014

Say we have the File structure (--outDir js):

ts
    a.ts
    foo
    |> b.ts
    |> c.ts
js
    a.js
    foo
    |> b.js
    |> c.js

If we compile with all three files with outDir its all okay. But if we only compile b.ts or c.ts with outDir js then we would get a new folder inside ts:

js    
    |> b.js
    |> c.js

Current workaround is to create a .baseDir.ts file under the ts folder and always pass it to the compiler in addition to the individual files.

Workaround from grunt-ts : TypeStrong/grunt-ts#77
Ported from Codeplex : https://typescript.codeplex.com/workitem/2297

@RyanCavanaugh
Copy link
Member

This is a great example of something we'd like grunt-ts or other external build tools to handle, rather than adding yet more commandline switches to tsc.

@fsoikin
Copy link

fsoikin commented Jul 29, 2014

Sooo... I take it, you're moving away from Visual Studio compile-on-save experience?

@basarat
Copy link
Contributor Author

basarat commented Jul 29, 2014

Sooo... I take it, you're moving away from Visual Studio compile-on-save experience

No. That uses the language service and has the complete project in memory and does an incremental emit. So this doesn't apply to that.

grunt-ts is a command line tool restarted on each change (by something like grunt-contrib-watch). I agree that this will add unneeded complexity to the compiler and can be handled elsewhere. But just wanted everyone to know that it needs to be done in their own build tools.

@mhegazy
Copy link
Contributor

mhegazy commented Apr 20, 2015

This has been fixed in #2772, and added as --rootDir

@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Declined The issue was declined as something which matches the TypeScript vision Out of Scope This idea sits outside of the TypeScript language design constraints Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

4 participants