An esbuild plugin that transforms inline GLSL template literals tagged with `glsl` from glslify into resolved shader code at build time. Version 1.1.0 is the current stable release with an optional minify flag. It integrates esbuild's bundling pipeline, applying glslify to inline shader strings so you can use `#pragma glslify: require(...)` inside JavaScript/TypeScript source files. Unlike separate file processing, this plugin keeps shaders co-located with code. Requires glslify as a peer dependency and node >= 12. Actively maintained.
npm install esbuild-plugin-glslify-inlineNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to configure esbuild with the plugin and use glslify to inline a GLSL shader that imports a noise function from npm package.
Install glslify as a dev dependency: npm install --save-dev glslify
Ensure all inline shader code is inside glsl`...` tagged templates imported from 'glslify'.
Use the documented `#pragma glslify: require(...)` syntax for importing GLSL modules.
Upgrade to v1.1.0 to use the minify option: npm install esbuild-plugin-glslify-inline@latest
npm install --save-dev glslify
Use `import { glslifyInline } from 'esbuild-plugin-glslify-inline'`Use glsl tag: `import glsl from 'glslify'; const shader = glsl´...´`