demo-publish-typescript-project
v1.0.0
Published
> https://blog.liblab.com/typescript-npm-packages-done-right/ > https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry
Downloads
2
Readme
https://blog.liblab.com/typescript-npm-packages-done-right/ https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry
Steps
- init repo
- install packages
- create file and directory
- config typescript
- src dir
- out dir
- add scripts - build - tsc to package.json
- further typescript configuration
- compability:
target: 'es2015'
- ship types:
declaration: true
,declarationMap: true
- compability:
- further package.json configuration
- entry point when being imported
notice it's not"main": "dist/index.js", "types": "dist/index.d.ts",
.ts
because it's compiled.- specify files to ship with the package
files":[ "dist","src" ]
- last step
npm
npm login
npm
- optional
- include repository in package.json