myth/kindling
Composer 安装命令:
composer require myth/kindling
包简介
A first-class Vite asset pipeline for CodeIgniter 4, with optional Tailwind CSS, Alpine.js, and HTMX support.
README 文档
README
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.
What you get
- One Spark command —
kindling:installscaffolds 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 integrations — Tailwind 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
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
HTMX
Pass --htmx to include HTMX v2. Works great alongside michalsn/codeigniter-htmx for CI4-aware HTMX helpers.
php spark kindling:install --htmx
Documentation
Full documentation is at lonnieezell.github.io/kindling.
- Getting Started — working in under 5 minutes
- Vite Fundamentals — new to Vite? Start here
- Configuration — every config option explained
- Using in Views — the
vite_tags()helper and nonce support
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.
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-05-20