1.0.0 • Published 6 years ago

alioss-webpack-plugin v1.0.0

Weekly downloads
5
License
WTFPL
Repository
github
Last release
6 years ago

alioss-webpack-plugin

Install

yarn add alioss-webpack-plugin -D

Example

const AliossWebpackPlugin = require('alioss-webpack-plugin')

webpackConfig.plugins.push(new AliossWebpackPlugin({
  ossOptions: {
    accessKeyId: 'your-key-id',
    accessKeySecret: 'your-key-secret',
    region: 'your-region', // eg: oss-cn-hangzhou
    bucket: ''
  },
  prefix: '', // oss directory prefix; eg: auto_upload_ci/test
  exclude: /.*\.html$/,   // Optional, default: /.*/
  enableLog: true,        // Optional, default: true
  ignoreError: false,      // Optional, default: false
  deleteMode: true        // Optional, default: true
}))

Options

  • prefix: The directory name which will accept uploaded files.
  • exclude: Support RegExp syntax, matched files will not be upload to oss
  • enableLog: Whether or not show detail infos for you, just should be enable in development mode.
  • ignoreError: Whether or not stop build if upload error.
    • true: will be stop
    • false: will be not stop
  • deleteMode: Whether or not delete file after the file uploaded succesfully.
    • true: delete
    • false: not delete
1.0.0

6 years ago