All Projects → avennn → webpack-alioss-upload-plugin

avennn / webpack-alioss-upload-plugin

Licence: MIT license
A flexible webpack plugin to upload files to aliyun oss, which supports multiple optional upload methods and parameters.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to webpack-alioss-upload-plugin

Webpack.js.org
Repository for webpack documentation and more!
Stars: ✭ 2,049 (+14535.71%)
Mutual labels:  webpack-plugin, webpack4
Webpack Cdn Plugin
A webpack plugin that use externals of CDN urls for production and local node_modules for development
Stars: ✭ 306 (+2085.71%)
Mutual labels:  webpack-plugin, webpack4
webpack-demos
webpack小练习
Stars: ✭ 17 (+21.43%)
Mutual labels:  webpack-plugin, webpack4
Html Inline Css Webpack Plugin
☄️ A webpack plugin for convert external stylesheet to the embedded stylesheet
Stars: ✭ 48 (+242.86%)
Mutual labels:  webpack-plugin, webpack4
Webpack Babel Multi Target Plugin
A Webpack plugin that works with Babel to allow differential loading - production deployment of ES2015 builds targeted to modern browsers, with an ES5 fallback for legacy browsers.
Stars: ✭ 150 (+971.43%)
Mutual labels:  webpack-plugin, webpack4
Nvue
master分支:webpack4实现一个vue的打包的项目,incremental: 实现增量模块打包
Stars: ✭ 55 (+292.86%)
Mutual labels:  webpack-plugin, webpack4
Awesome Cms Core
Awesome CMS Core is an open source CMS built using ASP.Net Core & ReactJS with module seperation concern in mind and provide lastest trend of technology like .Net Core, React, Webpack, SASS, Background Job, Message Queue.
Stars: ✭ 352 (+2414.29%)
Mutual labels:  webpack-plugin, webpack4
React Webpack4 Cook
💯The most powerful webpack4 tutorial in the universe
Stars: ✭ 152 (+985.71%)
Mutual labels:  webpack-plugin, webpack4
eruda-webpack-plugin
A webpack plugin of eruda to help you develop mobile app
Stars: ✭ 56 (+300%)
Mutual labels:  webpack-plugin, webpack4
qn-webpack
Qiniu webpack plugin (七牛 Webpack 插件)
Stars: ✭ 39 (+178.57%)
Mutual labels:  webpack-plugin
react-library-template
Jumpstart your team's shared react library
Stars: ✭ 26 (+85.71%)
Mutual labels:  webpack4
crx-webpack-plugin
A webpack plugin to package chrome extensions (crx) post build
Stars: ✭ 21 (+50%)
Mutual labels:  webpack-plugin
mock-webpack-plugin
A webpack plugin that starts a json mock server
Stars: ✭ 21 (+50%)
Mutual labels:  webpack-plugin
bower-resolve-webpack-plugin
Offers an enhanced bower support for enhanced-resolve plugin.
Stars: ✭ 12 (-14.29%)
Mutual labels:  webpack-plugin
remove-files-webpack-plugin
A plugin for webpack that removes files and folders before and after compilation.
Stars: ✭ 48 (+242.86%)
Mutual labels:  webpack-plugin
del-webpack-plugin
A file plugin help you remove old files after webpack (v5) bundling
Stars: ✭ 43 (+207.14%)
Mutual labels:  webpack-plugin
image-minimizer-webpack-plugin
Webpack loader and plugin to compress images using imagemin
Stars: ✭ 180 (+1185.71%)
Mutual labels:  webpack-plugin
yii2-aliyun-oss
Yii2 Aliyun OSS Yii2 阿里云 OSS
Stars: ✭ 41 (+192.86%)
Mutual labels:  aliyun-oss
chicio.github.io
👻 Fabrizio Duroni (me 😄) personal website. Created using GatsbyJS, Styled Components, Storybook, Typescript, tsParticles, GitHub pages, Github Actions, Upptime.
Stars: ✭ 20 (+42.86%)
Mutual labels:  webpack-plugin
bootpack
Create multi-page websites using bootstrap for development and webpack for task running.
Stars: ✭ 30 (+114.29%)
Mutual labels:  webpack4

webpack-alioss-upload-plugin

A flexible webpack plugin to upload files to aliyun oss, which supports multiple optional upload methods and parameters.

This plugin only works with webpack version above 4.0

Advantages

  • Supports 3 alternative upload methods that aliyun oss supports.

  • Supports multipart upload and retries at the breakpoints.

  • Can custom timeout to drop the request.

  • Can control how many http request threads are created at the meanwhile. Too many threads may result in an error returned from aliyun.

  • Can switch debug mode to decide whether or not showing verbose log.

Installation

npm i webpack-alioss-upload-plugin -D

or

yarn add webpack-alioss-upload-plugin -D

Usage

Here is a simplest usage.

const AliOSSUploadPlugin = require("webpack-alioss-upload-plugin");
// webpack config
module.exports = {
  plugins: [
    new AliOSSUploadPlugin({
      accessKeyId: "your.oss.accessKeyId",
      accessKeySecret: "your.oss.accessKeySecret",
      region: "your.oss.region",
      bucket: "your.oss.bucket"
    })
  ]
};

Options

  • accessKeyId: [String] the accessKeyId of your oss, required.
  • accessKeySecret: [String] the accessKeySecret of your oss, required.
  • region: [String] the region of your oss, required.
  • bucket: [String] the bucket name of your oss, required.
  • prefix: [String] the path to direct to files on oss, if configured, it looks like "https://${bucket}.${region}.aliyuncs.com/${prefix}/local-resolved-file-name", default ''.
  • uploadType: [String] has three types(put|stream|multipart), corresponding to alioss's upload methods(put|putStream|multipart), default multipart, more info see here.
  • uploadOptions: [Object]
    • parallel: [Number] the number of parts to be uploaded in parallel, default 4.
    • partSize: [Number] the suggested size for each part in KB, default 204800(200M), alioss's minimum partsize must larger than 100M.
    • timeout: [Number] the operation timeout in milliseconds, default 6000.
    • retries: [Number] retry times if multipart upload is interrupted, only work when uploadType is multipart
    • useChunk: [Boolean] whether or not use chunked encoding, only work when uploadType is stream, default false, more info see here.
  • concurrency: [Number] allow how many upload event to be created at the meanwhile, default 3, may your system may crash if this parameter is too large.
  • excludes: [RegExp|Array[RegExp]] files not wanting to upload to oss, default [].
  • debug: [Boolean] whether or not show verbose log on command line, default false.

Contribution and Issues

Feel free to contribute code or publish an issue, whenever you have any good idea or find a bug.

License

MIT

Author

Javen Leung

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].