webpack-ftp-plugin2

0.0.3 • Public • Published

webpack-ftp-plugin2

说明

该插件基于原创修改以满足开发需求,https://github.com/CharlieLau/webpack-ftp-plugin

实例

Usage

Basic Usage

  1. 安装
     $  npm i webpack-ftp-plugin2

或是

    $  yarn  add --dev  webpack-ftp-plugin2
  1. add the plugin to your webpack config as follows:
var WebpackFtpPlugin = require('webpack-ftp-plugin2')
var webpackConfig = {
  entry: 'index.js',
  output: {
    path: 'dist',
    filename: 'index_bundle.js'
  },
  plugins: [new WebpackFtpPlugin({
      ftp: {
        "authKey": {
            "username": "xx", // 用户名
            "password": "xxx" // 密码
        },
        "host": "x.x.x.x", // ip
        "port": "21" // 端口
    },
    remoteRoot: '/', // 远程ftp路径
    localRoot: __dirname, // 本地路径根目录
    deployPath: './build' // 基于本地路径根目录的相对路径
})]
}

注意事项

env支持,production生产环境才能deploy

process.env.NODE_ENV === 'production':

new webpack.DefinePlugin({
    'process.env.NODE_ENV': JSON.stringify('production')
})

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i webpack-ftp-plugin2

Weekly Downloads

1

Version

0.0.3

License

ISC

Unpacked Size

13.9 kB

Total Files

5

Last publish

Collaborators

  • tankunpeng