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

LoaderContext interface

The subset of webpack's loader context we use.

View as Markdown
import type { LoaderContext } from '@dioramajs/glsl/loader'

Turbopack implements it too.

interface LoaderContext<O>

Members

NameTypeDescription
readonly resourcePathstring

Path of the file.

readonly resourceQuerystring

Query of the import.

addDependency
addDependency(file: string): void

Watches a file.

async
async(): (error: Error | null, code?: string) => void

Makes the loader async and returns its callback.

emitWarning
emitWarning(warning: Error): void

Reports a warning.

getOptions
getOptions(): O

Loader options.

getResolve?
getResolve(
  options?: object,
): (context: string, request: string) => Promise<string>

Returns a resolver with the bundler's rules.

Defined in packages/glsl/src/loader.ts.