rollup-plugin-glslify
TypeScript icon, indicating that this package has built-in type declarations

1.3.1 • Public • Published

rollup-plugin-glslify

NPM Package NPM Package

Import GLSL strings with glslify (a node.js-style module system for GLSL).

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

Installation

npm i -D rollup-plugin-glslify

# or

yarn add -D rollup-plugin-glslify

Usage

// rollup.config.js
import glslify from 'rollup-plugin-glslify';

export default {
    // ...
    plugins: [
        glslify()
    ]
};

Options

glslify(options)
{
    // Default
    include: [
        '**/*.vs',
        '**/*.fs',
        '**/*.vert',
        '**/*.frag',
        '**/*.glsl'
    ],

    // Undefined by default
    exclude: 'node_modules/**',

    // Enabled by default
    compress: true

    // The compress option also accepts a function with its first argument
    // being the string containing the glslified shader code.
    // The function is expected to return a string (or object) - the compressed shader
}

glslify API options

Changelog

License

Released under the MIT license.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.3.1
    1,443
    • latest

Version History

Package Sidebar

Install

npm i rollup-plugin-glslify

Weekly Downloads

1,205

Version

1.3.1

License

MIT

Unpacked Size

6 kB

Total Files

5

Last publish

Collaborators

  • pschroen