user3137766
user3137766

Reputation:

Build nodejs typescript project to production

May be a noob question about nodejs and typescript, consider i have src folder where all my .ts files are located, and a lib folder for compiled files. When i commit files to ignore lib folder from .gitignore file, my question is simple : - the other developper who is charged to pull my changes and start the production node server should compile first .ts files from source ? and then from package.json he target the compiled lib folder to run the script?

Thanks for your light

Upvotes: 2

Views: 1175

Answers (1)

kuskoman
kuskoman

Reputation: 98

Yeah, in TS it's similiar to compiled languages- you have to compile (transpile) project before using it. The common practice is to use CI/CD to transpile ts files and deploy transpiled ones to production. If you want to simplify the process of running the application in development environment I recommend you taking a look on ts-node npm package

Upvotes: 2

Related Questions