X Tutup
Skip to content

Flatten outDir structure when both of rootDir and rootDirs is specified #8245

@alexeagle

Description

@alexeagle

TS@next: with a tsconfig.json like

        "outDir": "built/",
        // rootDirs for resolution of relative imports
        "rootDirs": [
          "src",    // for authored sources
          "codegen" // for generated code
        ],

and src/a.ts and codegen/a_gen.ts I end up with
built/src/a.js and built/codegen/a_gen.js.

I want an output structure that collapses the trees
built/a.js and built/a_gen.js
It seems like --rootDir might work, but

  1. try rootDir: src -> error TS6059 because all sources are expected to be under rootDir
  2. try rootDir: . -> no change in behavior

I would like some combination of rootDir and rootDirs that flattens the output tree.
cc @robwormald @tbosch

Metadata

Metadata

Assignees

No one assigned

    Labels

    SuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup