esbuild-plugin-glsl
Version:
An esbuild plugin that adds support for shader imports.
16 lines (15 loc) • 753 B
TypeScript
import { OnLoadResult } from "esbuild";
/**
* Loads and parses the given GLSL source code.
*
* Based on https://github.com/ricardomatias/esbuild-plugin-glsl-include
*
* @param filePath - The path of the file.
* @param cache - A collection of shader includes that have already been loaded.
* @param resolveIncludes - Controls whether shader includes should be inlined.
* @return A promise that resolves with an object that contains:
* * `contents`: The parsed code.
* * `warnings`: Any log messages generated during path resolution.
* * `watchFiles`: Additional file system paths for esbuild's watch mode to scan.
*/
export declare function load(filePath: string, cache: Map<string, string>, resolveIncludes: boolean): Promise<OnLoadResult>;