Skip to content

9romise/vite-plugin-ssh-deploy

Repository files navigation

vite-plugin-ssh-deploy

A plugin for uploading the local build directory to the host server.

NPM version

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.

Features

  • Upload the local build outdir to the host server
  • Backup from the host server

Notice

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

Install

npm i vite-plugin-ssh-deploy -D

Usage

example:

// 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

License

MIT License © 2022 Vida Xie

About

A plugin used to upload locally packaged products to a host server using SSH.

Resources

License

Stars

Watchers

Forks

Packages

No packages published