Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
default export
✓ const glslxPlugin = require('esbuild-plugin-glslx')
✗ import glslxPlugin from 'esbuild-plugin-glslx'
CommonJS require is correct; the package does not have a default ESM export.
named export (not available)
✓ const glslx = require('esbuild-plugin-glslx').default
✗ import { glslxPlugin } from 'esbuild-plugin-glslx'
The plugin is exported as a single default function, not as named exports.
type declaration (TypeScript)
✓ declare module "*.glslx" { var values: Record<string, string>; export = values; }
✗ declare module "*.glslx" { const shaders: any; export default shaders; }
Use export = values for CommonJS-style module; export default does not match the runtime shape.
Shows basic setup: require the plugin and add it to esbuild's plugins array.
const glslxPlugin = require('esbuild-plugin-glslx')
require('esbuild').build({
entryPoints: ['app.js'],
bundle: true,
outfile: 'out.js',
plugins: [glslxPlugin()],
}).catch(() => process.exit(1))
Debug
Known issues
deprecatedThe glslx compiler itself is in maintenance mode and may not receive updates.fixConsider using glslify or other alternatives for active development.
affects: all
gotchaThe plugin does not support esbuild versions >=0.9.0 due to breaking changes in the plugin API.fixUse esbuild <0.9.0 or fork the plugin to adapt to newer API.
affects: >=0.9.0 (esbuild)
gotchaTypeScript declarations generated with writeTypeDeclarations: true may be incomplete for complex shader exports.fixManually verify generated .d.ts files or use the blanket module declaration.
affects: all
breakingRequires Node.js >=10.x due to glslx dependency requirements.fixUpgrade Node.js to version 10 or later.
affects: all
Errors
Common errors & fixes
Error: Cannot find module 'glslx'
glslx is not installed as a dependency.
fixRun npm install --save-dev glslx
TypeError: glslxPlugin is not a function
Using ES import (import glslxPlugin from ...) instead of require().
fixUse const glslxPlugin = require('esbuild-plugin-glslx') error: No loader is configured for ".glslx" files
The plugin is not applied to esbuild's build.
fixAdd glslxPlugin() to the plugins array in esbuild's build options.
Audit
Dependencies
esbuildrequiredpeer dependency: this plugin hooks into the esbuild bundler
glslxrequiredpeer dependency: used for parsing and type-checking GLSLX files