{"id":25343,"library":"esbuild-plugin-glsl-minify","title":"esbuild-plugin-glsl-minify","description":"An esbuild plugin that adds support for importing GLSL, frag, vert, and WGSL shader files with optional minification and variable mangling. Current stable version is 0.0.1, released twice. Differentiators: lightweight, integrates directly into esbuild's bundling pipeline, respects reserved words and attribute naming when mangling. It is a niche plugin for projects using esbuild that need to include shaders as strings and optionally minify them.","status":"active","version":"0.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/w8r/esbuild-plugin-glsl","tags":["javascript","esbuild","plugin","glsl","frag","vert","wgsl","shader","import","typescript"],"install":[{"cmd":"npm install esbuild-plugin-glsl-minify","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-plugin-glsl-minify","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-plugin-glsl-minify","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency required to use the plugin","package":"esbuild","optional":false}],"imports":[{"note":"Named export, not default. ESM only.","wrong":"import glsl from 'esbuild-plugin-glsl-minify'","symbol":"glsl","correct":"import { glsl } from 'esbuild-plugin-glsl-minify'"},{"note":"CommonJS destructure is required because it's a named export.","wrong":"const glsl = require('esbuild-plugin-glsl-minify')","symbol":"glsl","correct":"const { glsl } = require('esbuild-plugin-glsl-minify')"},{"note":"Explicit property access on the CJS module.","wrong":null,"symbol":"glsl","correct":"const glsl = require('esbuild-plugin-glsl-minify').glsl"}],"quickstart":{"code":"import { build } from 'esbuild';\nimport { glsl } from 'esbuild-plugin-glsl-minify';\n\nbuild({\n  entryPoints: ['input.js'],\n  outfile: 'output.js',\n  bundle: true,\n  plugins: [glsl({\n    minify: true,\n    mangle: true\n  })]\n}).catch(() => process.exit(1));","lang":"typescript","description":"Shows how to use the plugin with esbuild, enabling minification and variable mangling for imported shader files."},"warnings":[{"fix":"Ensure your bundling configuration does not set 'loader' for these extensions to something else.","message":"Plugin only processes shader files; make sure your .glsl, .frag, .vert, .wgsl files are imported as text (default behavior).","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Set both minify: true and mangle: true in the plugin options.","message":"Mangling only works when minify is also enabled; standalone mangle does nothing.","severity":"gotcha","affected_versions":">=0.0.1"}],"env_vars":null,"search_vec":"'0.0.1':31 'add':10 'attribut':47 'bundl':41 'current':27 'differenti':34 'direct':37 'esbuild':2,7,39,59,72 'esbuild-plugin-glsl-minifi':1 'file':20 'frag':15,75 'glsl':4,14,74 'import':13,79 'includ':63 'integr':36 'javascript':71 'lightweight':35 'mangl':26,50 'minif':23 'minifi':5,69 'name':48 'need':61 'nich':54 'option':22,68 'pipelin':42 'plugin':3,8,55,73 'project':57 'releas':32 'reserv':44 'respect':43 'shader':19,64,78 'stabl':28 'string':66 'support':11 'twice':33 'typescript':80 'use':58 'variabl':25 'version':29 'vert':16,76 'wgsl':18,77 'word':45","created_at":"2026-05-01T13:44:17.203351+00:00","updated_at":"2026-05-01T13:44:17.203351+00:00","problems":[{"fix":"Run 'npm install esbuild-plugin-glsl-minify' and check package.json.","cause":"Package name may be confused with other similar packages; ensure correct spelling.","error":"Cannot find module 'esbuild-plugin-glsl-minify'"},{"fix":"Use 'import { glsl } from \"esbuild-plugin-glsl-minify\"'.","cause":"Incorrect import: default import instead of named import.","error":"TypeError: glsl is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/w8r/esbuild-plugin-glsl","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/esbuild-plugin-glsl-minify","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-01","next_check":"2026-07-30","install_tag":null}}