https://github.com/actnwit/esbuild-plugin-shaderity
https://github.com/actnwit/esbuild-plugin-shaderity
Last synced: 8 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/actnwit/esbuild-plugin-shaderity
- Owner: actnwit
- License: mit
- Created: 2022-04-09T10:26:51.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-05-08T08:42:06.000Z (about 1 year ago)
- Last Synced: 2025-08-24T08:11:51.506Z (10 months ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# esbuild-plugin-shaderity
## What's this?
A ESBuild plugin for [shaderity](https://github.com/actnwit/shaderity), which is a web-oriented shader utility.
## Config
Write a node program file as following:
```javascript
// build.js
const esbuild = require('esbuild');
const shaderity = require('esbuild-plugin-shaderity');
esbuild.build({
entryPoints: ['./src/index.js'],
bundle: true,
outdir: 'dist',
plugins: [
shaderity(),
]
});
```
## Code Sample
```glsl
// simple.frag
precision mediump float;
in vec4 vColor;
void main() {
gl_FlagColor = vColor;
}
```
```javascript
// ./src/index.js
import simpleFragmentShader from './simple.frag';
console.log(simpleFragmentShader);
```
## Build
Run the written build.js with node.
```bash
$ node build.js
```
The built file must be output to the ./dist directory.