- tsc --init
- npm i typescript del-cli --save-dev
- add to package.json
{
"main": "./build/index.js",
"types": "./build/index.js",
"files": ["build/**/*"],
"scripts": {
"clean": "del ./build/*",
"build": "npm run clean && tsc",
"pub": "git add . && git commit -m \"Updates\" && npm version patch && npm run build && npm publish"
}
}``
-
tsconfig.json
- uncomment "declaration"
- "outDir" "./build"
-
npm run build (preceded by npm version patch) npm publish