Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

webpack-aliyun-oss

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webpack-aliyun-oss

a webpack plugin to upload assets to aliyun oss

  • 0.0.1
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
25
decreased by-56.9%
Maintainers
1
Weekly downloads
 
Created
Source

webpack-aliyun-oss

A webpack plugin to upload assets to aliyun oss

一个webpack插件,上传资源到阿里云cdn

Install

$ npm i webpack-aliyun-oss -S

Options

  • from: 从哪里取文件上传,默认为output.path。支持类似gulp.src的glob方法,如'./build/**', 可以为glob字符串或者数组。
  • dist: 上传到哪个目录下,默认为根目录。
  • region: 阿里云上传区域
  • accessKeyId: 阿里云的授权accessKeyId
  • accessKeySecret: 阿里云的授权accessKeySecret
  • bucket: 上传到哪个bucket
  • deletOrigin: 上传完成是否删除原文件,默认false
  • setHeaders: 配置headers

Example

const WebpackAliyunOss = require('webpack-aliyun-oss')
const webpackConfig = {
  // ... 省略其他
  plugins: [new WebpackAliyunOss({
    from: ['./build/**', '!./build/**/*.html'],
    dist: 'path/in/alioss',
    region: 'your region',
    accessKeyId: 'your key',
    accessKeySecret: 'your secret',
    bucket: 'your bucket',
    deleteOrigin: false,
    setHeaders(filePath) {
      return {
        'Cache-Control': 'max-age=31536000'
      }
    }
  })]
}

Keywords

FAQs

Package last updated on 01 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc