Skip to content

Configuration

kindling ships with sensible defaults that work for a standard CI4 project layout. Override any of them by extending the base config class in your app.

Creating your app config

kindling:install generates this file for you, but here's what it looks like:

<?php

declare(strict_types=1);

namespace Config;

use Myth\Kindling\Config\Kindling as KindlingConfig;

class Kindling extends KindlingConfig
{
    public array $entryPoints = [
        'app' => 'resources/js/app.js',
    ];
}

Place this at app/Config/Kindling.php. CI4 discovers it automatically — no registration needed.

Reference

$entryPoints

Type: arrayDefault: []

Maps friendly names to source file paths (relative to your project root). This is the most important setting.

public array $entryPoints = [
    'app'   => 'resources/js/app.js',
    'admin' => 'resources/js/admin.js',
];

Names on the left are what you pass to vite_tags(). Paths on the right must match the input array in vite.config.js. Keep them in sync.


$devServerUrl

Type: stringDefault: 'http://localhost:5173'

The URL of the Vite dev server. Override this if you've changed Vite's default port, or if you're running inside Docker and need to reach the dev server at a different address.

public string $devServerUrl = 'http://localhost:5174';

Docker users

If your CI4 app runs inside a Docker container, localhost refers to the container, not your host machine. You may need to point this at your host's gateway IP or use a Docker service name.


$buildPath

Type: stringDefault: '/build'

The web-accessible path to your production build directory. This is prepended to every file path emitted in production mode.

public string $buildPath = '/build';

Keep this in sync with build.outDir in vite.config.js. The default Vite config generated by kindling:install outputs to public/build, which is served as /build.


$manifestPath

Type: stringDefault: FCPATH . 'build/.vite/manifest.json'

Absolute path to the Vite manifest file on disk. kindling reads this in production mode to resolve entry point names to hashed filenames.

public string $manifestPath = FCPATH . 'build/.vite/manifest.json';

You'd only change this if you've customised build.outDir in vite.config.js to point somewhere other than public/build.


$sentinelPath

Type: stringDefault: FCPATH . 'build/.vite-dev-running'

Absolute path to the sentinel file the Vite plugin writes when the dev server starts. kindling uses this file's existence to decide whether it's in dev mode.

public string $sentinelPath = FCPATH . 'build/.vite-dev-running';

You should rarely need to change this.


$forceMode

Type: ?stringDefault: null

Forces kindling into a specific mode, bypassing sentinel file detection entirely. Accepts 'dev', 'prod', or null (auto-detect).

// Always use the dev server, even if the sentinel file is missing
public ?string $forceMode = 'dev';

// Always use the built manifest, even during local development
public ?string $forceMode = 'prod';

This is useful for:

  • Testing production builds locally — set 'prod' after running npm run build
  • CI environments — force 'prod' so tests don't accidentally require a running dev server
  • Debugging — temporarily lock the mode to isolate a problem

Tip

Leave $forceMode as null in production. The sentinel file won't exist on your server, so kindling falls through to manifest mode automatically.