# WithViteConfig

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

Configures the Vite app to use the specified Vite configuration file instead of the default resolution behavior.

## Remarks

Use this method to specify a specific Vite configuration file if you need to override the default Vite configuration resolution behavior.

## Definition

```go
func (ViteAppResource) WithViteConfig(configPath string) ViteAppResource
```

## Parameters

- `configPath` (`string`) -- The path to the Vite configuration file. Relative to the Vite service project root.

## Returns

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

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

## Applies to

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