Giter VIP home page Giter VIP logo

upload-plugin's Introduction

upload-plugin

上传构建资源到服务器的 webpack 插件(支持 webpack4 和 webpack5)

为什么需要它?

  • 它支持删除服务器的文件后上传
  • 使用简单,只需要提供几个必要字段

使用方式

npm i @boses/upload-plugin -D
# or
yarn add @boses/upload-plugin -D

webpack

const UploadPlugin = require('@boses/upload-plugin');
module.exports = {
  // 省略其他配置
  plugins: [
    new UploadPlugin({
      // ...
    }),
  ],
};

api

  new UploadPlugin(option, remove),

option

src

  • type: string
  • required: false

要上传到服务器的文件夹,默认的话为 webpack 配置的 path 路径

to

  • type: string
  • required: true

要上传到的服务器路径,注意 linux 形式的路径

port

  • type: number
  • required: false

服务器端口号,默认为 22

host

  • type: string
  • required: true

host 主机名,不可省略

username

  • type: string
  • required: false

连接的用户名,默认为root

password

  • type: string
  • required: false

连接服务器的密码,它与privateKey必须存在一项

privateKey

  • type: string
  • required: false

连接服务器的秘钥,它与password必须存在一项

remove

  • type: boolean
  • required: false

是否删除服务器上的文件,默认为true

协议

MIT License

upload-plugin's People

Contributors

bosens-china avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.