How plutotcool/glsl-bundler works
Project type and purpose
• This is an open-source, JavaScript/TypeScript monorepo managed by Lerna.
• It provides a core GLSL shader “bundler” library that can run in Node or the browser, plus integrations (Rollup plugin, forthcoming Webpack loader) and a demo website built with Vite.
File structure
• Top-level:
– lerna.json, package.json, CHANGELOG.md, GitHub Actions workflows (.github/)
– packages/ – contains three sub-packages:
· glsl-bundler (core library)
· rollup-plugin-glsl (Rollup integration)
· website (demo site)
• Core library (packages/glsl-bundler):
– src/ – modules: bundler, loader, transpiler, minifier, writer, utils
– test/ – unit tests and fixtures for node & browser environments
– config files: tsconfig.json, rollup.config.js, jest.config.js, ESLint
• Plugin (packages/rollup-plugin-glsl):
– src/index.ts – uses core API
– test/fixtures – sample shaders
– config: rollup.config.js, jest.config.js, tsconfig.json
• Website (packages/website):
– src/index.ts, index.html, vite.config.ts – demonstrates plugin/core usage
README for additional insights
• Purpose: “Functional regex-based GLSL bundler, loader and minifier. Runs both on node and the browser.”
• Integrations: Rollup plugin, upcoming Webpack loader
• Live demo on Vercel
Detail
• Configuration files and test fixtures as part of the development pipeline.
• Build tools (Rollup, Vite) as separate processes that invoke adapters.