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: array — Default: []

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: string — Default: '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: string — Default: '/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: string — Default: 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: string — Default: 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';

The plugin writes this file inside Vite's build.outDir, so you only need to change this if you've customised build.outDir. See Using a custom output directory.


$forceMode

Type: ?string — Default: 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.


Using a custom output directory

Your settings in vite.config.js take priority over the plugin's defaults. To build somewhere other than public/build, set build.outDir and base together:

export default defineConfig({
    base: '/assets/',
    build: {
        outDir: 'public/assets',
    },
    plugins: [
        codeigniter({
            input: ['resources/js/app.js'],
        }),
    ],
})

The plugin can't tell PHP about these values, so update app/Config/Kindling.php to match:

public string $buildPath    = '/assets';
public string $manifestPath = FCPATH . 'assets/.vite/manifest.json';
public string $sentinelPath = FCPATH . 'assets/.vite-dev-running';

If these values don't match:

Mismatch What happens
base Production pages load, but images and fonts referenced from CSS and lazy-loaded chunks return 404 because their URLs still point at /build/.
$buildPath Production script and stylesheet tags return 404.
$manifestPath kindling can't find the build, so it throws an exception or fails to resolve your entries.
$sentinelPath kindling doesn't detect the dev server. It throws an exception, or serves your last production build if a manifest exists.

base only applies to production builds. The plugin always uses / for the dev server, because kindling requests dev assets from the root of $devServerUrl.