A webpack ftp upload plugin, support upload file or folder to ftp server.
npm i -D webpack-ftp-upload-plugin
add following code to your webpack config file.
var WebpackFtpUpload = require('webpack-ftp-upload-plugin')
new WebpackFtpUpload({
host: 'host',
port: 'post', // default: 22
username: 'user',
password: 'password',
local: 'local path', // eg. path.join(__dirname, 'dist')
path: 'remote path', // eg. /var/www/ftp/
})
var path = require('path')
var WebpackFtpUpload = require('webpack-ftp-upload-plugin')
module.exports = {
entry: './index.js',
output: {
path: path.join(__dirname, 'dist'),
filename: 'index_bundle.js'
},
plugins: [
new WebpackFtpUpload({
host: '127.0.0.1',
port: '22',
username: 'root',
password: '123456',
local: path.join(__dirname, 'dist'),
path: '/var/www/ftp/',
})
]
}
This project is licensed under MIT.