UNPKG

@pizca/esbuild-webgl

Version:

An esbuild plugin to import WebGL shader files as strings, with optional comment stripping for cleaner bundles.

17 lines (16 loc) 591 B
import type { Plugin } from 'esbuild'; export interface WebGLPluginOptions { /** * Whether to remove comments from shader files. */ stripComments?: boolean; } /** * An esbuild plugin to load WebGL shader files (`.vert`, `.frag`, `.glsl`) as string modules. * * This plugin can optionally remove comments from the shader source code before exporting. * * @param {WebGLPluginOptions} [options] - Plugin options. * @returns {import('esbuild').Plugin} The configured esbuild plugin instance. */ export default function webglPlugin(options?: WebGLPluginOptions): Plugin;