webpack-ftp-plugin
Usage
Basic Usage
- 安装
$ npm i webpack-ftp-plugin
或是
$ yarn add --dev webpack-ftp-plugin
- 在项目根目录 需要添加个ftp验证文件 文件名:.ftppass 格式如下 :
"authKey": "username": "xx" "password": "xxx" "host": "x.x.x.x" "port": "21"
- add the plugin to your webpack config as follows:
var WebpackFtpPlugin = var webpackConfig = entry: 'index.js' output: path: 'dist' filename: 'index_bundle.js' plugins: remoteRoot: '/' localRoot: __dirname deployPath: './build'
注意事项
env支持,production生产环境才能deploy
process.env.NODE_ENV === 'production':
'process.env.NODE_ENV': JSON