npm init -y
tsc --init
{
"compilerOptions": {
.....
.....
"outDir": "./dist",
....
}
}
Let's put together a script to build the source code
{
....
....
....
"scripts": {
"build": "tsc --watch",
"start" : "tsc && node dist/main.js",
},
....
....
}
This setup was inspired from a similar writeup on Digital Ocean. I have simplified it further and made a few changes.
- Remote the use of TSLint. TSLint is no longer maintained and eslint is the way to go
- Not all projects need express, so removed that dependency