{"id":25343,"library":"esbuild-plugin-glsl-minify","title":"esbuild-plugin-glsl-minify","description":"An esbuild plugin that adds support for importing GLSL, frag, vert, and WGSL shader files with optional minification and variable mangling. Current stable version is 0.0.1, released twice. Differentiators: lightweight, integrates directly into esbuild's bundling pipeline, respects reserved words and attribute naming when mangling. It is a niche plugin for projects using esbuild that need to include shaders as strings and optionally minify them.","status":"active","version":"0.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/w8r/esbuild-plugin-glsl","tags":["javascript","esbuild","plugin","glsl","frag","vert","wgsl","shader","import","typescript"],"install":[{"cmd":"npm install esbuild-plugin-glsl-minify","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-plugin-glsl-minify","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-plugin-glsl-minify","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency required to use the plugin","package":"esbuild","optional":false}],"imports":[{"note":"Named export, not default. ESM only.","wrong":"import glsl from 'esbuild-plugin-glsl-minify'","symbol":"glsl","correct":"import { glsl } from 'esbuild-plugin-glsl-minify'"},{"note":"CommonJS destructure is required because it's a named export.","wrong":"const glsl = require('esbuild-plugin-glsl-minify')","symbol":"glsl","correct":"const { glsl } = require('esbuild-plugin-glsl-minify')"},{"note":"Explicit property access on the CJS module.","wrong":null,"symbol":"glsl","correct":"const glsl = require('esbuild-plugin-glsl-minify').glsl"}],"quickstart":{"code":"import { build } from 'esbuild';\nimport { glsl } from 'esbuild-plugin-glsl-minify';\n\nbuild({\n  entryPoints: ['input.js'],\n  outfile: 'output.js',\n  bundle: true,\n  plugins: [glsl({\n    minify: true,\n    mangle: true\n  })]\n}).catch(() => process.exit(1));","lang":"typescript","description":"Shows how to use the plugin with esbuild, enabling minification and variable mangling for imported shader files."},"warnings":[{"fix":"Ensure your bundling configuration does not set 'loader' for these extensions to something else.","message":"Plugin only processes shader files; make sure your .glsl, .frag, .vert, .wgsl files are imported as text (default behavior).","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Set both minify: true and mangle: true in the plugin options.","message":"Mangling only works when minify is also enabled; standalone mangle does nothing.","severity":"gotcha","affected_versions":">=0.0.1"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'npm install esbuild-plugin-glsl-minify' and check package.json.","cause":"Package name may be confused with other similar packages; ensure correct spelling.","error":"Cannot find module 'esbuild-plugin-glsl-minify'"},{"fix":"Use 'import { glsl } from \"esbuild-plugin-glsl-minify\"'.","cause":"Incorrect import: default import instead of named import.","error":"TypeError: glsl is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}