Skip to content
PluginStats

@laynezh/vite-plugin-lib-assets weekly downloads statistics

By laynezh · npm · Vite plugins

A Vite Plugin extracts resource files referenced in library mode instead of embedded them as base64.

View on npm Fresh · Oct 18, 2026

@laynezh/vite-plugin-lib-assets has 14,741 recorded weekly downloads on npm, a decrease of 48.3% over the past 30 days, ranking #861 of 2,322 tracked listings.

Weekly downloads
14,741
Official API · Oct 18, 2026
7-day growth
-50.6%
-15.1K weekly downloads
30-day growth
-48.3%
-13.8K weekly downloads
90-day growth
-52.8%
-16.5K weekly downloads
Rank
#861
Among tracked npm listings

About @laynezh/vite-plugin-lib-assets

English | 中文

@laynezh/vite-plugin-lib-assets

A Vite Plugin extracts resource files referenced in library mode instead of embedded them as base64.

Install

npm i @laynezh/vite-plugin-lib-assets -D

Or

yarn add @laynezh/vite-plugin-lib-assets -D

Or

pnpm add @laynezh/vite-plugin-lib-assets -D

Usage

// vite.config.ts
import libAssetsPlugin from '@laynezh/vite-plugin-lib-assets'

export default defineConfig({
  plugins: [
    libAssetsPlugin({ /* options */ }),
  ],
})

Example: playground/

Hints
  • If build.ssr is set to true, you might want to enable build.ssrEmitAssets, so assets are emitted.

Option

export interface Options {
  include?: string | RegExp | (string | RegExp)[]
  exclude?: string | RegExp | (string | RegExp)[]
  name?: string
  limit?: number
  outputPath?: string | ((url: string, resourcePath: string, resourceQuery: string) => string)
  regExp?: RegExp
  publicUrl?: string
}
include

A valid picomatch pattern, or array of patterns indicate which files need to be handled by the plugin.

  • Type: string | RegExp | (string | RegExp)[]
  • Default: Same as Vite's default value for assetsInclude, you can find the complete list here.
  • Example:
    libAssetsPlugin({
      include: /\.a?png(\?.*)?$/
    })
    
exclude

Same as include, but it is used to indicate the files that should to be omitted.

  • Type: string | RegExp | (string | RegExp)[]
  • Default: undefined.
  • Example:
    libAssetsPlugin({
      exclude: /\.svg(\?.*)?$/
    })
    
name

Output name of the resource file, its usage aligns with the name option of the file-loader.

  • Type: string
  • Default: '[contenthash].[ext]'
  • Example:
    libAssetsPlugin({
      name: '[name].[contenthash:8].[ext][query]'
    })
    

The complete list can be found at loader-utils#interpolatename

limit

Files larger than the limit will be extracted to the output directory, smaller files will remain embedded in the artifact in base64 format.

  • Type: number,unit Byte
  • Default: undefined,any size of resource files will be extracted
  • Example:
    libAssetsPlugin({
      limit: 1024 * 8 // 8KB
    })
    
outputPath

Specify the output path where the extracted files will be placed.

  • Type: string | ((url: string, resourcePath: string, resourceQuery: string) => string)
  • Default: Vite's assetsDir configuration.
  • Example:
    • string
      libAssetsPlugin({
        outputPath: 'images'
      })
      
    • function
      libAssetsPlugin({
        outputPath: (url, resourcePath, resourceQuery) => {
          // `url` - file name processed by the `name` option,eg: `logo.fb2133.png`
          // `resourcePath` - `/original/absolute/path/to/file.js`
          // `resourceQuery` - `?foo=bar`
      
          return url.endsWith('.png') ? 'image' : 'assets'
        },
      })
      
regExp

Specifies a Regular Expression to extract parts of content(capture groups) from the file path and use [N] as placeholders in the name for replacement. Its usage aligns with the regexp option of the file-loader.

  • Type: RegExp
  • Default: undefined
  • Example:
    libAssetsPlugin({
      regExp: /\/([^/]+)\/[^\.]+.png$/,
      name: '[1]-[name].[contenthash:8].[ext]'
    })
    
publicUrl

Access path prefix for built resource files. Once provided, it will take effect, even while building the cjs and esm formats.

  • Type: string
  • Default: ''
  • Example:
    libAssetsPlugin({
      publicUrl: 'https://cdn.jsdelivr.net/npm/@laynezh/vite-plugin-lib-assets'
    })
    

Description from the npm listing.

  • vite-plugin
  • vite
  • generate lib assets

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

@laynezh/vite-plugin-lib-assets weekly downloads on npm, last 90 days: 14,741 weekly downloads as of Oct 18, 2026, -52.8% over 90 days.@laynezh/vite-plugin-lib-assetsWeekly downloads on npm · Last 90 days14,741downloads / week-52.8% over 90 days010K20K30K40K50KJul 20Aug 4Aug 19Sep 3Sep 18Oct 3Oct 18downloads / weekobservedarchived (Internet Archive)no observationsJul 22, 2026 – Oct 18, 2026 · 89 observations · Updated Oc…pluginstats.com
@laynezh/vite-plugin-lib-assets weekly downloads on npm, last 90 days: 14,741 weekly downloads as of Oct 18, 2026, -52.8% over 90 days.

7/30/90-day growth

@laynezh/vite-plugin-lib-assets weekly downloads growth on npm: -50.6% over 7 days, -48.3% over 30 days, -52.8% over 90 days.@laynezh/vite-plugin-lib-assetsWeekly downloads growth on npm14,741downloads / week now7-day growth-15,112 weekly downloads-50.6%30-day growth-13,751 weekly downloads-48.3%90-day growth-16,501 weekly downloads-52.8%Growth vs. nearest observation to each baseline date · Updated Oct 18, 2026pluginstats.com
@laynezh/vite-plugin-lib-assets weekly downloads growth on npm: -50.6% over 7 days, -48.3% over 30 days, -52.8% over 90 days.

Ranking history

@laynezh/vite-plugin-lib-assets npm ranking history: currently #861 (by weekly downloads).@laynezh/vite-plugin-lib-assetsnpm ranking · by weekly downloads · Last 90 days#861current rank#848#850#852#854#856#858#860#862#864Jul 22Aug 6Aug 21Sep 5Sep 20Oct 5Oct 20rankOct 18, 2026 – Oct 20, 2026 · 3 observations · Updated Oct 18, 2026pluginstats.com
@laynezh/vite-plugin-lib-assets npm ranking history: currently #861 (by weekly downloads).

Listing placement

All npm2,320 listings · 116 pages · 1,162 shown · page 44, #2 (overall #862)
All npm: every listing in weekly downloads order

Listing placement

Vite plugins253 listings · 13 pages · page 8, #2 (overall #142)
Vite plugins: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (122)
Recent weekly downloads observations for @laynezh/vite-plugin-lib-assets
Date (UTC)Weekly downloadsChange vs. previous
14,741+1.9K
12,792-1.6K
14,391-1.1K
15,536-6.8K
22,376-6K
28,3770
28,377-1.5K
29,853+88
29,765+548
29,217+297
28,920-648
29,568-3.2K
32,756-6.9K
39,639—

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/@laynezh/vite-plugin-lib-assets. First seen Oct 16, 2026; last successful collection Oct 20, 2026. See the methodology.