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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@sohu-bpd/unplugin-cdn-upload

v1.0.1

Published

Upload built assets to a CDN and update asset URLs.

Readme

@sohu-bpd/unplugin-cdn-upload

Upload built assets to a private CDN storage service after the host build output is written.

Features

  • supports Vite, Rollup, webpack, Rspack, and Rolldown through host-specific adapters
  • uploads files from the final build output directory after the corresponding host hook runs
  • filters files with include / exclude rules
  • excludes **/*.html by default
  • signs PUT Object requests with the SCS HMAC-SHA1 flow
  • keeps generated asset references unchanged

Host Support

The package root exports the unplugin factory object. In app config, prefer the host-specific subpaths:

  • @sohu-bpd/unplugin-cdn-upload/vite
  • @sohu-bpd/unplugin-cdn-upload/rollup
  • @sohu-bpd/unplugin-cdn-upload/webpack
  • @sohu-bpd/unplugin-cdn-upload/rspack
  • @sohu-bpd/unplugin-cdn-upload/rolldown

Rsbuild should use the /rspack entry through tools.rspack; there is no separate ./rsbuild export.

Usage

Vite

import { defineConfig } from "vite";
import cdnUpload from "@sohu-bpd/unplugin-cdn-upload/vite";

export default defineConfig({
  plugins: [
    cdnUpload({
      bucket: "frontend-assets",
      prefix: "my-app/2026-03-30",
      host: "http://bjcnc.scs.sohucs.com",
      accessKey: "access-key",
      secretKey: "secret-key",
      concurrency: 3,
      include: ["assets/**"],
      exclude: ["**/*.html"]
    })
  ]
});

Rollup

import cdnUpload from "@sohu-bpd/unplugin-cdn-upload/rollup";

export default {
  plugins: [
    cdnUpload({
      bucket: "frontend-assets",
      prefix: "my-app/2026-03-30",
      host: "http://bjcnc.scs.sohucs.com",
      accessKey: "access-key",
      secretKey: "secret-key"
    })
  ]
};

Other Hosts

  • Use @sohu-bpd/unplugin-cdn-upload/webpack in webpack configs.
  • Use @sohu-bpd/unplugin-cdn-upload/rspack in Rspack configs and in Rsbuild via tools.rspack.plugins.
  • Use @sohu-bpd/unplugin-cdn-upload/rolldown in Rolldown configs.

Rsbuild

import cdnUpload from "@sohu-bpd/unplugin-cdn-upload/rspack";

export default {
  tools: {
    rspack: {
      plugins: [
        cdnUpload({
          bucket: "frontend-assets",
          prefix: "my-app/2026-03-30",
          host: "http://bjcnc.scs.sohucs.com",
          accessKey: "access-key",
          secretKey: "secret-key"
        })
      ]
    }
  }
};

Options

| Name | Description | Default | Required | | --- | --- | --- | --- | | bucket | Bucket name. | - | Yes | | prefix | Object key prefix. Leading and trailing / are removed. | "" | No | | host | SCS host or origin such as bjcnc.scs.sohucs.com or http://bjcnc.scs.sohucs.com. | - | Yes | | accessKey | Access key. | - | Yes | | secretKey | Secret key. | - | Yes | | include | Glob rule or glob rule list. | ["**/*"] | No | | exclude | Glob rule or glob rule list. | ["**/*.html"] | No | | computeMd5 | Whether to send Content-MD5. | true | No | | concurrency | Maximum number of concurrent uploads. | 3 | No |

Behavior

Build output uploads are wired through the host adapters:

  • Vite uploads after closeBundle
  • Rollup and Rolldown upload after writeBundle
  • webpack and Rspack upload after afterEmit

After the relevant host finishes writing output files, the plugin scans the resolved output directory, filters files with include and exclude, and uploads matching files to:

<prefix>/<relative-output-path>

The plugin does not rewrite URLs inside generated files. During upload it prints colored, structured console logs for START, one UPLOADED line per completed upload, SUCCESS, and ERROR. Uploads run with a bounded concurrency of 3 by default unless overridden by concurrency.