Ts-node: How to don't skip `files`?

Created on 26 Jun 2018  路  8Comments  路  Source: TypeStrong/ts-node

v7.0.0 breaks all my merge declarations. I could get it partly to work by adding them to tsconfig.json's files and using the --files option when running ts-node, but that doesn't work when running tests with nyc or in general when loading via node and --require.

How do I get the old behavior back?

question

Most helpful comment

Right. But then I still need to add every declaration to files. Right now I just have the path of my types in compilerOptions.paths and it works great with tsc as well as with ts-node

Anyway, a short note in the release notes how to migrate would have saved me a lot of time.

All 8 comments

Use environment variables, as documented in the README.

Or use the CLI to execute the NYC bin command.

Right. But then I still need to add every declaration to files. Right now I just have the path of my types in compilerOptions.paths and it works great with tsc as well as with ts-node

Anyway, a short note in the release notes how to migrate would have saved me a lot of time.

Same thing. Looking for the easy way to fix declarations merging

It seems the same issue as #615 and #616, there are some workarounds there.

You asked how to get the old behaviour back and it鈥檚 the files flag. You don鈥檛 need to change anything in your config, it鈥檚 the only thing that changed with v7. Also, if you鈥檙e using paths correctly, it should already be working - the change doesn鈥檛 affect type definition resolution, only default loading of all the files referenced from the config.

Well, I've found that out too, but I didn't find anything in the doc that the --files flag not only applies to tsconfig.json's files option but also seems to apply to compilerOptions.paths.

I don鈥檛 follow, it only does apply to files/includes/excludes. It does not apply to compiler options such as paths.

Was this page helpful?
0 / 5 - 0 ratings