# @askrjs/vite

> Published API exports for @askrjs/vite.

Source: [https://askrjs.com/docs/reference/api/vite/root](https://askrjs.com/docs/reference/api/vite/root)

Status: stable. Packages: @askrjs/vite.

**Published packages are authoritative.** Examples may lag behind a published contract. When guidance differs, verify the exports and TypeScript declarations in your installed package, then file an issue.

## Exports

This entrypoint publishes 5 exports from the declarations shipped by @askrjs/vite.

### `askr`

```ts
askrVitePlugin: (options?: AskrVitePluginOptions) => AskrVitePlugin
```

Create the Askr Vite plugin, which transforms Askr JSX/TSX with oxc, wires
up dependency pre-bundling and aliasing for `@askrjs/askr`, and optionally
runs the responsive image pipeline and template optimizer.
JSX transform failures are reported through the active Vite/Rollup plugin
context with the source file and original transform detail.

### `askrVitePlugin`

```ts
askrVitePlugin: (options?: AskrVitePluginOptions) => AskrVitePlugin
```

Create the Askr Vite plugin, which transforms Askr JSX/TSX with oxc, wires
up dependency pre-bundling and aliasing for `@askrjs/askr`, and optionally
runs the responsive image pipeline and template optimizer.
JSX transform failures are reported through the active Vite/Rollup plugin
context with the source file and original transform detail.

### `AskrVitePlugin`

```ts
AskrVitePlugin: any
```

Portable public plugin identity.

Vite-compatible runners only require the plugin name. Keeping versioned Vite
hook types out of the installed declaration prevents consumers such as
vite-plus from comparing two distinct copies of Vite's recursive Plugin type.

- `name`: readonly name: "askr:vite";

### `AskrVitePluginOptions`

```ts
AskrVitePluginOptions: any
```

Options accepted by {@link askrVitePlugin}.

- `transformJsx`: Transform `.jsx`/`.tsx` files with the Askr JSX runtime. Defaults to `true`.

- `optimizeTemplates`: Hoist repeated JSX class/style literals using parsed compiled output. Defaults to `false`.

- `ssrPrecompile`: ssrPrecompile?: boolean;

- `images`: Opt into declared responsive image transforms.

### `ImagePipelineOptions`

```ts
ImagePipelineOptions: any
```

Plugin-level defaults applied to every `image()` declaration.

- `widths`: widths?: readonly number[];

- `formats`: formats?: readonly ImageOutputFormat[];

- `quality`: quality?: ImageQualityOptions;

## Documentation navigation

[Previous](https://askrjs.com/docs/reference/api/ui/tooltip/index.md) | [Next](https://askrjs.com/docs/reference/api/vite/server/index.md)
