esbuild-plugin-glsl
Version:
An esbuild plugin that adds support for shader imports.
37 lines (36 loc) • 1.06 kB
TypeScript
import { Plugin } from "esbuild";
/**
* GLSL plugin options.
*/
export interface GLSLOptions {
/**
* Enables or disables shader minification.
*
* Defaults to the value of {@link https://esbuild.github.io/api/#minify} if not specified.
*/
minify?: boolean;
/**
* Enables or disables shader include resolution.
*
* When enabled, shaders can be included with the custom `#include "path"` directive.
*
* @defaultValue true
*/
resolveIncludes?: boolean;
/**
* Enables or disables preservation of legal comments.
*
* Legal comments either start with `//!` or `/*!` or include `@license` or `@preserve`.
*
* The default value depends on {@link https://esbuild.github.io/api/#legal-comments} if not specified.
*/
preserveLegalComments?: boolean;
}
/**
* An options wrapper function that returns the GLSL plugin.
*
* @param options - The options.
* @return The plugin.
*/
declare function glsl(options?: GLSLOptions): Plugin;
export { glsl, glsl as default };