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

qiniu-cdn-webpack-plugin

v1.1.1

Published

Webpack plugin for delete & upload & refresh to QiNiu CDN

Downloads

7

Readme

qiniu-cdn-webpack-plugin

将webpack编译之后的文件上传到七牛云,支持上传前删除bucket中的旧文件,上传之后刷新cdn。

特性

  • [x] 支持上传到七牛云指定bucket
  • [x] 支持排除指定文件
  • [ ] 支持对比上传
  • [x] 支持上传前清空指定bucket
  • [x] 支持上传完成后刷新cdn

安装

npm install --save-dev qiniu-cdn-webpack-plugin
yarn add --dev qiniu-cdn-webpack-plugin

使用方法

本插件最低支持[email protected] 建议使用最新LTS版本 可以使用n管理node版本

//webpack config
const Qiniu = require('qiniu-cdn-webpack-plugin')

const CDN_HOST = `https://static.qiniuxxx.com/`
module.exports = {
  entry: 'app.js',
  output: {
    path: __dirname + '/dist',
    filename: 'app.[chunkhash].js',
    //配置webpack打包后插入文件时的cdn
    publicPath: CDN_HOST
  },
  plugins: [
    new Qiniu({
        accessKey: 'accessKey',
        secretKey: 'secretKey',
        bucket: 'static_bucket',
        zone: 'Zone_z0',
        exclude: /\.html/,
        refreshCDN: CDN_HOST,
        refreshFilter: /(a\.js)|(b\.js)/
        clean: true,
        cleanExclude: /c\.js/
    })
  ]
}

参数

|Name|Type|Default|Description| |:--:|:--:|:-----:|:----------| |accessKey|{Sring}||七牛提供的accessKey| |secretKey|{Sring}||七牛提供的secretKey| |bucket|{Sring}||七牛云存储中的bucket| |zone|{Sring}|Zone_z1|七牛云存储位置,华东 Zone_z0、华北 Zone_z1、华南 Zone_z2、北美 Zone_na0| |chunkSize|{Number}|20|每次并行上传的文件个数| |exclude|{RegExp}||要排除的文件名正则规则| |refreshCDN|{Sring}||想要刷新cdn的域名,不填写默认不刷新cdn,填写默认上传完成后刷新此次上传的所有文件| |refreshFilter|{RegExp|Function}||七牛限额每天只能刷新500个文件,通过这个参数可以过滤出想要刷新的文件。| |clean|{Boolean}|false|上传之后,删除七牛云存储bucket中的除了本次上传之外的所以文件,防止每次文件名称变动hash,产生多余垃圾文件。| |cleanExclude|{RegExp|Function}||通过这个参数可以过滤出七牛中不想清除的文件|

License

MIT License

Copyright (c) 2018 ZhangZhiheng