Skip to content

ts-node fails when trying to execute a script not included in 'rootDir' of tsconfig.json #540

Description

I have separate scripts and src directories. With project source files being in src/ it's the dir set as rootDir and included with the includes option in the tsconfig.

Because ts-node loads everything in the tsconfig file this means that scripts under scripts/ cannot be executed.

Additionally when using the --skip-project option ts-node just drops to a REPL and doesn't run the script. Even if that option did work it would end up skipping all of the other tsconfig settings that /should/ be applied.

Can ts-node gain an option that ignores rootDir and everything outside of compilerOptions in the tsconfig and is there a workaround for this? I can't put the scripts dir under src/ because I don't want it included in the output directory or even being considered when the actual project itself is being compiled!

Thanks.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions