Skip to content

tsconfig cannot be specified along with an explicit list of files to compile - TS5042 #22649

Closed

Description

@ntabernero

We are using Typescript for our operational project and have found it very useful. However, we have some use cases where we need to compile one (or a few) source files along with most of the dependencies using the options encoded in tsconfig. Sadly, using the command line options won't quite get us where we would like to be (notably the absence of either a "rootDirs" and/or "paths" command line options).

We would like to be able to do "tsc -p foo.ts" (or any equivalent workaround such as enabling "rootDirs" and "paths" as command line options).

Activity

  1. simonbuchan commented on Aug 16, 2018

    @simonbuchan

    When I've wanted this, it's generally been either:

    • I'm just trying to see what typescript is outputting for some file, a-la babel CLI, here the option to just output to stdout (with highlighting?) would be preferred
    • I'm trying to set up some npm-script based "multi-project" build thing, where I have configs for various envs (e.g. browser, server, shared, spec, and e2e) for each I'm re-using. I've now settled on the other split, a tsconfig per project, and overriding the options for envs using CLI options. Being able to do something like "stack" configs on the CLI would be preferred.
  2. RyanCavanaugh commented on Aug 22, 2018

    @RyanCavanaugh
    Member

    Duping to #12958

  3. locked as resolved and limited conversation to collaborators on Oct 21, 2025
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

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions