Diorama

Made for a big screen.

This site is one 3D scene, built for a computer: a wide window and a mouse. Open dioramajs.dev on a desktop or a laptop to see it.This site is one 3D scene, built for a wide window. Make this one wider, or open dioramajs.dev on a larger screen.

GitHub

DioramaDocs

@dioramajs/diorama/vite

Vite plugin that turns the effects folder into a lazy registry with types.

View as Markdown
On this page
import { braces, CODE, declarations } from '@dioramajs/diorama/vite'

Functions

bracesLines of a braced block. An empty one is `{}` on the opening line, as Biome and Prettier print it, so formatting a generated file for an empty folder leaves it as written.
declarationsTypes that check effect names in `attach('.x', 'name')` and `data-dio`.
dioramaVite plugin, `plugins: [diorama()]`.
effectName`HeroGlow` and `hero_glow` both become `hero-glow`.
keyAn object key, bare when possible.
quoteA single-quoted string literal, in the generated files' style.
registryLazy imports with what is known before load. Shaders through @dioramajs/glsl's `?effect`.
scanThe folder's effects, one per code file (not `*.d.ts`, not `_private`) and per fragment shader without a code file of the same name. Sorted by name. Bad or repeated names are skipped.
shaderTypeA shader's effect type, from the params of its bindings.

Constants

CODEExtensions of effect modules in the folder.
SHADERExtension of a fragment shader effect.

Interfaces

DioramaPluginOptionsOptions of the build plugins.
FoundAn effect file found in the folder.