I can't seem to figure out why when running
tsc *.ts
isn't working. It comes with the error: TS6053: File '*.ts' not found. How do I compile all of the .ts files in a folder? Thanks!
When running tsc
from the command line without a tsconfig present, you need to pass it a file name, i.e. app.ts
- it will walk the dependencies for you, so you don't need to use a wildcard.
If you have a tsconfig.json file, just run tsc
with no file name argument and it will use the config, which can contain wildcards.
Just type tsc
without anything. It will compile all .ts
files into .js
files. If you want to bundle them, type tsc --outFile mybundle.js
.
Please note that in this case, bundling only means that all your .js code will be placed in one file. For more elaborate options it's better to create the tsconfig.json
, as others have mentioned.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With