├── .eslintrc.js
├── .gitignore
├── .release-it.json
├── CHANGELOG.md
├── LICENSE
├── README.md
├── example
├── .gitignore
├── favicon.svg
├── index.html
├── package.json
├── pnpm-lock.yaml
├── src
│ ├── main.ts
│ ├── style.css
│ ├── test.frag
│ ├── test.vert
│ └── vite-env.d.ts
├── tsconfig.json
└── vite.config.js
├── package.json
├── pnpm-lock.yaml
├── src
├── files_compiler.ts
├── index.ts
├── literals_compiler.ts
└── types.ts
└── tsconfig.json
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | extends: [
3 | '@kuss/eslint-config-vanilla'
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | dist
3 | package-lock.json
4 | .DS_Store
--------------------------------------------------------------------------------
/.release-it.json:
--------------------------------------------------------------------------------
1 | {
2 | "git": {
3 | "commitMessage": "chore: release v${version}"
4 | },
5 | "github": {
6 | "release": true
7 | },
8 | "plugins": {
9 | "@release-it/conventional-changelog": {
10 | "infile": "CHANGELOG.md",
11 | "ignoreRecommendedBump": true,
12 | "parserOpts": {
13 | "headerPattern": "^(:\\w+:\\s+)?(\\w*)(?:\\(([\\w\\$\\.\\-\\* ]*)\\))?\\: (.*)$",
14 | "headerCorrespondence": [
15 | "gitmoji",
16 | "type",
17 | "scope",
18 | "subject"
19 | ]
20 | }
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | ## 2.2.1 (2025-02-12)
4 |
5 | * Fix Vite peerDeps broken ([a623d05](https://github.com/KusStar/vite-plugin-glslify/commit/a623d05)), closes [#14](https://github.com/KusStar/vite-plugin-glslify/issues/14)
6 |
7 | ## 2.2.0 (2025-01-14)
8 |
9 | * chores: lockfile and peer version ([a60ebaa](https://github.com/KusStar/vite-plugin-glslify/commit/a60ebaa))
10 | * fix: package exports field ([55c798b](https://github.com/KusStar/vite-plugin-glslify/commit/55c798b))
11 | * docs: Update README.md Usage ([8d22009](https://github.com/KusStar/vite-plugin-glslify/commit/8d22009))
12 |
13 | ## 2.1.0 (2024-04-18)
14 |
15 | * chores: package description ([8e9ae8b](https://github.com/KusStar/vite-plugin-glslify/commit/8e9ae8b))
16 | * chore: bump vite dependency (example) to latest (5.2.9) ([25163f8](https://github.com/KusStar/vite-plugin-glslify/commit/25163f8))
17 | * chore: bump vite dependency (peer & dev) to latest (5.2.9) ([c391bca](https://github.com/KusStar/vite-plugin-glslify/commit/c391bca))
18 | * chore: update scripts to be prefixed with pnpm ([d0924a8](https://github.com/KusStar/vite-plugin-glslify/commit/d0924a8))
19 | * fix: add missing dep estree-walker@2.0.2 ([e888135](https://github.com/KusStar/vite-plugin-glslify/commit/e888135))
20 |
21 | ## 2.0.2 (2023-07-04)
22 |
23 | * chores: bump devDeps ([ad151bc](https://github.com/KusStar/vite-plugin-glslify/commit/ad151bc))
24 | * chores: bump example deps ([849838a](https://github.com/KusStar/vite-plugin-glslify/commit/849838a))
25 | * Fix/changelog (#7) ([be4d8cb](https://github.com/KusStar/vite-plugin-glslify/commit/be4d8cb)), closes [#7](https://github.com/KusStar/vite-plugin-glslify/issues/7)
26 | * fixed semvar, run lint, updated version to beta.2 ([d989481](https://github.com/KusStar/vite-plugin-glslify/commit/d989481))
27 |
28 | ## 2.0.2-beta.1 (2021-12-01)
29 |
30 | * chore: update release-it ([ca7870c](https://github.com/KusStar/vite-plugin-glslify/commit/ca7870c))
31 |
32 |
33 |
34 | ## 2.0.2-beta.0 (2021-12-01)
35 |
36 | * chore: fix release-it changelog ([9e428dc](https://github.com/KusStar/vite-plugin-glslify/commit/9e428dc))
37 | * chore: release v2.0.2-beta.0 ([aea349d](https://github.com/KusStar/vite-plugin-glslify/commit/aea349d))
38 |
39 |
40 |
41 | ## 2.0.1 (2021-12-01)
42 |
43 | * chore: ignore package-lock.json ([7b8f969](https://github.com/KusStar/vite-plugin-glslify/commit/7b8f969))
44 | * chore: release v2.0.1 ([d8afc30](https://github.com/KusStar/vite-plugin-glslify/commit/d8afc30))
45 | * doc: update README.md ([2accc6c](https://github.com/KusStar/vite-plugin-glslify/commit/2accc6c))
46 |
47 |
48 |
49 | ## 2.0.0 (2021-11-29)
50 |
51 | * chore: release v2.0.0 ([dc15295](https://github.com/KusStar/vite-plugin-glslify/commit/dc15295))
52 | * docs: README.md use exported glslify ([bf493fc](https://github.com/KusStar/vite-plugin-glslify/commit/bf493fc))
53 | * BREAKING CHANGE: use conventional export name ([efea810](https://github.com/KusStar/vite-plugin-glslify/commit/efea810))
54 |
55 |
56 |
57 | ## 1.5.0 (2021-11-29)
58 |
59 | * chore: release v1.5.0 ([1d04285](https://github.com/KusStar/vite-plugin-glslify/commit/1d04285))
60 | * feat: custom glslify options ([dc28e90](https://github.com/KusStar/vite-plugin-glslify/commit/dc28e90))
61 |
62 |
63 |
64 | ## 1.4.2 (2021-11-29)
65 |
66 | * :rotating_light: chore: lint warnings ([13505de](https://github.com/KusStar/vite-plugin-glslify/commit/13505de))
67 | * chore: release v1.4.2 ([b146b6a](https://github.com/KusStar/vite-plugin-glslify/commit/b146b6a))
68 | * fix: specify basedir for relative imports ([2d0b019](https://github.com/KusStar/vite-plugin-glslify/commit/2d0b019))
69 |
70 |
71 |
72 | ## 1.4.1 (2021-11-22)
73 |
74 | * chore: release v1.4.1 ([7c59ac6](https://github.com/KusStar/vite-plugin-glslify/commit/7c59ac6))
75 | * :heavy_plus_sign: add: @release-it/conventional-changelog ([d9dcf3f](https://github.com/KusStar/vite-plugin-glslify/commit/d9dcf3f))
76 | * :wrench: config: .release-it.json ([620053e](https://github.com/KusStar/vite-plugin-glslify/commit/620053e))
77 | * :pencil2: typo: transformLiterals comments ([c137987](https://github.com/KusStar/vite-plugin-glslify/commit/c137987))
78 | * :bug: fix: literals_compiler -> replaceAll to replace, compat to lower than Node.js 15.x ([45c27ca](https://github.com/KusStar/vite-plugin-glslify/commit/45c27ca))
79 |
80 |
81 |
82 | ## 1.4.0 (2021-11-21)
83 |
84 | * Release 1.4.0 ([f2aafe3](https://github.com/KusStar/vite-plugin-glslify/commit/f2aafe3))
85 | * :memo: doc: update README.md ([f52f14e](https://github.com/KusStar/vite-plugin-glslify/commit/f52f14e))
86 | * :recycle: refactor: example ([7e94a87](https://github.com/KusStar/vite-plugin-glslify/commit/7e94a87))
87 | * :recycle: refactor: integrate with files and literals compiler ([cc91bb8](https://github.com/KusStar/vite-plugin-glslify/commit/cc91bb8))
88 | * :sparkles: feat: add files_compiler for compile file with specific extensions ([35cd3d4](https://github.com/KusStar/vite-plugin-glslify/commit/35cd3d4))
89 | * :truck: move: literalsCompiler to src/literals_compiler.ts ([ec2b960](https://github.com/KusStar/vite-plugin-glslify/commit/ec2b960))
90 |
91 |
92 |
93 | ## 1.3.0 (2021-11-20)
94 |
95 | * Release 1.3.0 ([949cd59](https://github.com/KusStar/vite-plugin-glslify/commit/949cd59))
96 | * :goal_net: catch: glslify compile error ([d0beffd](https://github.com/KusStar/vite-plugin-glslify/commit/d0beffd))
97 |
98 |
99 |
100 | ## 1.2.0 (2021-11-20)
101 |
102 | * Release 1.2.0 ([7133b90](https://github.com/KusStar/vite-plugin-glslify/commit/7133b90))
103 | * :bento: add: basic transform example ([660eb92](https://github.com/KusStar/vite-plugin-glslify/commit/660eb92))
104 | * :bug: fix: transform crash when quasi.expressions.length > 0, use astring to generate ([88b3e0a](https://github.com/KusStar/vite-plugin-glslify/commit/88b3e0a))
105 |
106 |
107 |
108 | ## 1.1.0 (2021-11-16)
109 |
110 | * Release 1.1.0 ([b9cb986](https://github.com/KusStar/vite-plugin-glslify/commit/b9cb986))
111 | * :bug: fix: magic-string as dependency instead of devDependency ([4a6d56c](https://github.com/KusStar/vite-plugin-glslify/commit/4a6d56c))
112 | * :wrench: config: build before release ([54ed003](https://github.com/KusStar/vite-plugin-glslify/commit/54ed003))
113 |
114 |
115 |
116 | ## 1.0.2 (2021-11-15)
117 |
118 | * Release 1.0.2 ([9f0daeb](https://github.com/KusStar/vite-plugin-glslify/commit/9f0daeb))
119 | * :bulb: update: interface Options comment ([7ae517d](https://github.com/KusStar/vite-plugin-glslify/commit/7ae517d))
120 | * :memo: update: README.md ([2c72875](https://github.com/KusStar/vite-plugin-glslify/commit/2c72875))
121 |
122 |
123 |
124 | ## 1.0.1 (2021-11-15)
125 |
126 | * :tada: initial ([ab84282](https://github.com/KusStar/vite-plugin-glslify/commit/ab84282))
127 | * Release 1.0.1 ([7095013](https://github.com/KusStar/vite-plugin-glslify/commit/7095013))
128 | * :rotating_light: lint: only for src ([b797d5e](https://github.com/KusStar/vite-plugin-glslify/commit/b797d5e))
129 | * :memo: doc: README.md ([c07ce05](https://github.com/KusStar/vite-plugin-glslify/commit/c07ce05))
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019-present KusStar
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # vite-plugin-glslify
2 |
3 | > A plugin for Vite to compile [glslify](https://github.com/glslify/glslify) shader code
4 |
5 | ## Usage
6 |
7 | Install
8 |
9 | ```cmd
10 | $ yarn add --D vite-plugin-glslify
11 | # or npm i -D vite-plugin-glslify
12 | ```
13 |
14 | Add it to `vite.config.*`
15 |
16 | ```js
17 | // vite.config.js
18 | import { glslify } from 'vite-plugin-glslify'
19 |
20 | export default {
21 | plugins: [
22 | glslify()
23 | ],
24 | }
25 | ```
26 |
27 | That's it, now it will compile your glslify shader code.
28 |
29 | It will transpile **glsl\`...\`** or **glsl(\`...\`)**.
30 |
31 | Other details, see [glslify](https://github.com/glslify/glslify).
32 |
33 | ## Example
34 |
35 |
36 | ```js
37 | const frag = glsl`
38 | #pragma glslify: ease = require('glsl-easings/sine-in')
39 | precision mediump float;
40 |
41 | varying vec3 vpos;
42 | void main () {
43 | gl_FragColor = vec4(ease(vpos*25.0),1);
44 | }
45 | `
46 | ```
47 |
48 | Will be transpiled to
49 |
50 | ```js
51 | const frag = `
52 | #ifndef HALF_PI
53 | #define HALF_PI 1.5707963267948966
54 | #endif
55 |
56 | float sineIn(float t) {
57 | return sin((t - 1.0) * HALF_PI) + 1.0;
58 | }
59 |
60 | precision mediump float;
61 |
62 | varying vec3 vpos;
63 | void main () {
64 | gl_FragColor = vec4(ease(vpos*25.0),1);
65 | }
66 | `
67 | ```
68 |
69 | Or you can import files with extensions like `*.glsl`, `*.vert`, `*.frag`, see [example](./example).
70 |
71 | ## Interfaces
72 |
73 | ```ts
74 | /**
75 | * A valid `minimatch` pattern, or array of patterns.
76 | */
77 | export type FilterPattern = ReadonlyArray | string | RegExp | null;
78 |
79 | import { Plugin } from 'vite';
80 | import { FilterPattern } from '@rollup/pluginutils';
81 |
82 | declare type GlslifyTransform = (filename: string, src: string, options: Options, done: (error: any, src: string) => void) => string;
83 | interface GlslifyOptions {
84 | transforms?: (GlslifyTransform | string | [
85 | GlslifyTransform | string,
86 | any
87 | ])[];
88 | }
89 | interface Options {
90 | /**
91 | * included files or folder, defaults to [/\.ts$/, /\.js$/]
92 | */
93 | include?: FilterPattern;
94 | /**
95 | * excluded files or folder, defaults to ['node_modules/**']
96 | */
97 | exclude?: FilterPattern;
98 | /**
99 | * should transform literals with literalsCompiler, defaults to true
100 | */
101 | transformLiterals?: boolean;
102 | /**
103 | * function calling that should be compiled, defaults to [/glsl/]
104 | */
105 | funcName?: FilterPattern;
106 | /**
107 | * should transform files with filesCompiler, defaults to true
108 | */
109 | transformFiles?: boolean;
110 | /**
111 | * extensions of files that should be compiled, defaults to [/\.vert$/, /\.frag$/, /\.glsl$/]
112 | */
113 | extensions?: FilterPattern;
114 | /**
115 | * options passed to glslify
116 | */
117 | options?: GlslifyOptions;
118 | }
119 |
120 | declare const DEFAULT_EXTENSIONS: RegExp[];
121 | declare function glslify(options?: Options): Plugin[];
122 |
123 | export { DEFAULT_EXTENSIONS, glslify as default, glslify };
124 | ```
125 |
126 | ## LICENSE
127 |
128 | [MIT](./LICENSE)
129 |
--------------------------------------------------------------------------------
/example/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | dist-ssr
5 | *.local
--------------------------------------------------------------------------------
/example/favicon.svg:
--------------------------------------------------------------------------------
1 |
16 |
--------------------------------------------------------------------------------
/example/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Vite App
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/example/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "example",
3 | "version": "0.0.0",
4 | "scripts": {
5 | "dev": "vite",
6 | "build": "tsc && vite build",
7 | "serve": "vite preview"
8 | },
9 | "devDependencies": {
10 | "typescript": "^5.1.6",
11 | "vite": "^5.2.9"
12 | },
13 | "dependencies": {
14 | "glsl-easings": "^1.0.0",
15 | "glsl-noise": "^0.0.0",
16 | "glsl-rotate": "^1.1.0",
17 | "glslify": "^7.1.1"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/example/pnpm-lock.yaml:
--------------------------------------------------------------------------------
1 | lockfileVersion: '6.0'
2 |
3 | settings:
4 | autoInstallPeers: true
5 | excludeLinksFromLockfile: false
6 |
7 | dependencies:
8 | glsl-easings:
9 | specifier: ^1.0.0
10 | version: 1.0.0
11 | glsl-noise:
12 | specifier: ^0.0.0
13 | version: 0.0.0
14 | glsl-rotate:
15 | specifier: ^1.1.0
16 | version: 1.1.0
17 | glslify:
18 | specifier: ^7.1.1
19 | version: 7.1.1
20 |
21 | devDependencies:
22 | typescript:
23 | specifier: ^5.1.6
24 | version: 5.1.6
25 | vite:
26 | specifier: ^5.2.9
27 | version: 5.2.9
28 |
29 | packages:
30 |
31 | /@choojs/findup@0.2.1:
32 | resolution: {integrity: sha512-YstAqNb0MCN8PjdLCDfRsBcGVRN41f3vgLvaI0IrIcBp4AqILRSS0DeWNGkicC+f/zRIPJLc+9RURVSepwvfBw==}
33 | hasBin: true
34 | dependencies:
35 | commander: 2.20.3
36 | dev: false
37 |
38 | /@esbuild/aix-ppc64@0.20.2:
39 | resolution: {integrity: sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==}
40 | engines: {node: '>=12'}
41 | cpu: [ppc64]
42 | os: [aix]
43 | requiresBuild: true
44 | dev: true
45 | optional: true
46 |
47 | /@esbuild/android-arm64@0.20.2:
48 | resolution: {integrity: sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==}
49 | engines: {node: '>=12'}
50 | cpu: [arm64]
51 | os: [android]
52 | requiresBuild: true
53 | dev: true
54 | optional: true
55 |
56 | /@esbuild/android-arm@0.20.2:
57 | resolution: {integrity: sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==}
58 | engines: {node: '>=12'}
59 | cpu: [arm]
60 | os: [android]
61 | requiresBuild: true
62 | dev: true
63 | optional: true
64 |
65 | /@esbuild/android-x64@0.20.2:
66 | resolution: {integrity: sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==}
67 | engines: {node: '>=12'}
68 | cpu: [x64]
69 | os: [android]
70 | requiresBuild: true
71 | dev: true
72 | optional: true
73 |
74 | /@esbuild/darwin-arm64@0.20.2:
75 | resolution: {integrity: sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==}
76 | engines: {node: '>=12'}
77 | cpu: [arm64]
78 | os: [darwin]
79 | requiresBuild: true
80 | dev: true
81 | optional: true
82 |
83 | /@esbuild/darwin-x64@0.20.2:
84 | resolution: {integrity: sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==}
85 | engines: {node: '>=12'}
86 | cpu: [x64]
87 | os: [darwin]
88 | requiresBuild: true
89 | dev: true
90 | optional: true
91 |
92 | /@esbuild/freebsd-arm64@0.20.2:
93 | resolution: {integrity: sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==}
94 | engines: {node: '>=12'}
95 | cpu: [arm64]
96 | os: [freebsd]
97 | requiresBuild: true
98 | dev: true
99 | optional: true
100 |
101 | /@esbuild/freebsd-x64@0.20.2:
102 | resolution: {integrity: sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==}
103 | engines: {node: '>=12'}
104 | cpu: [x64]
105 | os: [freebsd]
106 | requiresBuild: true
107 | dev: true
108 | optional: true
109 |
110 | /@esbuild/linux-arm64@0.20.2:
111 | resolution: {integrity: sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==}
112 | engines: {node: '>=12'}
113 | cpu: [arm64]
114 | os: [linux]
115 | requiresBuild: true
116 | dev: true
117 | optional: true
118 |
119 | /@esbuild/linux-arm@0.20.2:
120 | resolution: {integrity: sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==}
121 | engines: {node: '>=12'}
122 | cpu: [arm]
123 | os: [linux]
124 | requiresBuild: true
125 | dev: true
126 | optional: true
127 |
128 | /@esbuild/linux-ia32@0.20.2:
129 | resolution: {integrity: sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==}
130 | engines: {node: '>=12'}
131 | cpu: [ia32]
132 | os: [linux]
133 | requiresBuild: true
134 | dev: true
135 | optional: true
136 |
137 | /@esbuild/linux-loong64@0.20.2:
138 | resolution: {integrity: sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==}
139 | engines: {node: '>=12'}
140 | cpu: [loong64]
141 | os: [linux]
142 | requiresBuild: true
143 | dev: true
144 | optional: true
145 |
146 | /@esbuild/linux-mips64el@0.20.2:
147 | resolution: {integrity: sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==}
148 | engines: {node: '>=12'}
149 | cpu: [mips64el]
150 | os: [linux]
151 | requiresBuild: true
152 | dev: true
153 | optional: true
154 |
155 | /@esbuild/linux-ppc64@0.20.2:
156 | resolution: {integrity: sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==}
157 | engines: {node: '>=12'}
158 | cpu: [ppc64]
159 | os: [linux]
160 | requiresBuild: true
161 | dev: true
162 | optional: true
163 |
164 | /@esbuild/linux-riscv64@0.20.2:
165 | resolution: {integrity: sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==}
166 | engines: {node: '>=12'}
167 | cpu: [riscv64]
168 | os: [linux]
169 | requiresBuild: true
170 | dev: true
171 | optional: true
172 |
173 | /@esbuild/linux-s390x@0.20.2:
174 | resolution: {integrity: sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==}
175 | engines: {node: '>=12'}
176 | cpu: [s390x]
177 | os: [linux]
178 | requiresBuild: true
179 | dev: true
180 | optional: true
181 |
182 | /@esbuild/linux-x64@0.20.2:
183 | resolution: {integrity: sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==}
184 | engines: {node: '>=12'}
185 | cpu: [x64]
186 | os: [linux]
187 | requiresBuild: true
188 | dev: true
189 | optional: true
190 |
191 | /@esbuild/netbsd-x64@0.20.2:
192 | resolution: {integrity: sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==}
193 | engines: {node: '>=12'}
194 | cpu: [x64]
195 | os: [netbsd]
196 | requiresBuild: true
197 | dev: true
198 | optional: true
199 |
200 | /@esbuild/openbsd-x64@0.20.2:
201 | resolution: {integrity: sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==}
202 | engines: {node: '>=12'}
203 | cpu: [x64]
204 | os: [openbsd]
205 | requiresBuild: true
206 | dev: true
207 | optional: true
208 |
209 | /@esbuild/sunos-x64@0.20.2:
210 | resolution: {integrity: sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==}
211 | engines: {node: '>=12'}
212 | cpu: [x64]
213 | os: [sunos]
214 | requiresBuild: true
215 | dev: true
216 | optional: true
217 |
218 | /@esbuild/win32-arm64@0.20.2:
219 | resolution: {integrity: sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==}
220 | engines: {node: '>=12'}
221 | cpu: [arm64]
222 | os: [win32]
223 | requiresBuild: true
224 | dev: true
225 | optional: true
226 |
227 | /@esbuild/win32-ia32@0.20.2:
228 | resolution: {integrity: sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==}
229 | engines: {node: '>=12'}
230 | cpu: [ia32]
231 | os: [win32]
232 | requiresBuild: true
233 | dev: true
234 | optional: true
235 |
236 | /@esbuild/win32-x64@0.20.2:
237 | resolution: {integrity: sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==}
238 | engines: {node: '>=12'}
239 | cpu: [x64]
240 | os: [win32]
241 | requiresBuild: true
242 | dev: true
243 | optional: true
244 |
245 | /@rollup/rollup-android-arm-eabi@4.14.3:
246 | resolution: {integrity: sha512-X9alQ3XM6I9IlSlmC8ddAvMSyG1WuHk5oUnXGw+yUBs3BFoTizmG1La/Gr8fVJvDWAq+zlYTZ9DBgrlKRVY06g==}
247 | cpu: [arm]
248 | os: [android]
249 | requiresBuild: true
250 | dev: true
251 | optional: true
252 |
253 | /@rollup/rollup-android-arm64@4.14.3:
254 | resolution: {integrity: sha512-eQK5JIi+POhFpzk+LnjKIy4Ks+pwJ+NXmPxOCSvOKSNRPONzKuUvWE+P9JxGZVxrtzm6BAYMaL50FFuPe0oWMQ==}
255 | cpu: [arm64]
256 | os: [android]
257 | requiresBuild: true
258 | dev: true
259 | optional: true
260 |
261 | /@rollup/rollup-darwin-arm64@4.14.3:
262 | resolution: {integrity: sha512-Od4vE6f6CTT53yM1jgcLqNfItTsLt5zE46fdPaEmeFHvPs5SjZYlLpHrSiHEKR1+HdRfxuzXHjDOIxQyC3ptBA==}
263 | cpu: [arm64]
264 | os: [darwin]
265 | requiresBuild: true
266 | dev: true
267 | optional: true
268 |
269 | /@rollup/rollup-darwin-x64@4.14.3:
270 | resolution: {integrity: sha512-0IMAO21axJeNIrvS9lSe/PGthc8ZUS+zC53O0VhF5gMxfmcKAP4ESkKOCwEi6u2asUrt4mQv2rjY8QseIEb1aw==}
271 | cpu: [x64]
272 | os: [darwin]
273 | requiresBuild: true
274 | dev: true
275 | optional: true
276 |
277 | /@rollup/rollup-linux-arm-gnueabihf@4.14.3:
278 | resolution: {integrity: sha512-ge2DC7tHRHa3caVEoSbPRJpq7azhG+xYsd6u2MEnJ6XzPSzQsTKyXvh6iWjXRf7Rt9ykIUWHtl0Uz3T6yXPpKw==}
279 | cpu: [arm]
280 | os: [linux]
281 | requiresBuild: true
282 | dev: true
283 | optional: true
284 |
285 | /@rollup/rollup-linux-arm-musleabihf@4.14.3:
286 | resolution: {integrity: sha512-ljcuiDI4V3ySuc7eSk4lQ9wU8J8r8KrOUvB2U+TtK0TiW6OFDmJ+DdIjjwZHIw9CNxzbmXY39wwpzYuFDwNXuw==}
287 | cpu: [arm]
288 | os: [linux]
289 | requiresBuild: true
290 | dev: true
291 | optional: true
292 |
293 | /@rollup/rollup-linux-arm64-gnu@4.14.3:
294 | resolution: {integrity: sha512-Eci2us9VTHm1eSyn5/eEpaC7eP/mp5n46gTRB3Aar3BgSvDQGJZuicyq6TsH4HngNBgVqC5sDYxOzTExSU+NjA==}
295 | cpu: [arm64]
296 | os: [linux]
297 | requiresBuild: true
298 | dev: true
299 | optional: true
300 |
301 | /@rollup/rollup-linux-arm64-musl@4.14.3:
302 | resolution: {integrity: sha512-UrBoMLCq4E92/LCqlh+blpqMz5h1tJttPIniwUgOFJyjWI1qrtrDhhpHPuFxULlUmjFHfloWdixtDhSxJt5iKw==}
303 | cpu: [arm64]
304 | os: [linux]
305 | requiresBuild: true
306 | dev: true
307 | optional: true
308 |
309 | /@rollup/rollup-linux-powerpc64le-gnu@4.14.3:
310 | resolution: {integrity: sha512-5aRjvsS8q1nWN8AoRfrq5+9IflC3P1leMoy4r2WjXyFqf3qcqsxRCfxtZIV58tCxd+Yv7WELPcO9mY9aeQyAmw==}
311 | cpu: [ppc64]
312 | os: [linux]
313 | requiresBuild: true
314 | dev: true
315 | optional: true
316 |
317 | /@rollup/rollup-linux-riscv64-gnu@4.14.3:
318 | resolution: {integrity: sha512-sk/Qh1j2/RJSX7FhEpJn8n0ndxy/uf0kI/9Zc4b1ELhqULVdTfN6HL31CDaTChiBAOgLcsJ1sgVZjWv8XNEsAQ==}
319 | cpu: [riscv64]
320 | os: [linux]
321 | requiresBuild: true
322 | dev: true
323 | optional: true
324 |
325 | /@rollup/rollup-linux-s390x-gnu@4.14.3:
326 | resolution: {integrity: sha512-jOO/PEaDitOmY9TgkxF/TQIjXySQe5KVYB57H/8LRP/ux0ZoO8cSHCX17asMSv3ruwslXW/TLBcxyaUzGRHcqg==}
327 | cpu: [s390x]
328 | os: [linux]
329 | requiresBuild: true
330 | dev: true
331 | optional: true
332 |
333 | /@rollup/rollup-linux-x64-gnu@4.14.3:
334 | resolution: {integrity: sha512-8ybV4Xjy59xLMyWo3GCfEGqtKV5M5gCSrZlxkPGvEPCGDLNla7v48S662HSGwRd6/2cSneMQWiv+QzcttLrrOA==}
335 | cpu: [x64]
336 | os: [linux]
337 | requiresBuild: true
338 | dev: true
339 | optional: true
340 |
341 | /@rollup/rollup-linux-x64-musl@4.14.3:
342 | resolution: {integrity: sha512-s+xf1I46trOY10OqAtZ5Rm6lzHre/UiLA1J2uOhCFXWkbZrJRkYBPO6FhvGfHmdtQ3Bx793MNa7LvoWFAm93bg==}
343 | cpu: [x64]
344 | os: [linux]
345 | requiresBuild: true
346 | dev: true
347 | optional: true
348 |
349 | /@rollup/rollup-win32-arm64-msvc@4.14.3:
350 | resolution: {integrity: sha512-+4h2WrGOYsOumDQ5S2sYNyhVfrue+9tc9XcLWLh+Kw3UOxAvrfOrSMFon60KspcDdytkNDh7K2Vs6eMaYImAZg==}
351 | cpu: [arm64]
352 | os: [win32]
353 | requiresBuild: true
354 | dev: true
355 | optional: true
356 |
357 | /@rollup/rollup-win32-ia32-msvc@4.14.3:
358 | resolution: {integrity: sha512-T1l7y/bCeL/kUwh9OD4PQT4aM7Bq43vX05htPJJ46RTI4r5KNt6qJRzAfNfM+OYMNEVBWQzR2Gyk+FXLZfogGw==}
359 | cpu: [ia32]
360 | os: [win32]
361 | requiresBuild: true
362 | dev: true
363 | optional: true
364 |
365 | /@rollup/rollup-win32-x64-msvc@4.14.3:
366 | resolution: {integrity: sha512-/BypzV0H1y1HzgYpxqRaXGBRqfodgoBBCcsrujT6QRcakDQdfU+Lq9PENPh5jB4I44YWq+0C2eHsHya+nZY1sA==}
367 | cpu: [x64]
368 | os: [win32]
369 | requiresBuild: true
370 | dev: true
371 | optional: true
372 |
373 | /@types/estree@1.0.5:
374 | resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==}
375 | dev: true
376 |
377 | /acorn@7.4.1:
378 | resolution: {integrity: sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==}
379 | engines: {node: '>=0.4.0'}
380 | hasBin: true
381 | dev: false
382 |
383 | /bl@2.2.1:
384 | resolution: {integrity: sha512-6Pesp1w0DEX1N550i/uGV/TqucVL4AM/pgThFSN/Qq9si1/DF9aIHs1BxD8V/QU0HoeHO6cQRTAuYnLPKq1e4g==}
385 | dependencies:
386 | readable-stream: 2.3.8
387 | safe-buffer: 5.2.1
388 | dev: false
389 |
390 | /buffer-from@1.1.2:
391 | resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==}
392 | dev: false
393 |
394 | /commander@2.20.3:
395 | resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==}
396 | dev: false
397 |
398 | /concat-stream@1.6.2:
399 | resolution: {integrity: sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==}
400 | engines: {'0': node >= 0.8}
401 | dependencies:
402 | buffer-from: 1.1.2
403 | inherits: 2.0.4
404 | readable-stream: 2.3.8
405 | typedarray: 0.0.6
406 | dev: false
407 |
408 | /core-util-is@1.0.3:
409 | resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==}
410 | dev: false
411 |
412 | /deep-is@0.1.4:
413 | resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==}
414 | dev: false
415 |
416 | /duplexify@3.7.1:
417 | resolution: {integrity: sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==}
418 | dependencies:
419 | end-of-stream: 1.4.4
420 | inherits: 2.0.4
421 | readable-stream: 2.3.8
422 | stream-shift: 1.0.1
423 | dev: false
424 |
425 | /end-of-stream@1.4.4:
426 | resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==}
427 | dependencies:
428 | once: 1.4.0
429 | dev: false
430 |
431 | /esbuild@0.20.2:
432 | resolution: {integrity: sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==}
433 | engines: {node: '>=12'}
434 | hasBin: true
435 | requiresBuild: true
436 | optionalDependencies:
437 | '@esbuild/aix-ppc64': 0.20.2
438 | '@esbuild/android-arm': 0.20.2
439 | '@esbuild/android-arm64': 0.20.2
440 | '@esbuild/android-x64': 0.20.2
441 | '@esbuild/darwin-arm64': 0.20.2
442 | '@esbuild/darwin-x64': 0.20.2
443 | '@esbuild/freebsd-arm64': 0.20.2
444 | '@esbuild/freebsd-x64': 0.20.2
445 | '@esbuild/linux-arm': 0.20.2
446 | '@esbuild/linux-arm64': 0.20.2
447 | '@esbuild/linux-ia32': 0.20.2
448 | '@esbuild/linux-loong64': 0.20.2
449 | '@esbuild/linux-mips64el': 0.20.2
450 | '@esbuild/linux-ppc64': 0.20.2
451 | '@esbuild/linux-riscv64': 0.20.2
452 | '@esbuild/linux-s390x': 0.20.2
453 | '@esbuild/linux-x64': 0.20.2
454 | '@esbuild/netbsd-x64': 0.20.2
455 | '@esbuild/openbsd-x64': 0.20.2
456 | '@esbuild/sunos-x64': 0.20.2
457 | '@esbuild/win32-arm64': 0.20.2
458 | '@esbuild/win32-ia32': 0.20.2
459 | '@esbuild/win32-x64': 0.20.2
460 | dev: true
461 |
462 | /escodegen@1.14.3:
463 | resolution: {integrity: sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==}
464 | engines: {node: '>=4.0'}
465 | hasBin: true
466 | dependencies:
467 | esprima: 4.0.1
468 | estraverse: 4.3.0
469 | esutils: 2.0.3
470 | optionator: 0.8.3
471 | optionalDependencies:
472 | source-map: 0.6.1
473 | dev: false
474 |
475 | /esprima@4.0.1:
476 | resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==}
477 | engines: {node: '>=4'}
478 | hasBin: true
479 | dev: false
480 |
481 | /estraverse@4.3.0:
482 | resolution: {integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==}
483 | engines: {node: '>=4.0'}
484 | dev: false
485 |
486 | /esutils@2.0.3:
487 | resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==}
488 | engines: {node: '>=0.10.0'}
489 | dev: false
490 |
491 | /events@3.3.0:
492 | resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==}
493 | engines: {node: '>=0.8.x'}
494 | dev: false
495 |
496 | /falafel@2.2.5:
497 | resolution: {integrity: sha512-HuC1qF9iTnHDnML9YZAdCDQwT0yKl/U55K4XSUXqGAA2GLoafFgWRqdAbhWJxXaYD4pyoVxAJ8wH670jMpI9DQ==}
498 | engines: {node: '>=0.4.0'}
499 | dependencies:
500 | acorn: 7.4.1
501 | isarray: 2.0.5
502 | dev: false
503 |
504 | /fast-levenshtein@2.0.6:
505 | resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==}
506 | dev: false
507 |
508 | /from2@2.3.0:
509 | resolution: {integrity: sha512-OMcX/4IC/uqEPVgGeyfN22LJk6AZrMkRZHxcHBMBvHScDGgwTm2GT2Wkgtocyd3JfZffjj2kYUDXXII0Fk9W0g==}
510 | dependencies:
511 | inherits: 2.0.4
512 | readable-stream: 2.3.8
513 | dev: false
514 |
515 | /fsevents@2.3.3:
516 | resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==}
517 | engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
518 | os: [darwin]
519 | requiresBuild: true
520 | dev: true
521 | optional: true
522 |
523 | /function-bind@1.1.1:
524 | resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==}
525 | dev: false
526 |
527 | /glsl-easings@1.0.0:
528 | resolution: {integrity: sha512-blfWMqztNRVI4sJNyPlA9uV4T7xIm//Ie6fGGtnQPs3FpCj5YOWt/QIVFRMWpsBQhehRRGoaKG2yDw6tkAlmeA==}
529 | dev: false
530 |
531 | /glsl-inject-defines@1.0.3:
532 | resolution: {integrity: sha512-W49jIhuDtF6w+7wCMcClk27a2hq8znvHtlGnrYkSWEr8tHe9eA2dcnohlcAmxLYBSpSSdzOkRdyPTrx9fw49+A==}
533 | dependencies:
534 | glsl-token-inject-block: 1.1.0
535 | glsl-token-string: 1.0.1
536 | glsl-tokenizer: 2.1.5
537 | dev: false
538 |
539 | /glsl-noise@0.0.0:
540 | resolution: {integrity: sha512-b/ZCF6amfAUb7dJM/MxRs7AetQEahYzJ8PtgfrmEdtw6uyGOr+ZSGtgjFm6mfsBkxJ4d2W7kg+Nlqzqvn3Bc0w==}
541 | dev: false
542 |
543 | /glsl-resolve@0.0.1:
544 | resolution: {integrity: sha512-xxFNsfnhZTK9NBhzJjSBGX6IOqYpvBHxxmo+4vapiljyGNCY0Bekzn0firQkQrazK59c1hYxMDxYS8MDlhw4gA==}
545 | dependencies:
546 | resolve: 0.6.3
547 | xtend: 2.2.0
548 | dev: false
549 |
550 | /glsl-rotate@1.1.0:
551 | resolution: {integrity: sha512-Le3yzQU0TsZTYvVTeEIMtGIU8iTAG3hogOUwww8ajDLODfT02LQXFpfUlphZB2nT1/P/saaMHLB30aT7xBuExQ==}
552 | dev: false
553 |
554 | /glsl-token-assignments@2.0.2:
555 | resolution: {integrity: sha512-OwXrxixCyHzzA0U2g4btSNAyB2Dx8XrztY5aVUCjRSh4/D0WoJn8Qdps7Xub3sz6zE73W3szLrmWtQ7QMpeHEQ==}
556 | dev: false
557 |
558 | /glsl-token-defines@1.0.0:
559 | resolution: {integrity: sha512-Vb5QMVeLjmOwvvOJuPNg3vnRlffscq2/qvIuTpMzuO/7s5kT+63iL6Dfo2FYLWbzuiycWpbC0/KV0biqFwHxaQ==}
560 | dependencies:
561 | glsl-tokenizer: 2.1.5
562 | dev: false
563 |
564 | /glsl-token-depth@1.1.2:
565 | resolution: {integrity: sha512-eQnIBLc7vFf8axF9aoi/xW37LSWd2hCQr/3sZui8aBJnksq9C7zMeUYHVJWMhFzXrBU7fgIqni4EhXVW4/krpg==}
566 | dev: false
567 |
568 | /glsl-token-descope@1.0.2:
569 | resolution: {integrity: sha512-kS2PTWkvi/YOeicVjXGgX5j7+8N7e56srNDEHDTVZ1dcESmbmpmgrnpjPcjxJjMxh56mSXYoFdZqb90gXkGjQw==}
570 | dependencies:
571 | glsl-token-assignments: 2.0.2
572 | glsl-token-depth: 1.1.2
573 | glsl-token-properties: 1.0.1
574 | glsl-token-scope: 1.1.2
575 | dev: false
576 |
577 | /glsl-token-inject-block@1.1.0:
578 | resolution: {integrity: sha512-q/m+ukdUBuHCOtLhSr0uFb/qYQr4/oKrPSdIK2C4TD+qLaJvqM9wfXIF/OOBjuSA3pUoYHurVRNao6LTVVUPWA==}
579 | dev: false
580 |
581 | /glsl-token-properties@1.0.1:
582 | resolution: {integrity: sha512-dSeW1cOIzbuUoYH0y+nxzwK9S9O3wsjttkq5ij9ZGw0OS41BirKJzzH48VLm8qLg+au6b0sINxGC0IrGwtQUcA==}
583 | dev: false
584 |
585 | /glsl-token-scope@1.1.2:
586 | resolution: {integrity: sha512-YKyOMk1B/tz9BwYUdfDoHvMIYTGtVv2vbDSLh94PT4+f87z21FVdou1KNKgF+nECBTo0fJ20dpm0B1vZB1Q03A==}
587 | dev: false
588 |
589 | /glsl-token-string@1.0.1:
590 | resolution: {integrity: sha512-1mtQ47Uxd47wrovl+T6RshKGkRRCYWhnELmkEcUAPALWGTFe2XZpH3r45XAwL2B6v+l0KNsCnoaZCSnhzKEksg==}
591 | dev: false
592 |
593 | /glsl-token-whitespace-trim@1.0.0:
594 | resolution: {integrity: sha512-ZJtsPut/aDaUdLUNtmBYhaCmhIjpKNg7IgZSfX5wFReMc2vnj8zok+gB/3Quqs0TsBSX/fGnqUUYZDqyuc2xLQ==}
595 | dev: false
596 |
597 | /glsl-tokenizer@2.1.5:
598 | resolution: {integrity: sha512-XSZEJ/i4dmz3Pmbnpsy3cKh7cotvFlBiZnDOwnj/05EwNp2XrhQ4XKJxT7/pDt4kp4YcpRSKz8eTV7S+mwV6MA==}
599 | dependencies:
600 | through2: 0.6.5
601 | dev: false
602 |
603 | /glslify-bundle@5.1.1:
604 | resolution: {integrity: sha512-plaAOQPv62M1r3OsWf2UbjN0hUYAB7Aph5bfH58VxJZJhloRNbxOL9tl/7H71K7OLJoSJ2ZqWOKk3ttQ6wy24A==}
605 | dependencies:
606 | glsl-inject-defines: 1.0.3
607 | glsl-token-defines: 1.0.0
608 | glsl-token-depth: 1.1.2
609 | glsl-token-descope: 1.0.2
610 | glsl-token-scope: 1.1.2
611 | glsl-token-string: 1.0.1
612 | glsl-token-whitespace-trim: 1.0.0
613 | glsl-tokenizer: 2.1.5
614 | murmurhash-js: 1.0.0
615 | shallow-copy: 0.0.1
616 | dev: false
617 |
618 | /glslify-deps@1.3.2:
619 | resolution: {integrity: sha512-7S7IkHWygJRjcawveXQjRXLO2FTjijPDYC7QfZyAQanY+yGLCFHYnPtsGT9bdyHiwPTw/5a1m1M9hamT2aBpag==}
620 | dependencies:
621 | '@choojs/findup': 0.2.1
622 | events: 3.3.0
623 | glsl-resolve: 0.0.1
624 | glsl-tokenizer: 2.1.5
625 | graceful-fs: 4.2.11
626 | inherits: 2.0.4
627 | map-limit: 0.0.1
628 | resolve: 1.22.2
629 | dev: false
630 |
631 | /glslify@7.1.1:
632 | resolution: {integrity: sha512-bud98CJ6kGZcP9Yxcsi7Iz647wuDz3oN+IZsjCRi5X1PI7t/xPKeL0mOwXJjo+CRZMqvq0CkSJiywCcY7kVYog==}
633 | hasBin: true
634 | dependencies:
635 | bl: 2.2.1
636 | concat-stream: 1.6.2
637 | duplexify: 3.7.1
638 | falafel: 2.2.5
639 | from2: 2.3.0
640 | glsl-resolve: 0.0.1
641 | glsl-token-whitespace-trim: 1.0.0
642 | glslify-bundle: 5.1.1
643 | glslify-deps: 1.3.2
644 | minimist: 1.2.8
645 | resolve: 1.22.2
646 | stack-trace: 0.0.9
647 | static-eval: 2.1.0
648 | through2: 2.0.5
649 | xtend: 4.0.2
650 | dev: false
651 |
652 | /graceful-fs@4.2.11:
653 | resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==}
654 | dev: false
655 |
656 | /has@1.0.3:
657 | resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==}
658 | engines: {node: '>= 0.4.0'}
659 | dependencies:
660 | function-bind: 1.1.1
661 | dev: false
662 |
663 | /inherits@2.0.4:
664 | resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==}
665 | dev: false
666 |
667 | /is-core-module@2.12.1:
668 | resolution: {integrity: sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==}
669 | dependencies:
670 | has: 1.0.3
671 | dev: false
672 |
673 | /isarray@0.0.1:
674 | resolution: {integrity: sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==}
675 | dev: false
676 |
677 | /isarray@1.0.0:
678 | resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==}
679 | dev: false
680 |
681 | /isarray@2.0.5:
682 | resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==}
683 | dev: false
684 |
685 | /levn@0.3.0:
686 | resolution: {integrity: sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==}
687 | engines: {node: '>= 0.8.0'}
688 | dependencies:
689 | prelude-ls: 1.1.2
690 | type-check: 0.3.2
691 | dev: false
692 |
693 | /map-limit@0.0.1:
694 | resolution: {integrity: sha512-pJpcfLPnIF/Sk3taPW21G/RQsEEirGaFpCW3oXRwH9dnFHPHNGjNyvh++rdmC2fNqEaTw2MhYJraoJWAHx8kEg==}
695 | dependencies:
696 | once: 1.3.3
697 | dev: false
698 |
699 | /minimist@1.2.8:
700 | resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==}
701 | dev: false
702 |
703 | /murmurhash-js@1.0.0:
704 | resolution: {integrity: sha512-TvmkNhkv8yct0SVBSy+o8wYzXjE4Zz3PCesbfs8HiCXXdcTuocApFv11UWlNFWKYsP2okqrhb7JNlSm9InBhIw==}
705 | dev: false
706 |
707 | /nanoid@3.3.7:
708 | resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==}
709 | engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
710 | hasBin: true
711 | dev: true
712 |
713 | /once@1.3.3:
714 | resolution: {integrity: sha512-6vaNInhu+CHxtONf3zw3vq4SP2DOQhjBvIa3rNcG0+P7eKWlYH6Peu7rHizSloRU2EwMz6GraLieis9Ac9+p1w==}
715 | dependencies:
716 | wrappy: 1.0.2
717 | dev: false
718 |
719 | /once@1.4.0:
720 | resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==}
721 | dependencies:
722 | wrappy: 1.0.2
723 | dev: false
724 |
725 | /optionator@0.8.3:
726 | resolution: {integrity: sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==}
727 | engines: {node: '>= 0.8.0'}
728 | dependencies:
729 | deep-is: 0.1.4
730 | fast-levenshtein: 2.0.6
731 | levn: 0.3.0
732 | prelude-ls: 1.1.2
733 | type-check: 0.3.2
734 | word-wrap: 1.2.3
735 | dev: false
736 |
737 | /path-parse@1.0.7:
738 | resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==}
739 | dev: false
740 |
741 | /picocolors@1.0.0:
742 | resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==}
743 | dev: true
744 |
745 | /postcss@8.4.38:
746 | resolution: {integrity: sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==}
747 | engines: {node: ^10 || ^12 || >=14}
748 | dependencies:
749 | nanoid: 3.3.7
750 | picocolors: 1.0.0
751 | source-map-js: 1.2.0
752 | dev: true
753 |
754 | /prelude-ls@1.1.2:
755 | resolution: {integrity: sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==}
756 | engines: {node: '>= 0.8.0'}
757 | dev: false
758 |
759 | /process-nextick-args@2.0.1:
760 | resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==}
761 | dev: false
762 |
763 | /readable-stream@1.0.34:
764 | resolution: {integrity: sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==}
765 | dependencies:
766 | core-util-is: 1.0.3
767 | inherits: 2.0.4
768 | isarray: 0.0.1
769 | string_decoder: 0.10.31
770 | dev: false
771 |
772 | /readable-stream@2.3.8:
773 | resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==}
774 | dependencies:
775 | core-util-is: 1.0.3
776 | inherits: 2.0.4
777 | isarray: 1.0.0
778 | process-nextick-args: 2.0.1
779 | safe-buffer: 5.1.2
780 | string_decoder: 1.1.1
781 | util-deprecate: 1.0.2
782 | dev: false
783 |
784 | /resolve@0.6.3:
785 | resolution: {integrity: sha512-UHBY3viPlJKf85YijDUcikKX6tmF4SokIDp518ZDVT92JNDcG5uKIthaT/owt3Sar0lwtOafsQuwrg22/v2Dwg==}
786 | dev: false
787 |
788 | /resolve@1.22.2:
789 | resolution: {integrity: sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==}
790 | hasBin: true
791 | dependencies:
792 | is-core-module: 2.12.1
793 | path-parse: 1.0.7
794 | supports-preserve-symlinks-flag: 1.0.0
795 | dev: false
796 |
797 | /rollup@4.14.3:
798 | resolution: {integrity: sha512-ag5tTQKYsj1bhrFC9+OEWqb5O6VYgtQDO9hPDBMmIbePwhfSr+ExlcU741t8Dhw5DkPCQf6noz0jb36D6W9/hw==}
799 | engines: {node: '>=18.0.0', npm: '>=8.0.0'}
800 | hasBin: true
801 | dependencies:
802 | '@types/estree': 1.0.5
803 | optionalDependencies:
804 | '@rollup/rollup-android-arm-eabi': 4.14.3
805 | '@rollup/rollup-android-arm64': 4.14.3
806 | '@rollup/rollup-darwin-arm64': 4.14.3
807 | '@rollup/rollup-darwin-x64': 4.14.3
808 | '@rollup/rollup-linux-arm-gnueabihf': 4.14.3
809 | '@rollup/rollup-linux-arm-musleabihf': 4.14.3
810 | '@rollup/rollup-linux-arm64-gnu': 4.14.3
811 | '@rollup/rollup-linux-arm64-musl': 4.14.3
812 | '@rollup/rollup-linux-powerpc64le-gnu': 4.14.3
813 | '@rollup/rollup-linux-riscv64-gnu': 4.14.3
814 | '@rollup/rollup-linux-s390x-gnu': 4.14.3
815 | '@rollup/rollup-linux-x64-gnu': 4.14.3
816 | '@rollup/rollup-linux-x64-musl': 4.14.3
817 | '@rollup/rollup-win32-arm64-msvc': 4.14.3
818 | '@rollup/rollup-win32-ia32-msvc': 4.14.3
819 | '@rollup/rollup-win32-x64-msvc': 4.14.3
820 | fsevents: 2.3.3
821 | dev: true
822 |
823 | /safe-buffer@5.1.2:
824 | resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==}
825 | dev: false
826 |
827 | /safe-buffer@5.2.1:
828 | resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==}
829 | dev: false
830 |
831 | /shallow-copy@0.0.1:
832 | resolution: {integrity: sha512-b6i4ZpVuUxB9h5gfCxPiusKYkqTMOjEbBs4wMaFbkfia4yFv92UKZ6Df8WXcKbn08JNL/abvg3FnMAOfakDvUw==}
833 | dev: false
834 |
835 | /source-map-js@1.2.0:
836 | resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==}
837 | engines: {node: '>=0.10.0'}
838 | dev: true
839 |
840 | /source-map@0.6.1:
841 | resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==}
842 | engines: {node: '>=0.10.0'}
843 | requiresBuild: true
844 | dev: false
845 | optional: true
846 |
847 | /stack-trace@0.0.9:
848 | resolution: {integrity: sha512-vjUc6sfgtgY0dxCdnc40mK6Oftjo9+2K8H/NG81TMhgL392FtiPA9tn9RLyTxXmTLPJPjF3VyzFp6bsWFLisMQ==}
849 | dev: false
850 |
851 | /static-eval@2.1.0:
852 | resolution: {integrity: sha512-agtxZ/kWSsCkI5E4QifRwsaPs0P0JmZV6dkLz6ILYfFYQGn+5plctanRN+IC8dJRiFkyXHrwEE3W9Wmx67uDbw==}
853 | dependencies:
854 | escodegen: 1.14.3
855 | dev: false
856 |
857 | /stream-shift@1.0.1:
858 | resolution: {integrity: sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==}
859 | dev: false
860 |
861 | /string_decoder@0.10.31:
862 | resolution: {integrity: sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==}
863 | dev: false
864 |
865 | /string_decoder@1.1.1:
866 | resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==}
867 | dependencies:
868 | safe-buffer: 5.1.2
869 | dev: false
870 |
871 | /supports-preserve-symlinks-flag@1.0.0:
872 | resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==}
873 | engines: {node: '>= 0.4'}
874 | dev: false
875 |
876 | /through2@0.6.5:
877 | resolution: {integrity: sha512-RkK/CCESdTKQZHdmKICijdKKsCRVHs5KsLZ6pACAmF/1GPUQhonHSXWNERctxEp7RmvjdNbZTL5z9V7nSCXKcg==}
878 | dependencies:
879 | readable-stream: 1.0.34
880 | xtend: 4.0.2
881 | dev: false
882 |
883 | /through2@2.0.5:
884 | resolution: {integrity: sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==}
885 | dependencies:
886 | readable-stream: 2.3.8
887 | xtend: 4.0.2
888 | dev: false
889 |
890 | /type-check@0.3.2:
891 | resolution: {integrity: sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==}
892 | engines: {node: '>= 0.8.0'}
893 | dependencies:
894 | prelude-ls: 1.1.2
895 | dev: false
896 |
897 | /typedarray@0.0.6:
898 | resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==}
899 | dev: false
900 |
901 | /typescript@5.1.6:
902 | resolution: {integrity: sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==}
903 | engines: {node: '>=14.17'}
904 | hasBin: true
905 | dev: true
906 |
907 | /util-deprecate@1.0.2:
908 | resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
909 | dev: false
910 |
911 | /vite@5.2.9:
912 | resolution: {integrity: sha512-uOQWfuZBlc6Y3W/DTuQ1Sr+oIXWvqljLvS881SVmAj00d5RdgShLcuXWxseWPd4HXwiYBFW/vXHfKFeqj9uQnw==}
913 | engines: {node: ^18.0.0 || >=20.0.0}
914 | hasBin: true
915 | peerDependencies:
916 | '@types/node': ^18.0.0 || >=20.0.0
917 | less: '*'
918 | lightningcss: ^1.21.0
919 | sass: '*'
920 | stylus: '*'
921 | sugarss: '*'
922 | terser: ^5.4.0
923 | peerDependenciesMeta:
924 | '@types/node':
925 | optional: true
926 | less:
927 | optional: true
928 | lightningcss:
929 | optional: true
930 | sass:
931 | optional: true
932 | stylus:
933 | optional: true
934 | sugarss:
935 | optional: true
936 | terser:
937 | optional: true
938 | dependencies:
939 | esbuild: 0.20.2
940 | postcss: 8.4.38
941 | rollup: 4.14.3
942 | optionalDependencies:
943 | fsevents: 2.3.3
944 | dev: true
945 |
946 | /word-wrap@1.2.3:
947 | resolution: {integrity: sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==}
948 | engines: {node: '>=0.10.0'}
949 | dev: false
950 |
951 | /wrappy@1.0.2:
952 | resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
953 | dev: false
954 |
955 | /xtend@2.2.0:
956 | resolution: {integrity: sha512-SLt5uylT+4aoXxXuwtQp5ZnMMzhDb1Xkg4pEqc00WUJCQifPfV9Ub1VrNhp9kXkrjZD2I2Hl8WnjP37jzZLPZw==}
957 | engines: {node: '>=0.4'}
958 | dev: false
959 |
960 | /xtend@4.0.2:
961 | resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==}
962 | engines: {node: '>=0.4'}
963 | dev: false
964 |
--------------------------------------------------------------------------------
/example/src/main.ts:
--------------------------------------------------------------------------------
1 | import './style.css'
2 |
3 | import testFrag from './test.frag'
4 | import testVert from './test.vert'
5 |
6 | console.log(testVert, testFrag)
7 |
8 | // any function wrapped by `glsl` will be transpiled to a string at build time
9 | const glsl = (..._args: any[]) => ''
10 |
11 | const vert = glsl`
12 | varying vec2 vUv;
13 | varying float vDistort;
14 |
15 | uniform float uTime;
16 | uniform float uSpeed;
17 | uniform float uNoiseStrength;
18 | uniform float uNoiseDensity;
19 | uniform float uFreq;
20 | uniform float uAmp;
21 | uniform float uOffset;
22 |
23 | #pragma glslify: noise = require(glsl-noise/classic/3d)
24 | #pragma glslify: pnoise = require(glsl-noise/periodic/3d)
25 | #pragma glslify: rotateY = require(glsl-rotate/rotateY)
26 |
27 | float map(float value, float inMin, float inMax, float outMin, float outMax) {
28 | return outMin + (outMax - outMin) * (value - inMin) / (inMax - inMin);
29 | }
30 |
31 | void main() {
32 | vUv = uv;
33 |
34 | float t = uTime * uSpeed;
35 | float distortion = pnoise((normal + t) * uNoiseDensity, vec3(10.0)) * uNoiseStrength;
36 |
37 | vec3 pos = position + (normal * distortion);
38 | float angle = sin(uv.y * uFreq + t) * uAmp;
39 | pos = rotateY(pos, angle);
40 |
41 | pos *= map(sin(uTime + uOffset), -1.0, 1.0, 1.0, 1.2);
42 |
43 | vDistort = distortion;
44 |
45 | gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.);
46 | }
47 | `
48 |
49 | const frag = glsl`
50 | varying vec2 vUv;
51 | varying float vDistort;
52 |
53 | uniform float uTime;
54 | uniform float uHue;
55 | uniform float uAlpha;
56 |
57 | vec3 cosPalette(float t, vec3 a, vec3 b, vec3 c, vec3 d) {
58 | return a + b * cos(6.28318 * (c * t + d));
59 | }
60 |
61 | void main() {
62 | float distort = vDistort * 2.0;
63 |
64 | vec3 brightness = vec3(0.5, 0.5, 0.5);
65 | vec3 contrast = vec3(0.5, 0.5, 0.5);
66 | vec3 oscilation = vec3(1.0, 1.0, 1.0);
67 | vec3 phase = vec3(0.0, 0.1, 0.2);
68 |
69 | vec3 color = cosPalette(uHue + distort, brightness, contrast, oscilation, phase);
70 |
71 | gl_FragColor = vec4(color, uAlpha);
72 | }
73 | `
74 |
75 | console.log(frag, vert)
76 |
77 | const app = document.querySelector('#app')!
78 |
79 | const main = () => {
80 | const glslTagged = glsl`
81 | #pragma glslify: ease = require('glsl-easings/sine-in')
82 | precision highp float;
83 |
84 | varying vec3 vpos;
85 | void main () {
86 | gl_FragColor = vec4(ease(vpos*25.0),1);
87 | }
88 | `
89 |
90 | const glslCalled = glsl(`
91 | #pragma glslify: ease = require('glsl-easings/sine-in')
92 | precision highp float;
93 |
94 | varying vec3 vpos;
95 | void main () {
96 | gl_FragColor = vec4(ease(vpos*25.0),1);
97 | }
98 | `)
99 |
100 | console.log(glslTagged, glslCalled)
101 | }
102 |
103 | main()
104 |
105 | app.innerHTML = `
106 | Hello Vite!
107 | Documentation
108 | `
109 |
--------------------------------------------------------------------------------
/example/src/style.css:
--------------------------------------------------------------------------------
1 | #app {
2 | font-family: Avenir, Helvetica, Arial, sans-serif;
3 | -webkit-font-smoothing: antialiased;
4 | -moz-osx-font-smoothing: grayscale;
5 | text-align: center;
6 | color: #2c3e50;
7 | margin-top: 60px;
8 | }
9 |
--------------------------------------------------------------------------------
/example/src/test.frag:
--------------------------------------------------------------------------------
1 | precision highp float;
2 |
3 | #pragma glslify: noise = require(glsl-noise/classic/3d)
4 | #pragma glslify: pnoise = require(glsl-noise/periodic/3d)
5 | #pragma glslify: rotateY = require(glsl-rotate/rotateY)
6 |
7 | void main() {
8 | gl_FragColor = vec4(vec3(0.5), 1.0);
9 | }
--------------------------------------------------------------------------------
/example/src/test.vert:
--------------------------------------------------------------------------------
1 | precision highp float;
2 |
3 | attribute vec3 position;
4 |
5 | void main() { gl_Position = vec4(position, 1.0); }
--------------------------------------------------------------------------------
/example/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
3 | declare module '*.frag' {
4 | const content: string
5 | export default content
6 | }
7 |
8 | declare module '*.vert' {
9 | const content: string
10 | export default content
11 | }
12 |
--------------------------------------------------------------------------------
/example/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ESNext",
4 | "useDefineForClassFields": true,
5 | "module": "ESNext",
6 | "lib": ["ESNext", "DOM"],
7 | "moduleResolution": "Node",
8 | "strict": true,
9 | "sourceMap": true,
10 | "resolveJsonModule": true,
11 | "esModuleInterop": true,
12 | "noEmit": true,
13 | "noUnusedLocals": true,
14 | "noUnusedParameters": true,
15 | "noImplicitReturns": true
16 | },
17 | "include": ["./src"]
18 | }
19 |
--------------------------------------------------------------------------------
/example/vite.config.js:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'vite'
2 |
3 | import glslCompiler from '../src/index'
4 |
5 | export default defineConfig({
6 | plugins: [
7 | glslCompiler()
8 | ]
9 | })
10 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "vite-plugin-glslify",
3 | "version": "2.2.1",
4 | "description": "A plugin for Vite to compile glslify shader code",
5 | "main": "dist/index.js",
6 | "module": "dist/index.mjs",
7 | "types": "dist/index.d.ts",
8 | "exports": {
9 | ".": {
10 | "require": "./dist/index.js",
11 | "import": "./dist/index.mjs",
12 | "types": "./dist/index.d.ts"
13 | }
14 | },
15 | "author": "KusStar",
16 | "license": "MIT",
17 | "scripts": {
18 | "start": "pnpm run build -- --watch",
19 | "build": "tsup src/index.ts --dts --format cjs,esm",
20 | "prepublishOnly": "pnpm run build",
21 | "lint": "eslint --ext .ts ./src",
22 | "lint:fix": "pnpm run lint -- --fix",
23 | "release": "pnpm run lint && pnpm run build && release-it"
24 | },
25 | "files": [
26 | "dist"
27 | ],
28 | "peerDependencies": {
29 | "vite": "^5.2.9"
30 | },
31 | "dependencies": {
32 | "@rollup/pluginutils": "^4.1.1",
33 | "astring": "^1.7.5",
34 | "estree-walker": "^2.0.2",
35 | "glslify": "^7.1.1",
36 | "magic-string": "^0.25.7"
37 | },
38 | "devDependencies": {
39 | "@kuss/eslint-config-vanilla": "^2.6.1",
40 | "@release-it/conventional-changelog": "^5.1.1",
41 | "eslint": "^8.44.0",
42 | "release-it": "^15.11.0",
43 | "tsup": "^7.1.0",
44 | "typescript": "^5.1.6",
45 | "vite": "^5.2.9"
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/files_compiler.ts:
--------------------------------------------------------------------------------
1 | import { compile } from 'glslify'
2 | import path from 'path'
3 | import { Plugin } from 'vite'
4 |
5 | import type { Filter, GlslifyOptions } from './types'
6 |
7 | export function filesCompiler(
8 | extFilter: Filter,
9 | options: GlslifyOptions
10 | ): Plugin {
11 | return {
12 | name: 'vite-plugin-glslify:files',
13 | transform(code, id) {
14 | if (extFilter(id)) {
15 | return {
16 | code: `export default \`${compile(code, {
17 | ...options,
18 | basedir: path.dirname(id),
19 | })}\``,
20 | }
21 | }
22 | return null
23 | },
24 | handleHotUpdate(ctx) {
25 | if (!extFilter(ctx.file)) return
26 | const defaultRead = ctx.read
27 | ctx.read = async () => {
28 | return compile(await defaultRead(), {
29 | ...options,
30 | basedir: path.dirname(ctx.file),
31 | })
32 | }
33 | },
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/index.ts:
--------------------------------------------------------------------------------
1 | import { createFilter } from '@rollup/pluginutils'
2 | import { Plugin } from 'vite'
3 |
4 | import { filesCompiler } from './files_compiler'
5 | import { literalsCompiler } from './literals_compiler'
6 | import { Options } from './types'
7 |
8 | export const DEFAULT_EXTENSIONS = [/\.vert$/, /\.frag$/, /\.glsl$/]
9 |
10 | export function glslify(options: Options = {}) {
11 | const plugins: Plugin[] = []
12 | const transformFiles = options.transformFiles ?? true
13 | const transformLiterals = options.transformLiterals ?? true
14 | const glslifyOptions = options.options ?? {}
15 |
16 | if (transformFiles) {
17 | const extFilter = createFilter(options.extensions || DEFAULT_EXTENSIONS)
18 | plugins.push(filesCompiler(extFilter, glslifyOptions))
19 | }
20 |
21 | if (transformLiterals) {
22 | const idFilter = createFilter(
23 | options.include || [/\.ts$/, /\.js$/],
24 | options.exclude || ['node_modules/**']
25 | )
26 | const funcFilter = createFilter(options.funcName || [/glsl/])
27 |
28 | plugins.push(literalsCompiler(idFilter, funcFilter, glslifyOptions))
29 | }
30 |
31 | return plugins
32 | }
33 |
34 | export default glslify
35 |
--------------------------------------------------------------------------------
/src/literals_compiler.ts:
--------------------------------------------------------------------------------
1 | import { generate } from 'astring'
2 | import { walk } from 'estree-walker'
3 | import { compile } from 'glslify'
4 | import MagicString from 'magic-string'
5 | import path from 'path'
6 | import { Plugin } from 'vite'
7 |
8 | import type { Filter, GlslifyOptions } from './types'
9 |
10 | export function literalsCompiler(
11 | idFilter: Filter,
12 | funcFilter: Filter,
13 | options: GlslifyOptions
14 | ): Plugin {
15 | return {
16 | name: 'vite-plugin-glslify:literals',
17 | transform(code, id) {
18 | if (!idFilter(id)) return undefined
19 | if (funcFilter(code)) {
20 | const ast = this.parse(code)
21 | const s = new MagicString(code)
22 |
23 | const compileAndOverwrite = (node: any, start: number, end: number) => {
24 | const target = generate(node)
25 | try {
26 | const compiled = compile(target.replace(/`/g, ''), {
27 | ...options,
28 | basedir: path.dirname(id),
29 | })
30 | s.overwrite(start, end, `\`${compiled}\``)
31 | } catch (e) {
32 | this.error(e.message)
33 | }
34 | }
35 |
36 | walk(ast, {
37 | enter(node) {
38 | if (!node.type) {
39 | return
40 | }
41 | if (node?.type === 'TaggedTemplateExpression') {
42 | if (funcFilter(node.tag.name)) {
43 | const { start, end } = node
44 | compileAndOverwrite(node.quasi, start, end)
45 | }
46 | } else if (node?.type === 'CallExpression') {
47 | if (funcFilter(node.callee.name)) {
48 | const { start, end } = node
49 | compileAndOverwrite(node.arguments[0], start, end)
50 | }
51 | }
52 | },
53 | })
54 |
55 | return {
56 | code: s.toString(),
57 | }
58 | }
59 | return undefined
60 | },
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/src/types.ts:
--------------------------------------------------------------------------------
1 | import { createFilter, FilterPattern } from '@rollup/pluginutils'
2 |
3 | export type Filter = ReturnType
4 |
5 | export type GlslifyTransform = (
6 | filename: string,
7 | src: string,
8 | options: Options,
9 | done: (error: any, src: string) => void
10 | ) => string
11 |
12 | export interface GlslifyOptions {
13 | transforms?: (GlslifyTransform | string | [GlslifyTransform | string, any])[]
14 | }
15 |
16 | export interface Options {
17 | /**
18 | * included files or folder, defaults to [/\.ts$/, /\.js$/]
19 | */
20 | include?: FilterPattern
21 | /**
22 | * excluded files or folder, defaults to ['node_modules/**']
23 | */
24 | exclude?: FilterPattern
25 | /**
26 | * should transform literals with literalsCompiler, defaults to true
27 | */
28 | transformLiterals?: boolean
29 | /**
30 | * function calling that should be compiled, defaults to [/glsl/]
31 | */
32 | funcName?: FilterPattern
33 | /**
34 | * should transform files with filesCompiler, defaults to true
35 | */
36 | transformFiles?: boolean
37 | /**
38 | * extensions of files that should be compiled, defaults to [/\.vert$/, /\.frag$/, /\.glsl$/]
39 | */
40 | extensions?: FilterPattern
41 | /**
42 | * options passed to glslify
43 | */
44 | options?: GlslifyOptions
45 | }
46 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ESNext",
4 | "module": "ESNext",
5 | "moduleResolution": "Node",
6 | "strict": false,
7 | "sourceMap": true,
8 | "resolveJsonModule": true,
9 | "esModuleInterop": true,
10 | "noEmit": true,
11 | "noUnusedLocals": false,
12 | "noUnusedParameters": true,
13 | "noImplicitReturns": true,
14 | "baseUrl": "./",
15 | "skipLibCheck": true,
16 | },
17 | "include": ["./src"],
18 | }
19 |
--------------------------------------------------------------------------------