Skip to content

webpack-deploy-plugin 0.0.6

Install from the command line:
Learn more about npm packages
$ npm install @planjs/webpack-deploy-plugin@0.0.6
Install via package.json:
"@planjs/webpack-deploy-plugin": "0.0.6"

About this version

webpack-deploy-plugin

npm test

Install

Using npm:

npm install @planjs/webpack-deploy-plugin --save-dev

Usage

webpack.Stats All output content will be uploaded to the server, or oss. webpack.config.js

const WebpackDeployPlugin = require('@planjs/webpack-deploy-plugin')

module.exports = {
    plugins: [
      new WebpackDeployPlugin({
        targets: {
          oss: {
            type: 'oss',
            // oss deploy folder
            dest: '/app/test1/',
            patterns: ['**', '!**.js.map'],
            OSSUploadOptions: {
              type: 'COS',
              COSOptions: {
                SecretId: 'xxx',
                SecretKey: 'xxx'
              },
              uploadParams: {
                Bucket: 'xxx',
                Region: 'xxx'
              }
            }
          },
          rsync: {
            type: 'rsync',
            patterns: ['**', '!**.js.map'],
            dest: 'root@xx.xx.xx.xx:/www/deploy folder'
          }
        },
        // The key of the `targets` used
        env: 'oss'
      })
    ]
};

Options

targets

Upload configuration collection.
Type: Record<any, TargetItem> | TargetItem

env

If there are multiple upload configurations, it will be switched according to this as the key.
Type: string

TargetItem

type

Type: rsync | oss
How to upload files.

dest

Upload to server folder.

type oss folder default ''
type rsync server connection string root@xx.xx.xx.xx:/www/deploy folder

Type: string

patterns

Type: string | string[] multimatch
The paths to match against will be uploaded.

rsyncOptions

Rsync args.
Type: { args: string[][] }

eg: ['bwlimit', 10] rsync
Detailed reference node-rsync

OSSUploadOptions

Type: object

Detailed reference oss-upload-tool

onUploadFinish

Type: (stats: Stats) => void | Promise<void>
Upload complete event.

Details


Assets

  • webpack-deploy-plugin-0.0.6-npm.tgz

Download activity

  • Total downloads 0
  • Last 30 days 0
  • Last week 0
  • Today 0