npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

aliyun-oss-plugin

v1.0.2

Published

upload files to aliyun oss in webpack build

Downloads

4

Readme

Aliyun OSS Plugin

a webpack plugin helps you upload static file to aliyun oss

上传文件到阿里云的 Webpack 插件

Installation

yarn add -D aliyun-oss-plugin
npm i -D aliyun-oss-plugin

Configuration

const AliyunOSSPlugin = require("aliyun-oss-webpack-plugin")

module.exports = {
  output: {
    publicPath: "https://bucket.oss-region.aliyuncs.com/sub-dir"
  },
  plugins: [
    new AliyunOssPlugin({
      accessKeyId: '<access key id>',
      accessKeySecret: '<access key secret>',
      region: '<region name>',
      bucket: '<bucket name>',
      headers: {
        'Cache-Control': 'max-age=31536000'
      },
      ignore: [
        'robots.txt',
        '**/*.js.map',
        /.*\.html$/,
        function(fileName) {
          return fileName === 'service-worker.js'
        }
      ]
    })
  ]
}

Options:

key|type|default|description -|-|-|- accessKeyId|String|-|will read ALIYUN_OSS_ACCESS_KEY_ID from enviroment if not set accessKeySecret|String|-|will read ALIYUN_OSS_ACCESS_KEY_SECRET from enviroment if not set region|String|-|will read ALIYUN_OSS_REGION from enviroment if not set bucket|String|-|will read ALIYUN_OSS_BUCKET from enviroment if not set headers|Object|-|object http headers internal|Boolean|false|upload file using aliyun internal network (if you build project in aliyun same region ecs) threads|Number|8|multithread upload threads showProgress|Boolean|false|show upload progress retries|Number|5|retry times for each file when upload failed ignore|String Regexp Function or array contains above |-|filter some files that not need to upload to oss, String will treaded as glob pattern just like the filter rules in .gitignore, Regexp will match the relative path like 'index.html' and 'js/app.ffffffff.map.js', Function will get file name and return a boolean true to filter not need files.

选项:

key|type|default|description -|-|-|- accessKeyId|String|-|如果不指定此参数,将从环境变量 ALIYUN_OSS_ACCESS_KEY_ID 中读取 accessKeySecret|String|-|如果不指定此参数,将从环境变量 ALIYUN_OSS_ACCESS_KEY_SECRET 中读取 region|String|-|如果不指定此参数,将从环境变量 ALIYUN_OSS_REGION 中读取 bucket|String|-|如果不指定此参数,将从环境变量 ALIYUN_OSS_BUCKET 中读取 headers|Object|-|资源的 http 头 internal|Boolean|false|使用阿里云内网上传 OSS 文件 (使用同地域的阿里云 ECS 构建项目时使用) threads|Number|8|多线上传的并发数 showProgress|Boolean|false|显示上传进度 retries|Number|5|文件上传失败时的重试次数 ignore|String Regexp Function 或者上述类型的数组 |-|筛出不需要上传的文件, String 会被当成 glob pattern 处理(类似 .gitignore 的匹配规则), Regexp 匹配像 'index.html' 和 'js/app.ffffffff.map.js' 的相对地址, Function 会被传入文件相对地址,然后返回布尔值 true 来筛出不需要的文件.