Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Can I run a webserver with ts-node or similar with a codebase of mixed JS and TS?

I have a server running Node that is written in JavaScript. I would like to begin adding new features in TypeScript, and gradually convert the old code as we go.

I also don’t want to recompile manually every time I make changes, using ts-node would be ideal if I had a purely ts codebase.

Is there configuration for ts-node that will ignore js files in the mix, or another launcher wrapper that can handle this logic?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Adding this option to your tsconfig.json would do the trick:

{
  "compilerOptions": {
    ...
    "checkJs": false
    ...
  }
}
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading