Skip to content
PluginStats

vite-plugin-glsl weekly downloads statistics

By UstymUkhman (2 listings) · npm · Vite plugins

Import, inline (and minify) GLSL/WGSL/Slang shader files

View on npm Fresh · Dec 6, 2026

vite-plugin-glsl has 186,423 recorded weekly downloads on npm, an increase of 3.7% over the past 30 days, ranking #535 of 3,247 tracked listings.

Weekly downloads
186,423
Official API · Dec 5, 2026
7-day growth
+7.1%
+12.4K weekly downloads
30-day growth
+3.7%
+6.6K weekly downloads
90-day growth
+78.6%
+82K weekly downloads
Rank
#535
▼ 2 in 7 days

About vite-plugin-glsl

Vite Plugin GLSL

Import, inline (and minify) GLSL/WGSL/Slang shader files

npm GitHub package.json version GitHub

Inspired by threejs-glsl-loader and vite-plugin-string, compatible with Babylon.js, three.js and lygia.

Installation

npm i vite-plugin-glsl --save-dev
# or
yarn add vite-plugin-glsl --dev
# or
pnpm add -D vite-plugin-glsl
# or
bun add vite-plugin-glsl --dev

Usage

// vite.config.js
import { defineConfig } from 'vite';
import glsl from 'vite-plugin-glsl';

export default defineConfig({
  plugins: [glsl()]
});
With TypeScript

Add extension declarations to your types in tsconfig.json:

{
  "compilerOptions": {
    "types": [
      "vite-plugin-glsl/ext"
    ]
  }
}

or as a package dependency directive to your global types:

/// <reference types="vite-plugin-glsl/ext" />
With Slang Shaders

Slang shaders are not supported out of the box; however, starting from version 1.6.0, it's quite easy to use them with this plugin. You'll need some minimal setup you can find here to copy-paste in your vite.config file. The idea is to use multiple importKeywords to include Slang shader chunks and convert the output shader to a web-friendly format (like WGSL) by using the onComplete option and the Slang compiler.

Default Options

glsl({
  include: [                      // Glob pattern, or array of glob patterns to import
    '**/*.glsl', '**/*.wgsl',
    '**/*.vert', '**/*.frag',
    '**/*.vs', '**/*.fs'
  ],
  exclude: undefined,             // Glob pattern, or array of glob patterns to ignore
  defaultExtension: 'glsl',       // Shader suffix to use when no extension is specified
  warnDuplicatedImports: true,    // Warn if the same chunk was imported multiple times
  removeDuplicatedImports: false, // Automatically remove an already imported chunk
  importKeywords: ['#include'],   // Keywords used to import shader chunks
  onComplete: undefined,          // Function to call with output shader
  minify: false,                  // Minify/optimize output shader code
  watch: true,                    // Recompile shader on change
  root: '/'                       // Directory for root imports
})

Example

root
├── src/
│   ├── glsl/
│   │   ├── chunk0.frag
│   │   ├── chunk3.frag
│   │   ├── main.frag
│   │   ├── main.vert
│   │   └── utils/
│   │       ├── chunk1.glsl
│   │       └── chunk2.frag
│   └── main.js
├── vite.config.js
└── package.json
// main.js
import fragment from './glsl/main.frag';
// main.frag
#version 300 es

#ifndef GL_FRAGMENT_PRECISION_HIGH
  precision mediump float;
#else
  precision highp float;
#endif

out vec4 fragColor;

#include chunk0.frag;

void main (void) {
  fragColor = chunkFn();
}
// chunk0.frag

// ".glsl" extension will be added automatically:
#include utils/chunk1;

vec4 chunkFn () {
  return vec4(chunkRGB(), 1.0);
}
// utils/chunk1.glsl

#include chunk2.frag;
#include ../chunk3.frag;

vec3 chunkRGB () {
  return vec3(chunkRed(), chunkGreen(), 0.0);
}
// utils/chunk2.frag

float chunkRed () {
  return 0.0;
}
// chunk3.frag

float chunkGreen () {
  return 0.8;
}

Will result in:

// main.frag
#version 300 es

#ifndef GL_FRAGMENT_PRECISION_HIGH
  precision mediump float;
#else
  precision highp float;
#endif

out vec4 fragColor;

float chunkRed () {
  return 0.0;
}

float chunkGreen () {
  return 0.8;
}

vec3 chunkRGB () {
  return vec3(chunkRed(), chunkGreen(), 0.0);
}

vec4 chunkFn () {
  return vec4(chunkRGB(), 1.0);
}

void main (void) {
  fragColor = chunkFn();
}

Change Log

  • Starting from v1.6.0 this plugin supports onComplete callback function to customize output shaders.

  • Starting from v1.5.2 this plugin uses vite.transformWithOxc function when available.

  • Starting from v1.5.1 this plugin is fully compatible with vite^7.0.0.

  • Starting from v1.5.0 this plugin supports a custom importKeyword to include shader chunks.

  • Starting from v1.4.0 compress option was renamed to minify and now it allows a promise callback.

  • Starting from v1.3.2 this plugin allows to automatically remove already imported chunks with the removeDuplicatedImports option set to true.

  • Starting from v1.3.1 this plugin is fully compatible with vite^6.0.0.

  • Starting from v1.3.0 this plugin will not remove comments starting with ///, unless compress option is set to true.

  • Starting from v1.2.0 this plugin is fully compatible with vite^5.0.0.

  • Starting from v1.1.1 this plugin has a complete TypeScript support. Check "Usage" > "With TypeScript" for more info.

  • Starting from v1.0.0 this plugin is fully compatible with vite^4.0.0.

  • Starting from v0.5.4 this plugin supports custom compress callback function to optimize output shader length after all shader chunks have been included.

  • Starting from v0.5.0 this plugin supports shaders hot reloading when watch option is set to true.

  • Starting from v0.4.0 this plugin supports chunk imports from project root and root option to override the default root directory.…

Description from the npm listing.

  • vite
  • glsl
  • wgsl
  • lygia
  • webgl
  • webgpu
  • vitejs
  • plugin
  • threejs
  • shaders
  • babylonjs
  • vite-plugin
  • glsl-shaders
  • wgsl-shaders
  • webgl-shaders
  • webgpu-shaders

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

vite-plugin-glsl weekly downloads on npm, last 90 days: 186,423 weekly downloads as of Dec 5, 2026, +78.6% over 90 days.vite-plugin-glslWeekly downloads on npm · Last 90 days186,423downloads / week+78.6% over 90 days050K100K150K200K250K300KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
vite-plugin-glsl weekly downloads on npm, last 90 days: 186,423 weekly downloads as of Dec 5, 2026, +78.6% over 90 days.

7/30/90-day growth

vite-plugin-glsl weekly downloads growth on npm: +7.1% over 7 days, +3.7% over 30 days, +78.6% over 90 days.vite-plugin-glslWeekly downloads growth on npm186,423downloads / week now7-day growth+12,433 weekly downloads+7.1%30-day growth+6,587 weekly downloads+3.7%90-day growth+82,033 weekly downloads+78.6%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
vite-plugin-glsl weekly downloads growth on npm: +7.1% over 7 days, +3.7% over 30 days, +78.6% over 90 days.

Ranking history

vite-plugin-glsl npm ranking history: currently #535 (by weekly downloads).vite-plugin-glslnpm ranking · by weekly downloads · Last 90 days#535current rank#470#480#490#500#510#520#530#540#550Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 18, 2026 – Dec 6, 2026 · 44 observations · Updated Dec 5, 2026pluginstats.com
vite-plugin-glsl npm ranking history: currently #535 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,083 shown · page 27, #15 (overall #535)
All npm: every listing in weekly downloads order

Listing placement

Vite plugins300 listings · 15 pages · page 4, #19 (overall #79)
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 vite-plugin-glsl
Date (UTC)Weekly downloadsChange vs. previous
186,423-9.2K
195,670+10.8K
184,878+11.2K
173,663+5.3K
168,348-801
169,149-3.9K
173,009-981
173,990-5.6K
179,584-23.1K
202,705-19.1K
221,796-14.3K
236,128-7.2K
243,358-7.6K
250,930—

Similar npm Vite plugins plugins

All 20 vite-plugin-glsl alternatives

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/vite-plugin-glsl. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.