Skip to content
PluginStats

@vgpu/wgsl weekly downloads statistics

By vgpu · npm · Vite plugins

WGSL shader compilation, runtime resolution, and webpack/vite loaders for vgpu.

View on npm Fresh · Dec 6, 2026

@vgpu/wgsl has 422,990 recorded weekly downloads on npm, an increase of 8.7% over the past 30 days, ranking #421 of 3,247 tracked listings.

Weekly downloads
422,990
Official API · Dec 5, 2026
7-day growth
+1.6%
+6.8K weekly downloads
30-day growth
+8.7%
+33.9K weekly downloads
90-day growth
+476%
+349.5K weekly downloads
Rank
#421
▼ 12 in 7 days

About @vgpu/wgsl

@vgpu/wgsl

@vgpu/wgsl turns WGSL files into JavaScript shader-source modules and resolves WGSL-to-WGSL imports before bundling. It includes a resolver/runtime, webpack and Vite integrations, and a TypeScript ambient-types sub-export for import shader from "./shader.wgsl".

The resolver preserves shader entry-point names for WebGPU pipeline creation while mangling non-entry helpers and imports to avoid cross-module symbol collisions. Loader integrations also wire transitive .wgsl imports into bundler watch/HMR systems.

Installation

pnpm add @vgpu/wgsl
npm install @vgpu/wgsl
yarn add @vgpu/wgsl

TypeScript setup

Add a project .d.ts file (for example wgsl-env.d.ts):

/// <reference types="@vgpu/wgsl/wgsl-types" />

Or add the package type to tsconfig.json:

{
  "compilerOptions": {
    "types": ["@vgpu/wgsl/wgsl-types"]
  }
}

This is required for TypeScript to accept .wgsl imports. If you cannot use the sub-export, a local fallback is:

declare module "*.wgsl" {
  import type { ShaderSource } from "@vgpu/wgsl";
  const source: ShaderSource;
  export default source;
}

Bundler integrations

Webpack 5

Recommended rule:

module.exports = { module: { rules: [{ test: /\.wgsl$/, loader: "@vgpu/wgsl/loader-webpack" }] } };

Verbose/options form (advanced):

module.exports = {
  module: {
    rules: [
      {
        test: /\.wgsl$/,
        loader: require.resolve("@vgpu/wgsl/loader-webpack"),
        options: { minify: true },
      },
    ],
  },
};

minify defaults to false; set it to true for the production preset: strip comments/whitespace and safely shorten supported private identifiers. Use { minify: { whitespace: true } } for whitespace-only output.

Vite 5+
import { wgslVitePlugin } from "@vgpu/wgsl/loader-vite";

export default { plugins: [wgslVitePlugin()] };

Pass wgslVitePlugin({ minify: true }) for the production preset: strip comments/whitespace and safely shorten supported private identifiers. Use { minify: { whitespace: true } } for whitespace-only output.

Next.js / Turbopack (Next >= 15.5)

Recommended string form:

import type { NextConfig } from "next";

const config: NextConfig = {
  turbopack: {
    rules: {
      "*.wgsl": {
        loaders: ["@vgpu/wgsl/loader-webpack"],
        as: "*.js",
      },
    },
  },
};

export default config;

Verbose/options form (advanced; object loaders require options by the Next TypeScript type):

import type { NextConfig } from "next";

const config: NextConfig = {
  turbopack: {
    rules: {
      "*.wgsl": {
        loaders: [{ loader: "@vgpu/wgsl/loader-webpack", options: { minify: true } }],
        as: "*.js",
      },
    },
  },
};

export default config;

Use legacy experimental.turbo.rules on older Next 15.0-15.2 apps. The as: "*.js" mapping is required because Turbopack's webpack-loader bridge expects loaders to return JavaScript.

WGSL syntax

WGSL modules can import named exports from other WGSL files:

import { helper_color } from "./helper.wgsl";

@fragment
fn fs_main() -> @location(0) vec4f {
  return helper_color();
}

Imported files export normal WGSL declarations:

export fn helper_color() -> vec4f { return vec4f(0.1, 0.2, 0.3, 1.0); }

See examples/next-wgsl/app/*.wgsl and packages/wgsl/tests/*.test.ts for more examples.

Mangling and entry-point preservation

Non-entry helpers and imported symbols may be renamed to _vgsl_<hash>__<name> to avoid collisions between modules. WebGPU entry-point functions annotated with @vertex, @fragment, or @compute are preserved, so pipeline creation keeps working:

device.createRenderPipeline({
  layout: "auto",
  vertex: { module, entryPoint: "vs_main" },
  fragment: { module, entryPoint: "fs_main", targets: [{ format }] },
});

Bindings and override constants are likewise exposed by their shader-visible names; when a reflected item needs a generated name, use its mangledName field.

Reflection API

import { reflectSource, resolveShader } from "@vgpu/wgsl/runtime";

const resolved = await resolveShader({ entry: "./shader.wgsl" });
const fragment = resolved.reflection.entryPoints.find((entry) => entry.stage === "fragment");

// Synchronous single-source reflection for main API (vgpu)/runtime WGSL strings.
// Use resolveShader() for import graphs.
const reflection = reflectSource(`
  struct Params { time: f32 }
  @group(0) @binding(0) var<uniform> params: Params;
  @fragment fn main() -> @location(0) vec4f { return vec4f(params.time); }
`);

resolveShader() returns { wgsl, deps, cacheKey, ast, sourceMap, diagnostics, reflection }. reflectSource(wgsl, path?) returns the same frozen ReflectionFacade shape for a single raw WGSL string without resolving imports; if the source contains WGSL imports it throws and points callers to resolveShader().

Reflection currently exposes:

FieldDescription
reflection.entryPoints{ name, mangledName, stage, workgroupSize? } for @vertex, @fragment, and @compute functions.
reflection.bindings{ group, binding, name, type, kind, addressSpace?, access?, struct?, layout?, bindingLayout? } for discovered resources, including BGL-precise layouts.
reflection.overrides{ name, mangledName, defaultValue? } for override constants.
reflection.featuresRequiredFeature names from enable ...; directives.
reflection.structs / reflection.aliasesReflected host-visible type declarations with original and mangled names.
reflection.hostShareableLayoutsNaga-standard host-shareable layouts for uniform/storage resources.

Minify option…

Description from the npm listing.

  • webgpu
  • graphics
  • rendering
  • wgsl
  • shader
  • webpack-loader
  • vite-plugin

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

@vgpu/wgsl weekly downloads on npm, last 90 days: 422,990 weekly downloads as of Dec 5, 2026, +476% over 90 days.@vgpu/wgslWeekly downloads on npm · Last 90 days422,990downloads / week+476% over 90 days0100K200K300K400K500KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
@vgpu/wgsl weekly downloads on npm, last 90 days: 422,990 weekly downloads as of Dec 5, 2026, +476% over 90 days.

7/30/90-day growth

@vgpu/wgsl weekly downloads growth on npm: +1.6% over 7 days, +8.7% over 30 days, +476% over 90 days.@vgpu/wgslWeekly downloads growth on npm422,990downloads / week now7-day growth+6,844 weekly downloads+1.6%30-day growth+33,933 weekly downloads+8.7%90-day growth+349,507 weekly downloads+476%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
@vgpu/wgsl weekly downloads growth on npm: +1.6% over 7 days, +8.7% over 30 days, +476% over 90 days.

Ranking history

@vgpu/wgsl npm ranking history: currently #421 (by weekly downloads).@vgpu/wgslnpm ranking · by weekly downloads · Last 90 days#421current rank#400#410#420#430#440#450#460#470Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 18, 2026 – Dec 6, 2026 · 44 observations · Updated Dec 5, 2026pluginstats.com
@vgpu/wgsl npm ranking history: currently #421 (by weekly downloads).

Listing placement

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

Listing placement

Vite plugins300 listings · 15 pages · page 3, #18 (overall #58)
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 @vgpu/wgsl
Date (UTC)Weekly downloadsChange vs. previous
422,990-17K
439,980+5.5K
434,523-9.3K
443,867-4.9K
448,739+24.8K
423,985-120
424,105+8K
416,146+19.6K
396,570-210
396,780+5.4K
391,386-3.2K
394,563-3.8K
398,316+5.7K
392,626—

Similar npm Vite plugins plugins

All 20 @vgpu/wgsl 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/@vgpu/wgsl. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.