rollup-plugin-glslify

Import GLSL strings with glslify

Usage no npm install needed!

<script type="module">
  import rollupPluginGlslify from 'https://cdn.skypack.dev/rollup-plugin-glslify';
</script>

README

rollup-plugin-glslify

NPM Package Build Status Dependencies Dev Dependencies

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

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

Installation

npm install --save-dev 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/**',

    // Compress shader by default using logic from rollup-plugin-glsl
    compress: true
}

glslify API options

Changelog

License

Released under the MIT license.

See also