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 · Dec 6, 2026

@laynezh/vite-plugin-lib-assets has 28,414 recorded weekly downloads on npm, a decrease of 44.3% over the past 30 days, ranking #936 of 3,247 tracked listings.

Weekly downloads
28,414
Official API · Dec 5, 2026
7-day growth
+1.1%
+299 weekly downloads
30-day growth
-44.3%
-22.6K weekly downloads
90-day growth
-4.2%
-1.2K weekly downloads
Rank
#936
▼ 24 in 7 days

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: 28,414 weekly downloads as of Dec 5, 2026, -4.2% over 90 days.@laynezh/vite-plugin-lib-assetsWeekly downloads on npm · Last 90 days28,414downloads / week-4.2% over 90 days010K20K30K40K50K60KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
@laynezh/vite-plugin-lib-assets weekly downloads on npm, last 90 days: 28,414 weekly downloads as of Dec 5, 2026, -4.2% over 90 days.

7/30/90-day growth

@laynezh/vite-plugin-lib-assets weekly downloads growth on npm: +1.1% over 7 days, -44.3% over 30 days, -4.2% over 90 days.@laynezh/vite-plugin-lib-assetsWeekly downloads growth on npm28,414downloads / week now7-day growth+299 weekly downloads+1.1%30-day growth-22,557 weekly downloads-44.3%90-day growth-1,241 weekly downloads-4.2%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
@laynezh/vite-plugin-lib-assets weekly downloads growth on npm: +1.1% over 7 days, -44.3% over 30 days, -4.2% over 90 days.

Ranking history

@laynezh/vite-plugin-lib-assets npm ranking history: currently #936 (by weekly downloads).@laynezh/vite-plugin-lib-assetsnpm ranking · by weekly downloads · Last 90 days#936current rank#700#750#800#850#900#950Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 18, 2026 – Dec 6, 2026 · 44 observations · Updated Dec 5, 2026pluginstats.com
@laynezh/vite-plugin-lib-assets npm ranking history: currently #936 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,084 shown · page 47, #16 (overall #936)
All npm: every listing in weekly downloads order

Listing placement

Vite plugins300 listings · 15 pages · page 8, #19 (overall #159)
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 (170)
Recent weekly downloads observations for @laynezh/vite-plugin-lib-assets
Date (UTC)Weekly downloadsChange vs. previous
28,414+518
27,896-195
28,091+621
27,470+1.4K
26,023-805
26,828-576
27,404-711
28,115-190
28,305+479
27,826-754
28,580-452
29,032-294
29,326-73
29,399—

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 Dec 6, 2026. See the methodology.