Reputation: 43953
I am trying to compile typescript using a cmd line code. This works for me
tsc src/bot.ts --resolveJsonModule true --module commonjs --target ES2020 --moduleResolution Node --noImplicitAny true --outDir dist --alwaysStrict true --typeRoots node_modules/@types --lib ES2020
It starts at the given file, and for every file it imports, it clones the file structure into the dist folder.
The problem is I have a bunch of *.test.ts
files for jest, scattered all around the main src folder, but nothing really imports any of them and as a result it doesn't get transpiled into the dist folder.
Is there a command I can run that will find all *.test.ts
in src folder and run tsc on it and clone it into the dist folder but mirroring the same folder structure as in src?
Upvotes: 0
Views: 330
Reputation: 2812
You can either use tsc src/**/*.ts src/*.ts ...
or configure your project with tsconfig.json
I would recommend going with a tsconfig.json file since it eliminates the need for that many command line options as well as giving you the capability of
include
Upvotes: 1