Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

sonofmagic/npm-lib-template

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

npm-lib-template

codecov

icebreaker 编写的一个 npm 包的一个模板

  • 使用 tsup 打包 , rollup 打包版本在 rollup 分支 (兼容 tsc)
  • 使用 vitest 作为单元测试框架
  • 使用 eslint 来规范代码风格
  • 输出 dist -> cjs,esm and .d.ts
  • 使用 semantic-release 来发布 npm/github

为什么使用 vitest 而不是原先的 jest

vitest 开箱即用, jest 在同时遇到 cjsesm 依赖的时候,支持差,而且配置复杂,依赖的 preset 多,比如 ts-jest..

scripts

rename

执行 npm run init:rename

作用为替换 package.json 中默认包含的所有名称为 npm-lib-template 的字段

默认替换为新建代码仓库的文件夹名称!

bin

执行 npm run init:bin

作用为 package.json 添加 filesbin,同时生成 bin/{{pkg.name}}.jssrc/cli.ts 文件

About

npm-lib-template

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Contributors 2

  •  
  •  
Morty Proxy This is a proxified and sanitized view of the page, visit original site.