Answer the question
In order to leave comments, you need to log in
How to compile all typescript files into one file when writing a Node application?
Hey Habr! I can’t figure out the problem, I’m writing a simple NodeJS backend, while using TypeScript, and the fact is that every time the project is compiled, tsc compiles the ts file to the same place where the source file is located, which complicates navigation, and looks it's not very pretty. I tried to add the appropriate settings to tsconfig, but all the time I get an error
Maybe it's possible to somehow solve this issue, otherwise js files are very eyesore.
Answer the question
In order to leave comments, you need to log in
Bundlers can bundle into one file.. bundlers! ) Gulp, Grunt, Babel, WebPack, new-fast Vite and more. They are already able to ts
transpile during assembly, if screwed accordingly. lotion. For example, about WebPack in the TypeScript documentation, or about TypeScript in the Vite configuration (it can do it out of the box).
You need to separate the client and server into two subfolders, each with its own webpack config and package.json.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question