0.0.3 • Published 4 years ago

webpack-ultimate-sftp v0.0.3

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

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

nametypedescriptionrequireddefault
connectionsNumberconcurrent connections to openoptional8
hoststringremote server host (ip address)nonull
usernamestringAuthorized usernamerequiredsystem username
passwordstringAuthorized user passwordeither password or private keysystem username
privateKeystring|BufferPrivate key path or Buffereither password or private keysystem profile id_rsa
passphrasestringprivate key passphraseoptionalnull
localPathstringlocal path deployment rootoptional./
remotePathstringremote path deployment rootoptional./
ignorestring|Regexpatterns to skip uploading, can be inside an arrayoptional./

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/ 
  ]
})