# AddViteApp

- Module: [Aspire.Hosting.JavaScript](/reference/api/go/aspire.hosting.javascript.md)
- Version: `17.0.0`
- Kind: `method`
- Defined on: `DistributedApplicationBuilder`
- Source: [GitHub](https://github.com/microsoft/aspire/tree/bcfa151cdca6d0a573f22d5d9c23f9c727cb3b2f)

Adds a Vite app to the distributed application builder.

## Remarks

The following example creates a Vite app using npm as the package manager.
```
var builder = DistributedApplication.CreateBuilder(args);
builder.AddViteApp("frontend", "./frontend");
builder.Build().Run();
```

## Definition

```go
func (DistributedApplicationBuilder) AddViteApp(
    name string,
    appDirectory string,
    options ...*AddViteAppOptions,
) ViteAppResource
```

## Parameters

- `name` (`string`) -- The name of the Vite app.
- `appDirectory` (`string`) -- The path to the directory containing the Vite app.
- `options` (`...*AddViteAppOptions`) -- optional settings, see [Options](#options)

## Options

Optional parameters are passed in a trailing `options ...*AddViteAppOptions` argument.

- `RunScriptName` (`*string`) -- The name of the script that runs the Vite app. Defaults to "dev".

## Returns

[`ViteAppResource`](/reference/api/go/aspire.hosting.javascript/viteappresource.md) -- The resource builder.

Returns a handle; failures surface later via `Err()`.

## Applies to

- `DistributedApplicationBuilder`
