- yarn init -y
- tsc --init
- yarn add typescript -D
- 写代码
- tsc
- npm login
- username
- password
- emai
- 添加 .npmignorewen 文件(node_modules 自动忽略)
- npm publish
- 需要在npm 官网注册账号
- 搜索自己想发的包是否已经在 npm 上存在了
- 创建项目
- main:入口文件,指定别人引用我们发布的包时候真正引用的文件
- tsconfig 配置
- exclude:排除的文件夹
- compilerOptions
- declaration:是否自动生成 .d.ts 文件
- outDir:输出目录