Configuration

Configuration

Overview

Tuono can be configured using the tuono.config.ts file, which allows you to customize various aspects of the build process and development environment.

The config file is written in TypeScript, so you can take advantage of type checking and auto-suggestions provided by the TuonoConfig type, which is exported from tuono/config.

import type { TuonoConfig } from 'tuono/config'

const config: TuonoConfig = {
  /* typesafe config */
}

export default config

vite

Tuono leverages Vite, a modern and fast build tool and development server for web applications.

As a result, some Vite configuration properties can be set in the tuono.config.ts file under the vite property.

vite.alias

Useful for configuring custom source alias paths during imports

  • Type:
    • Record<string, string>
    • Array<{ find: string | RegExp, replacement: string, customResolver?: ResolverFunction | ResolverObject }>
  • Vite documentation: resolve.alias

vite.css

Config object for managing CSS behavior and integration with preprocessors (e.g., Sass, Less, etc.)

vite.optimizeDeps

Vite's dependency optimizer used only during dev

vite.plugins

Useful for extending vite's functionality

server

The following options configure the server.

server.host

  • Type: string
  • Default: 'localhost'

The hostname or IP address of the server. It can be a domain name (e.g., "example.com") or an IP address (e.g., "127.0.0.1")

server.port

  • Type: number
  • Default: 3000

The port number where the server will listen for incoming requests.

Edit page