webpack-ultimate-sftp

0.0.3 • Public • Published

Webpack Ultimate SFTP

This plugin allows you to upload you package to your server using SFTP. The plugin accepts either a password or ssh private key as authentication.

To speed up the process of uploading, multiple connections are used which you can control in your configuration if your server does not support this feature.

npm install webpack-ultimate-sftp
const WebpackUltimateSftp = require('webpack-ultimate-sftp')
module.exports = {
  // ...webpack config
  plugins: [
    // ...other plugins
    new WebpackUltimateSftp({
      host: 'Your IP address',
      username: process.env.USERNAME || process.env.USER,
      privateKey: `${process.env.USERPROFILE || process.env.HOME}/.ssh/id_rsa`,
    })
  ] 
}

params

name type description required default
connections Number concurrent connections to open optional 8
host string remote server host (ip address) no null
username string Authorized username required system username
password string Authorized user password either password or private key system username
privateKey string|Buffer Private key path or Buffer either password or private key system profile id_rsa
passphrase string private key passphrase optional null
localPath string local path deployment root optional ./
remotePath string remote path deployment root optional ./
ignore string|Regex patterns to skip uploading, can be inside an array optional ./

example

new WebpackUltimateSftp({
  connections: 8,
  host: 'remote.server.host',
  username: 'username',
  password: 'password',
  privateKey: `${process.env.USERPROFILE || process.env.HOME}/.ssh/id_rsa`,
  passphrase: 'passphrase',
  localPath: path.resolve(__dirname, './dist'),
  remotePath: '/path/to/remote/dist',
  ignore: [
    /fonts/ 
  ]
})

Package Sidebar

Install

npm i webpack-ultimate-sftp

Weekly Downloads

1

Version

0.0.3

License

MIT

Unpacked Size

13.2 kB

Total Files

10

Last publish

Collaborators

  • andrewfountain