{"id":25345,"library":"esbuild-plugin-glslx","title":"esbuild-plugin-glslx","description":"A plugin for esbuild that enables importing *.glslx files, a GLSL extension for writing multiple WebGL 1.0 shaders in a single file using the export keyword. Current stable version is 0.1.1, with low release cadence. Key differentiators: provides build-time shader type checking via GLSLX compiler, optionally generates TypeScript type declarations for exported shaders, and integrates with esbuild's plugin system. Alternative solutions like webpack-glsl-loader lack built-in type checking. Requires esbuild and glslx as peer dependencies.","status":"active","version":"0.1.1","language":"javascript","source_language":"en","source_url":"https://github.com/evanw/esbuild-plugin-glslx","tags":["javascript","typescript"],"install":[{"cmd":"npm install esbuild-plugin-glslx","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-plugin-glslx","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-plugin-glslx","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency: this plugin hooks into the esbuild bundler","package":"esbuild","optional":false},{"reason":"peer dependency: used for parsing and type-checking GLSLX files","package":"glslx","optional":false}],"imports":[{"note":"CommonJS require is correct; the package does not have a default ESM export.","wrong":"import glslxPlugin from 'esbuild-plugin-glslx'","symbol":"default export","correct":"const glslxPlugin = require('esbuild-plugin-glslx')"},{"note":"The plugin is exported as a single default function, not as named exports.","wrong":"import { glslxPlugin } from 'esbuild-plugin-glslx'","symbol":"named export (not available)","correct":"const glslx = require('esbuild-plugin-glslx').default"},{"note":"Use export = values for CommonJS-style module; export default does not match the runtime shape.","wrong":"declare module \"*.glslx\" { const shaders: any; export default shaders; }","symbol":"type declaration (TypeScript)","correct":"declare module \"*.glslx\" { var values: Record<string, string>; export = values; }"}],"quickstart":{"code":"const glslxPlugin = require('esbuild-plugin-glslx')\nrequire('esbuild').build({\n  entryPoints: ['app.js'],\n  bundle: true,\n  outfile: 'out.js',\n  plugins: [glslxPlugin()],\n}).catch(() => process.exit(1))","lang":"javascript","description":"Shows basic setup: require the plugin and add it to esbuild's plugins array."},"warnings":[{"fix":"Consider using glslify or other alternatives for active development.","message":"The glslx compiler itself is in maintenance mode and may not receive updates.","severity":"deprecated","affected_versions":"all"},{"fix":"Use esbuild <0.9.0 or fork the plugin to adapt to newer API.","message":"The plugin does not support esbuild versions >=0.9.0 due to breaking changes in the plugin API.","severity":"gotcha","affected_versions":">=0.9.0 (esbuild)"},{"fix":"Manually verify generated .d.ts files or use the blanket module declaration.","message":"TypeScript declarations generated with writeTypeDeclarations: true may be incomplete for complex shader exports.","severity":"gotcha","affected_versions":"all"},{"fix":"Upgrade Node.js to version 10 or later.","message":"Requires Node.js >=10.x due to glslx dependency requirements.","severity":"breaking","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run npm install --save-dev glslx","cause":"glslx is not installed as a dependency.","error":"Error: Cannot find module 'glslx'"},{"fix":"Use const glslxPlugin = require('esbuild-plugin-glslx')","cause":"Using ES import (import glslxPlugin from ...) instead of require().","error":"TypeError: glslxPlugin is not a function"},{"fix":"Add glslxPlugin() to the plugins array in esbuild's build options.","cause":"The plugin is not applied to esbuild's build.","error":"error: No loader is configured for \".glslx\" files"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}