# LoaderContext

interface in `@dioramajs/glsl/loader`

```ts
import type { LoaderContext } from '@dioramajs/glsl/loader'
```

The subset of webpack's loader context we use. Turbopack implements it too.

```ts
interface LoaderContext<O>
```

## Members

| Name | Type | Description |
| --- | --- | --- |
| `resourcePath` | `string` | Path of the file. |
| `resourceQuery` | `string` | 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](https://github.com/MasterKurosava/diorama/blob/main/packages/glsl/src/loader.ts#L19).
