Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/glslify/rollup-plugin-glslify
Import GLSL strings with glslify
https://github.com/glslify/rollup-plugin-glslify
Last synced: 3 months ago
JSON representation
Import GLSL strings with glslify
- Host: GitHub
- URL: https://github.com/glslify/rollup-plugin-glslify
- Owner: glslify
- License: mit
- Created: 2017-12-02T18:18:35.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-02-01T23:30:21.000Z (almost 2 years ago)
- Last Synced: 2024-05-22T22:21:09.028Z (6 months ago)
- Language: JavaScript
- Size: 317 KB
- Stars: 56
- Watchers: 4
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome - glslify - Import GLSL strings with [glslify](https://github.com/glslify/glslify). (Plugins / Other File Imports)
README
# rollup-plugin-glslify
[![NPM Package][npm]][npm-url]
[![NPM Package][lgtm]][lgtm-url]Import GLSL strings with [glslify](https://github.com/glslify/glslify) (a node.js-style module system for GLSL).
```js
import frag from './shaders/frag.glsl';
console.log(frag);
```## Installation
```sh
npm i -D rollup-plugin-glslify# or
yarn add -D rollup-plugin-glslify
```## Usage
```js
// rollup.config.js
import glslify from 'rollup-plugin-glslify';export default {
// ...
plugins: [
glslify()
]
};
```## Options
```js
glslify(options)
``````js
{
// 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](https://github.com/glslify/glslify#var-src--glslcompilesrc-opts)
## Changelog
* [Releases](https://github.com/glslify/rollup-plugin-glslify/releases)
## License
[MIT](LICENSE)
[npm]: https://img.shields.io/npm/v/rollup-plugin-glslify.svg
[npm-url]: https://www.npmjs.com/package/rollup-plugin-glslify
[lgtm]: https://img.shields.io/lgtm/alerts/github/glslify/rollup-plugin-glslify.svg
[lgtm-url]: https://lgtm.com/projects/g/glslify/rollup-plugin-glslify