Socket
Socket
Sign inDemoInstall

webpack-ssh-deploy-plugin

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    webpack-ssh-deploy-plugin

A webpack plugin for deploy assets to remote server over sftp


Version published
Maintainers
1
Install size
67.7 kB
Created

Readme

Source

WebpackSshDeployPlugin

A webpack plugin to deploy assets to remote server by scp.

Install

# yarn
yarn add webpack-ssh-deploy-plugin -D

# npm
npm i -D webpack-ssh-deploy-plugin

Usage

Add this plugin instance to your webpack config as follow:

// webpack.config.js
const fs = require('fs')
const os = require('os')
const path = require('path')
const WebpackSshDeployPlugin = require('webpack-ssh-deploy-plugin').WebpackSshDeployPlugin
module.exports = {
  // ... other config
  plugins: [
    // other 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 {
  // scp client configure
  host: string; // host to deploy
  port?: number; // port of ssh server
  username: string; // login user name
  password?: string; // user password, use password to login
  privateKey?: string; // your privateKey, use public key to login
  
  // deploy config
  root: string; // the root directory to deploy
  cache?: RegExp; // the paths to cache, if a asset's path name is matched by 
                  // the pattern, will only upload once, this is useful if your
                  // output file name use `[chunkhash]` for cache control
}

License

MIT

Keywords

FAQs

Last updated on 25 Nov 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc