I have a regular nodejs backend with some js files. I also have a ts module that is still in development. I put ts files into the backend. And each time I update the ts module, I am running tsc; nodemon src/index.js
. But compiling ts codes each time, examining generated js codes and then finding things then using it in js file is started to get annoying.
So, the question is, is it possible to use directly the ts file itself without compiling it each time?
I know it has to be compiled to run but Is it not possible to reference directly ts variables in js file with some npm package or somethingconfig.json file?, I mean I guess what I am doing is not the way it should be, ain't I right? I need a faster and modern way.
Thanks in advance.
To clarify the question here are some screenshots.
tsconfig.json:
{
"compilerOptions": {
"target": "es5",
"module": "es2020",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
}
}