Skip to content

TypeScript needs a baseDir option #287

Closed

Description

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

Activity

  1. RyanCavanaugh commented on Jul 29, 2014

    @RyanCavanaugh
    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.

  2. fsoikin commented on Jul 29, 2014

    @fsoikin

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

  3. basarat commented on Jul 29, 2014

    @basarat
    ContributorAuthor

    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.

  4. mhegazy commented on Apr 20, 2015

    @mhegazy
    Contributor

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

  5. locked and limited conversation to collaborators on Jun 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    DeclinedThe issue was declined as something which matches the TypeScript visionOut of ScopeThis idea sits outside of the TypeScript language design constraintsSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions