npx tsc --init
{
"compilerOptions": {
"outDir": "./dist/",
+ "sourceMap": true,
"noImplicitAny": true,
"module": "commonjs",
"target": "es5",
"jsx": "react",
"allowJs": true,
"moduleResolution": "node",
}
}
[1] $ tsc -v
[2] If the version is older than 1.6:
$ npm install -g typescript
[3] $ tsc --init
{
"scripts": {
"start": "node -r tsconfig-paths/register -r ts-node
./src/index/ts",
"build": "tsc --project tsconfig.json && tscpaths -p
tsconfig.json -s ./src -o ./dist"
}
}