/faster-webpack-upload-plugin

Upload your files to ftp server easier and faster,add support to 'webpack --watch'

Primary LanguageJavaScript

faster-webpack-upload-plugin

Upload your files to ftp server easier and faster,add support to 'webpack --watch'

Installation

npm i -D faster-webpack-upload-plugin

Usage

add following code to your webpack config file.

const FasterUploadPlugin = require('faster-webpack-upload-plugin');

var webpackConfig = {
  entry: 'index.js',
  output: {
    path: 'assets',
    filename: 'index_bundle.js'
  },
  plugins: [
    new FasterUploadPlugin({
      host: 'host',
      port: 'post', // default: 22
      username: 'username',
      password: 'password',
      localPath: 'local path', // eg. 'assets'
      remotePath: 'remote path', // eg. /home/website/assets
      log: boolean, //default: false, is log details
      progress: boolean, // default: false, show upload progress bar
      clearFolder: boolean //default: false, clear remote path files for the first time
    })
  ]
}

for other options you can see https://github.com/mscdex/ssh2#client-methods

License

This project is licensed under MIT.