A Babel plugin that replaces long WebGL constants (e.g., gl.TEXTURE_2D) with their corresponding numeric values at build time. Version 1.0.3 is stable, used primarily within the luma.gl ecosystem. It reduces bundle size and avoids runtime lookups, particularly useful for WebGL applications deployed in production. The plugin is lightweight, with no additional runtime dependencies, and integrates seamlessly into existing Babel configurations. It is differentiated by its specific focus on WebGL constants, whereas general constant inlining plugins are broader.
npm install babel-plugin-inline-webgl-constantsVerified import paths — ran on the pinned version, not inferred.
Shows configuring the plugin in babel.config.js and the transformation of a WebGL constant to its numeric value.
Use direct property access (gl.TEXTURE_2D) in source code.
Consider using a general purpose constant inliner or rely on bundler optimization.
Manually inline or reference numeric values for extension constants.
Upgrade to Babel 7 or use a different version of the plugin if available.
Rename WebGL context variable to 'gl' or adjust plugin configuration (if supported).
Run: npm install --save-dev babel-plugin-inline-webgl-constants
Ensure gl context is properly created and the plugin is configured correctly; check for dynamic access patterns.
Reorder plugins in .babelrc so that inline-webgl-constants runs before other transformations.
No dependency data recorded yet.