yarn global add typescript
In your project directory:
mkdir tsapp && cd tsapp
Install nodejs types:
yarn add @types/node
import * as http from 'http';
console.log('server. ts started');
Create tsconfig.json (optional)
using typescript compiler init option:
tsc --init
ts-node server.js
This is for client files only. Not to be mixed with server nodejs scripts. For that ts-node and @types/node should do.
Create webpack.config.js and do:
webpack