A plugin for uploading the local build directory to the host server.
Important
This is a plugin I implemented early in my learning journey, and it is not a good solution to the deployment issue.
This plugin only uses the closeBundle
hook so it can be a standalone script that runs independently at any time.
If you need any assistance, feel free to contact me.
- Upload the local build outdir to the host server
- Backup from the host server
If you use zip mode, you need to install unzip on the host server
if you want to backup, you need to install zip on the host server
npm i vite-plugin-ssh-deploy -D
// vite.config.ts
import SSHDeploy from 'vite-plugin-ssh-deploy'
export default {
plugins: [
SSHDeploy({
host: '***.***.***.***',
port: 22,
username: '****',
password: '******',
remotePath: '/usr/local/www/',
previewPath: 'https://github.com',
})
]
}
Refer to types for all options
MIT License © 2022 Vida Xie