1.0.9 • Published 2 years ago

hwf-web-cd v1.0.9

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

前端代码自动发布服务器/代码备份

压缩

  • webpack配置
yarn add filemanager-webpack-plugin -D
const outputDir = "dist"
const FileManagerWebpackPlugin = require('filemanager-webpack-plugin');
{ 
   plugins:[
    new FileManagerWebpackPlugin({
        events: {
          onEnd: {
            // delete: [`./${outputDir}/${outputDir}.zip`],
            archive: [
              { source: `./${outputDir}`, destination: `./${outputDir}/${outputDir}.zip` }
            ]
          }
        }
      })
    ]
}

使用说明

  • 安装
yarn add hwf-web-cd -D
  • 新建deploy文件
const cd = require('hwf-web-cd')
const config = require('./config');
cd(config)
  • config.js (服务器参数配置)
[{
  id: 'test', //  发布环境类型 key 
  name: '测试环境',
  publisherName: "发布者姓名",
  locationPath: 'dist/dist.zip', //本地代码路径,路径开头不要加"/"
  host: '服务器IP',
  port: '端口',
  username: '账号',
  password: '密码',
  path: 'web/frontend/h5/dist.zip',
}]
  • package.json
"scripts":{
    "deploy": "node ./deploy/index.js"
}
  • 运行
 yarn deploy
1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago