Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

esbuild-plugin-glslify

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esbuild-plugin-glslify

Import GLSL strings with glslify - based on https://github.com/glslify/rollup-plugin-glslify

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
40
increased by48.15%
Maintainers
1
Weekly downloads
 
Created
Source

esbuild-plugin-glslify

NOTE: this plugin is based on rollup-plugin-glslify

An esbuild plugin to import GLSL strings with glslify (a node.js-style module system for GLSL).

import frag from './shaders/frag.glsl';
console.log(frag);

Installation

yarn:

yarn add esbuild-plugin-glslify --dev

NPM:

npm install --save-dev esbuild-plugin-glslify

Usage

import { build } from 'esbuild';
import { glslify } from 'esbuild-plugin-glslify';

build({
	entryPoints: ['input.js'],
	outfile: 'output.js',
	bundle: true,
	plugins: [glslify({
        extensions: [ 'vs', 'fs', '.glsl', '.frag.shader' ],
		compress: true,
	})],
}).catch(e => {
    console.error(e);
    process.exit(1);
});

Configuration

The plugin responds to the following configuration options:

glslify({
    extensions: string[],   // a list of the file extensions this plugin should process.
                            // DEFAULT: [ 'vs', 'fs', 'vert', 'frag', 'glsl' ]
    
    compress: boolean,      // should the finial output be compressed (minified)
                            // DEFAULT: false 
});

Any unrecognized options will be forwarded to the glslify compiler:

glslify({
    transform: ['glslify-import'],  // this will configure glslify to import the `glslify-import` module
});

Read the glslify API options for more information.

See also

Keywords

FAQs

Package last updated on 25 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc