WebpackSshDeployPlugin
A webpack plugin to deploy assets to remote server by scp.
Install
yarn add webpack-ssh-deploy-plugin -D
npm i -D webpack-ssh-deploy-plugin
Usage
Add this plugin instance to your webpack config as follow:
const fs = require('fs')
const os = require('os')
const path = require('path')
const WebpackSshDeployPlugin = require('webpack-ssh-deploy-plugin').WebpackSshDeployPlugin
module.exports = {
plugins: [
new WebpackSshDeployPlugin({
root: '/home/work/www',
host: 'sandbox.example.com',
port: 22,
username: 'work',
privateKey: fs.readFileSync(path.join(os.homedir(), '.ssh/id_rsa')),
}),
]
}
This will push all assets to the host
, under the directory root
.
Options
export interface WebpackSshDeployPluginOptions {
host: string;
port?: number;
username: string;
password?: string;
privateKey?: string;
root: string;
cache?: RegExp;
}
License
MIT