1.0.1 • Published 6 years ago
@yuezheng2006/mylib v1.0.1
📚 rollup-boilerplate
Full featured boilerplate for building JavaScript libraries the modern way.
特点
- 📜 Rollup.js configuration providing compatibility with different module systems (CommonJS, ECMAScript, UMD for
<script>
tags) - 🃏 Jest setup with watch mode working
- 🐈 Yarn with lock file, pinned devDependencies and fixed Yarn version in .yarnrc using Yarn policies
如何使用
项目目录
├── LICENSE
├── README.md
├── dist 打包后output文件目录
├── example 测试用目录
├── node_modules
├── package.json
├── publish.sh yarn 发布用shell脚本
├── rollup.config.js rollup项目配置
├── src 原文件目录
├── test 单元测试目录
└── yarn.lock
开发步骤
- 修改
package.json
描述文件,修改name
和version
等信息 src/main.js
入口文件中编写项目源码- 修改
rollup.config.js
配置文件中包name
名称
操作命令
调试
yarn dev
打包
yarn build
发布
yarn publish
如果需要修改 registry 可以在
publish.sh
中修改registry
发布 package 推荐使用 scoped package 风格 如
@scope/xxx