myth/kindling

A first-class Vite asset pipeline for CodeIgniter 4, with optional Tailwind CSS, Alpine.js, and HTMX support.

Maintainers

Package info

github.com/lonnieezell/kindling

pkg:composer/myth/kindling

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0-beta1 2026-05-20 22:40 UTC

This package is auto-updated.

Last update: 2026-05-20 22:42:57 UTC


README

Tests PHP Version License: MIT

A Vite asset pipeline for CodeIgniter 4 — HMR in development, fingerprinted chunk-aware output in production, and zero manual wiring thanks to CI4's auto-discovery.

Full documentation →

What you get

  • One Spark commandkindling:install scaffolds your entire asset setup
  • HMR in development — edit a JS or CSS file and the browser updates instantly, no reload
  • Fingerprinted builds in production — Vite hashes every output file; kindling reads the manifest so your views always reference the right URLs
  • Shared chunk deduplication — if two entry points share a module, the preload tag is emitted once per request
  • Optional integrationsTailwind CSS v4, Alpine.js, and HTMX v2 all opt-in at install time
  • CSP nonce support — pass a nonce to vite_tags() and it's threaded through every emitted <script> tag

Requirements

  • PHP 8.2+
  • CodeIgniter 4.7+
  • Node.js 18+

Installation

composer require myth/kindling

CI4 discovers the package automatically via Composer — no manual registration needed.

Quick start

Scaffold your asset setup with a single command:

php spark kindling:install

The command asks which entry points you want and whether to include Tailwind, Alpine, or HTMX. Pass flags to skip the prompts:

php spark kindling:install --entry=app --tailwind --alpine --no-htmx

Then install npm dependencies and start the dev server:

npm install
npm run dev

Add vite_tags() to your CI4 layout:

<head>
    <?= vite_tags('app') ?>
</head>

That's it. See the Getting Started guide for the full walkthrough.

Optional integrations

Tailwind CSS

Pass --tailwind at install time to include Tailwind CSS v4 via the official Vite plugin. kindling generates a Tailwind-aware vite.config.js and a CSS entry stub with the import already included.

php spark kindling:install --tailwind

Tailwind CSS docs →

Alpine.js

Pass --alpine to include Alpine.js. kindling adds it to package.json and writes the initialization code into your JS entry file.

php spark kindling:install --alpine

Alpine.js docs →

HTMX

Pass --htmx to include HTMX v2. Works great alongside michalsn/codeigniter-htmx for CI4-aware HTMX helpers.

php spark kindling:install --htmx

HTMX docs →

Documentation

Full documentation is at lonnieezell.github.io/kindling.

Contributing

Pull requests are welcome. The project uses Docker for a consistent dev environment.

composer docker:test        # run PHPUnit
composer docker:cs-fix      # fix coding style
composer docker:analyze     # PHPStan + Rector
composer docker:ci          # run all checks
composer docker:shell       # bash inside the container

License

MIT — see LICENSE.