V
V
Vann Damm2021-03-11 21:48:33
typescript
Vann Damm, 2021-03-11 21:48:33

How to prevent the tsc compiler from making a copy of a file with a .js extension?

I need to call one ts file, but at the same time I need to specify a property that forbids creating, the file that was created during the compilation process, i.e. was customConfig.ts , after calling it with tsc , I got customConfig.js, in the same file directory, what property should be set to tsc when compiling so that it doesn't create customConfig.js?! Thanks

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Daniil Vasilyev, 2021-03-11
@hello_my_name_is_dany

tsc is a transpiler. His job is to compile TypeScript to JavaScript, but no more. If you just want to run TypeScript right away, for example for development, then you can use ts-node . Also, if it annoys you that the name is in the same directory, then through tsconfig you can specify the output directory, where the js files will be located.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question