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

@tastien/umi-plugin-uploadoss

v0.0.2

Published

该插件可将静态图片在构建打包完成后上传到OSS,并自动在源码中进行映射

Downloads

12

Readme

umi-plugin-uploadoss

NPM version NPM downloads

Install

$ yarn add umi-plugin-uploadoss -D --registry http://npm.tastientech.com/

Config

在.umirc.ts 或 config/config.ts中配置插件,包括OSS的访问密钥、Bucket等信息

以智慧门店项目为例子:

const argv = require('minimist')(process.argv.slice(2));

oss: {
  accessKeyId: argv.accessKeyId,
  accessKeySecret: argv.accessKeySecret,
  bucket: 'tst-intelligence-pro',
  region: 'oss-cn-shanghai',
  targetDirectory: 'smart-stores',
  outputPath: 'assets',
  // cnd域名 + targetDirectory 
  // 或者 oss域名即https://tst-intelligence-pro.aliyuncs.com.oss-cn-shanghai.com/smart-stores
  publicPath: 'https://tst-intelligence-pro.tastientech.com/smart-stores',
  minFileSize: 0,
}

API

  • accessKeyId:访问密钥ID,由用户创建。

  • accessKeySecret:访问密钥秘钥,由用户创建。

  • stsToken:临时访问令牌,可选。用于临时授权。

  • bucket:默认要访问的存储桶名,可选。如果没有存储桶,可以通过 putBucket() 方法创建一个。

  • endpoint:OSS地域域名,可选。它优先于 region 字段。

  • region:存储桶所在的数据中心位置,可选。默认为 oss-cn-hangzhou。

  • internal:是否通过阿里云内网访问OSS,默认为false。如果你的服务器也在阿里云上,可以设置为true以节省费用。

  • secure:指示OSS客户端使用HTTPS(secure: true)还是HTTP(secure: false)协议。

  • timeout:所有操作的实例级超时时间,默认为60秒。

  • cname:是否使用自定义域名。

  • refreshSTSTokenInterval:刷新STS Token的时间间隔(毫秒)。刷新的时间间隔应该小于STS信息的过期时间,默认为300000毫秒(5分钟)。

  • refreshSTSToken:用于在STS信息过期时自动设置新的STS Token、accessKeyId和accessKeySecret的函数。函数返回值必须是一个包含accessKeyId、accessKeySecret和stsToken字段的对象,并且需要返回一个Promise。

  • targetDirectory: 上传到的桶的目录

  • outputPath: 图片资源打包后的导出路径,默认assets

  • publicPath: 图片资源的CDN或者OSS路径,即图片所放的位置

  • minFileSize: 限制多少大小的资源无需上传,默认 0

LICENSE

MIT