🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@sohu-bpd/vite-plugin-cdn-upload

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@sohu-bpd/vite-plugin-cdn-upload

Upload built assets to a CDN and update asset URLs.

latest
npmnpm
Version
0.2.0
Version published
Maintainers
1
Created
Source

@sohu-bpd/vite-plugin-cdn-upload

Upload built assets to a private CDN storage service after the Vite build completes.

Features

  • uploads files from the build output directory in closeBundle
  • 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

Usage

import { defineConfig } from "vite";
import { cdnUploadPlugin } from "@sohu-bpd/vite-plugin-cdn-upload";

export default defineConfig({
  plugins: [
    cdnUploadPlugin({
      bucket: "frontend-assets",
      prefix: "my-app/2026-03-30",
      host: process.env.SCS_HOST,
      concurrency: 3,
      include: ["assets/**"],
      exclude: ["**/*.html"]
    })
  ]
});

Options

  • bucket: required bucket name
  • prefix: optional object key prefix; leading and trailing / are removed
  • host: optional SCS host or origin such as bjcnc.scs.sohucs.com or http://bjcnc.scs.sohucs.com
  • accessKey: optional access key; falls back to SCS_ACCESS_KEY
  • secretKey: optional secret key; falls back to SCS_SECRET_KEY
  • include: optional glob rule or glob rule list; defaults to ["**/*"]
  • exclude: optional glob rule or glob rule list; defaults to ["**/*.html"]
  • env: optional custom env key mapping for accessKey, secretKey, and host
  • computeMd5: whether to send Content-MD5; defaults to true
  • concurrency: optional maximum number of concurrent uploads; defaults to 3

Behavior

The plugin runs only for Vite build mode. After bundling, it scans build.outDir, 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.

Environment Variables

By default, the plugin reads these environment variables when the corresponding option is not provided:

  • SCS_ACCESS_KEY
  • SCS_SECRET_KEY
  • SCS_HOST

FAQs

Package last updated on 31 Mar 2026

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