Package Exports
- rollup-plugin-glslify
- rollup-plugin-glslify/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (rollup-plugin-glslify) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
rollup-plugin-glslify
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-glslifyUsage
// 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
}Changelog
License
Released under the MIT license.