import Issues from '../../getting-started/issues.md';
import RuntimeInCapabilities from '../_runtime-in-capabilities.md';

# Configuration

Platformatic Nuxt is configured through a configuration file. It supports environment variables as setting values with [configuration placeholders](#configuration-placeholders).

## `application`

Supported object properties:

- **`basePath`**: Service proxy base path when exposing this application in a [gateway](../gateway/configuration.md) with the `proxy` property. If not specified, the application is exposed on `/$ID` (where `$ID` is the application ID), or on a value specified in application code via `platformatic.setBasePath()`.
- **`outputDirectory`**: Subdirectory where the production build is stored when using `wattpm build` or `plt build`.
- **`include`**: Paths to include when deploying the application.
- **`commands`**: Object specifying commands to manage the application instead of Nuxt defaults:
  - **`install`**: Command to install application dependencies. Default: `npm ci --omit-dev`.
  - **`build`**: Command to build the application.
  - **`development`**: Command to start the application in development mode.
  - **`production`**: Command to start the application in production mode.
- **`changeDirectoryBeforeExecution`**: If `true`, change the current working directory to the application root before running any of the commands above. Default: `false`.
- **`preferLocalCommands`**: If `true`, resolve non-absolute commands from the application's `node_modules/.bin` before checking the current working directory. Default: `true`.

## `nuxt`

Configures Nuxt-specific Platformatic behavior.

Supported object properties:

- **`outputDirectory`**: Directory containing the Nuxt/Nitro production output. Default: `.output`.

:::note
Platformatic Nuxt uses `nuxt.outputDirectory` to locate the Nitro server output generated by `nuxt build`. The standard Nuxt server entrypoint is `server/index.mjs` inside this directory.
:::

## `vite`

Configures Vite options used by the Nuxt development server. Platformatic Nuxt supports the same `vite` configuration object documented in [Platformatic Vite](../vite/configuration.md#vite).

This is useful for development server settings such as allowing mesh-network hostnames:

```json
{
  "vite": {
    "devServer": {
      "strict": false
    }
  }
}
```

For Nuxt's own Vite options, use `nuxt.config` as usual:

```js
export default defineNuxtConfig({
  vite: {
    server: {
      allowedHosts: ['.plt.local']
    }
  }
})
```

## `logger`

Configures the `logger`. See [runtime logger](../runtime/configuration.md#logger).

## `server`

Configures the HTTP server. See [runtime server](../runtime/configuration.md#server).

## `watch`

Manages watching of the application. See [application watch](../service/configuration.md#watch).

<RuntimeInCapabilities />

<Issues />
