github地址:git
https://github.com/shangyueyue/ssy-publishgithub
1、安裝npm
npm install ssy-publish -D
2、在process.cwd() 目錄下建立 sftprc.json文件json
{ "localPath": "./dist", "remotePath": "/app/xxx", "protectedRemotePath": "/app/xxx", "connect": { "host": "xx.xx.xx.xx", "port": 22, "username": "xxx", "password": "xxx" } }
3、npm run ssy-publish app
"scripts": { "ssy-publish": "ssy-publish -c dist" },