{"library":"rollup-shader-chunks","title":"rollup-shader-chunks","description":"A Rollup plugin for optimising inline GLSL shaders in JavaScript or TypeScript files. Current stable version is 1.5.2, with a moderate release cadence. It processes template literals marked with a GLSL hint (e.g., `/* glsl */`), enabling shader minification and injection of uniform/attribute definitions directly in your bundle. Unlike generic GLSL loaders, this plugin focuses on inline shader strings within existing JS files, integrating seamlessly with Rollup's build pipeline. It supports Rollup 3 and 4, requiring Node.js ^20.19.0, ^22.21.0, or >=24.12.0. The plugin is configurable via include/exclude globs and an enabled flag.","language":"javascript","status":"active","last_verified":"Mon Apr 27","install":{"commands":["npm install rollup-shader-chunks"],"cli":null},"imports":["import { shaderChunks } from 'rollup-shader-chunks'","import type { ShaderChunksOptions } from 'rollup-shader-chunks'","import { createShaderChunks } from 'rollup-shader-chunks'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"// Install: npm i rollup-shader-chunks --save-dev\n// rollup.config.js\nimport { shaderChunks } from 'rollup-shader-chunks';\n\nexport default {\n  input: 'src/index.js',\n  plugins: [\n    shaderChunks({\n      include: ['**/*.js'],\n      exclude: ['**/*.min.js'],\n      enabled: true\n    })\n  ],\n  output: {\n    dir: 'dist',\n    format: 'es'\n  }\n};\n\n// src/index.js\nconst vertexShader = /* glsl */ `\n  void main() {\n    gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n  }\n`;","lang":"typescript","description":"Sets up the plugin in a Rollup config, processes inline GLSL shaders marked with /* glsl */ comment.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}