webpack-ftp-filesupload
v2.0.1
Published
upload variousType files to ftp server
Downloads
15
Readme
webpack-ftp-filesupload
webpack plugin for upload variousType files to ftp server
Installation
npm i -D webpack-ftp-filesupload
or
yarn add --dev webpack-ftp-filesupload
Changes in 2.X
Change lifecycle hook from after-emit to emit
Compatibility with webapck4
Simple Usage
add following code to your webpack.prod.conf.js.
2.X version
const WebpackFtpFilesUpload = require('webpack-ftp-filesupload');
module.exports = {
plugins : [
// ...other plugin
new WebpackFtpFilesUpload({
ftpConfig: {
user: 'ftp username',
host: 'ftp host',
password: 'ftp password'
},
uploadPath: {
js : '//jsDir/' or '/jsDir/',
css : '//cssDir/' or '/cssDir/',
img : '//imgDir/' or '/imgDir/',
font : '//fontDir/' or '/fontDir/'
},
autoAddPathPrefix: true // if true, the uploadPath will auto add file type directory. eg: js: '//jsDir/' -> then the real path is '//jsDir/js'
})
]
};
1.X version
const WebpackFtpFilesUpload = require('webpack-ftp-filesupload');
module.exports = {
plugins : [
// ...other plugin
new WebpackFtpFilesUpload({
ftpConfig: {
user: 'ftp username',
host: 'ftp host',
password: 'ftp password'
},
uploadPath: {
js : '//jsDir/' or '/jsDir/',
css : '//cssDir/' or '/cssDir/',
img : '//imgDir/' or '/imgDir/',
font : '//fontDir/' or '/fontDir/'
},
distPath: 'dist/**/*.*', // Generated file directory
autoAddPathPrefix: true // if true, the uploadPath will auto add file type directory. eg: js: '//jsDir/' -> then the real path is '//jsDir/js'
})
]
};