Skip to content

879733672/tool

Repository files navigation

TOOL 脚手架

tool 通用工具库,采用 rollup 进行打包

1. node打包

    npm run node:dev  // node开启开发模式  isExternal 默认排除其它外部引用(如jquery,lodash),需要自己build下修改配置
    npm run node:build // node 打包生成es、cjs、umd、umd(min)代码压缩文件


2. rollup命令打包

    > 简单打包umd

    sourcemap true 默认开启  打包默认不排除其它外部引用(如jquery,lodash)
    npm run easy:dev   // 开发模式  umd模式
    npm run easy:build // 打包umd

    > 提供输出 es、cjs、umd、umd(min)压缩文件 多个打包文件

    npm run start  // rollup开发模式
    npm run build  // 生产打包模式

3. 命令
    npm run daily

发布包基本流程

  • 使用 nrm 管理 npm 源:

    // 安装
    npm install -g nrm
    // 查看
    nrm ls
    // 切换
    nrm use taobao
    // 增加源
    nrm add  <registry> <url> [home]
    // 删除源
    nrm del <registry>
    
  • 发布包

    • 编写包代码(npm init 等操作,具体在下面会提及)

    • 切换 registry 到 npm 对应链接https://registry.npmjs.org/:nrm use npm

    • 登录:npm login

    • 发布、更新:npm publish

    git commit --no-verify -m "xxx" // 某一次提交想要禁用 husky,可以添加参数--no-verify

目录结构

tool
├── CHANGELOG.md
├── README.md
├── build   // 打包配置文件
│   ├── build.js
│   ├── dev.js
│   ├── easy.config.js
│   ├── node.config.js
│   ├── rollup.config.js
│   └── version.js
├── commitlint.config.js
├── dir.md
├── dist
│   ├── index.js
│   ├── index.js.map
│   ├── index.min.js
│   └── index.min.js.map
├── es
│   ├── index.js
│   └── index.js.map
├── lib
│   ├── index.js
│   └── index.js.map
├── package-lock.json
├── package.json
└── src
    ├── core
    │   └── index.js
    ├── foo.js
    ├── index.html
    └── index.js   // 打包入口文件

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published