Skip to content

rootDir option documentation incorrect and confusing #22039

Open

Description

@DeadMG

I've recently started a new project with TS and run into some confusing behaviour. I've placed my files in an "app" folder, but the emitted TS (using AMD modules with --outFile) generates module names without the app prefix, breaking my JS references.

Turns out that I was supposed to use rootDir, instead of rootDirs.

The first issue is that since #5819, this actually does affect outFile as well, so the documentation clearly stating it only applies to outDir is wrong.
The second issue is that it's really confusing the difference between rootDirs and rootDir, and it's still unclear to me why rootDirs: ["./"] did not produce the same result as rootDir: "./". The written documentation is not very clear out this and potentially, one or both options neeed renaming.

This is referencing the current live version on https://www.typescriptlang.org/docs/handbook/compiler-options.html

Activity

  1. changed the title [-]rootDir option documentation confusing[/-] [+]rootDir option documentation incorrect and confusing[/+] on Feb 19, 2018
  2. mhegazy commented on Mar 10, 2018

    @mhegazy
    Contributor

    rootDir and rootDirs have completely different meanings... I apologize for the bad choice of names. but that said. i am not sure what part of the docs you would like to be updated? can you elaborate? also PRs would be welcomed.

  3. shadow-light commented on Oct 11, 2018

    @shadow-light

    rootDir and rootDirs have completely different meanings

    Thanks for pointing this out! Just lost a lot of time because I thought -rootDirs was an alternative to specifying multiple --rootDir options.

    Renaming would be helpful!

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

    DocsThe issue relates to how you learn TypeScript

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions