Registry / data / broccoli-webgl-transpiler

broccoli-webgl-transpiler

JSON →
library0.0.1jsnpmunverified

A Broccoli plugin that transpiles WebGL/GLSL source files into JavaScript strings. Version 0.0.1 is the initial and only release. As a minimal plugin, it simply compiles GLSL files into exported JS strings and renames them from `.glsl` to `.js`. It does not handle shader attachment or compilation at runtime. Compared to alternatives like `ember-cli-webgl`, it is lower-level and lacks Ember-specific integration. The project appears to be early-stage with limited adoption.

npm install broccoli-webgl-transpiler
INSTALL
IMPORT
SIG · BROCCOLI-WEBGL-TRA
B
broccoli-webgl-transpiler
datajavascriptv0.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import WebGLTranspiler from 'broccoli-webgl-transpiler';
const WebGLTranspiler = require('broccoli-webgl-transpiler').default;
The package uses a default export. The require example in the README uses .default, but for ESM simply import default.
WebGLTranspiler
import { WebGLTranspiler } from 'broccoli-webgl-transpiler';
const WebGLTranspiler = require('broccoli-webgl-transpiler');
Named export is not available; only default export exists.
type BroccoliWebGLTranspilerOptions
import type { BroccoliWebGLTranspilerOptions } from 'broccoli-webgl-transpiler';
TypeScript types are not provided; this import is hypothetical.

Shows basic usage of broccoli-webgl-transpiler with a Broccoli tree.

const WebGLTranspiler = require('broccoli-webgl-transpiler'); const inputTree = 'path/to/glsl/files'; const webGLTree = new WebGLTranspiler(inputTree, { annotation: 'compile my shaders' }); // Then use webGLTree as input to another Broccoli plugin or build pipeline.
Debug
Known issues
gotchaPlugin only renames .glsl files to .js and compiles GLSL to exported JS strings; you must attach and compile shaders manually.
fix
Use higher-level library like ember-cli-webgl for automated shader compilation.
affects: <=0.0.1
deprecatedThe npm package name 'broccoli-webgl-transpiler' has low download count and no recent updates; consider alternatives.
fix
Switch to actively maintained Broccoli plugin for GLSL.
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: WebGLTranspiler is not a constructor
Using require without .default when the package uses default export.
fix
const WebGLTranspiler = require('broccoli-webgl-transpiler').default;
Error: Input tree must be a Broccoli node
Passing a string path instead of a Broccoli node.
fix
Use broccoli.source or similar to create a tree from directory.
Upgrade
Version history
0.0.1latest on npm
Audit
Dependencies
broccoli-pluginrequiredExtends Broccoli plugin base class for build pipeline integration
Agent activity
7 hits · last 30 days
node
6
OpenAI (training)
1
Resources
broccoli-webgl-transpiler — npm install broccoli-webgl-transpiler · libregistry