PHPackages                             jricardolima/ci4-lit-rollup - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. jricardolima/ci4-lit-rollup

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jricardolima/ci4-lit-rollup
===========================

Integration between CI4 + LIT + ROLLUP

v0.1.7(8mo ago)311MITPHPPHP &gt;=8.3

Since Dec 17Pushed 8mo agoCompare

[ Source](https://github.com/jRicardoLima/CI4-Rollup-Lit)[ Packagist](https://packagist.org/packages/jricardolima/ci4-lit-rollup)[ RSS](/packages/jricardolima-ci4-lit-rollup/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (1)Versions (9)Used By (0)

CI4 + Lit + Rollup
==================

[](#ci4--lit--rollup)

A clean and opinionated integration of **Lit + Rollup + TypeScript** for **CodeIgniter 4.6+** projects.

This package provides a modern frontend workflow **without introducing SPA complexity**, keeping full control over the build and production output.

---

✨ Features
----------

[](#-features)

- ⚡ Rollup preconfigured out of the box
- 🧩 Lit (Web Components) with TypeScript
- 📦 Automatic manifest generation (cache busting)
- 🛠️ `spark` commands for init, build and dev
- 🧠 Native CI4 helper: `frontend_script()`
- 🚫 No Node.js running in production

---

📦 Installation
--------------

[](#-installation)

Install via Composer and initialize the frontend:

```
composer require jricardolima/ci4-lit-rollup
php spark frontend:init
php spark frontend:install
php spark frontend:build
php spark frontend:dev
```

🤔 **Why not Vite?**

Vite is great — for SPAs.

This package intentionally avoids Vite because:

- Most CI4 projects are server-rendered, not SPAs
- Running a dev server + HMR is unnecessary overhead
- Production does not need Node.js at all
- Rollup gives full control over output structure
- Manifest-based loading is predictable and stable
- Fewer abstractions, fewer surprises

If you need a full SPA, Vite is an excellent choice. If you want modern JavaScript without turning your CI4 app into a SPA, this package is built for you.

📌 **Design philosophy**

- Build happens only in development
- Production serves static assets only
- No framework lock-in
- Explicit over magic

**Ideal for**:

- ERPs
- Internal systems
- CI4-based SaaS
- Projects that want modern frontend without SPA complexity

🧩 **Why Lit?**

Lit is a modern library built on top of **Web Components**, not a framework that replaces the platform.

It was chosen for this package because it is:

- **Standards-based**
    Built directly on Web Components, Custom Elements and Shadow DOM.
- **Lightweight**
    Minimal runtime, fast startup, small bundles.
- **Framework-agnostic**
    Works perfectly with server-rendered applications like CI4.
- **Simple by design**
    Low API surface, easy to reason about, no complex lifecycle.
- **Future-proof**
    Web Components are a browser standard, not a transient abstraction.

Lit allows you to build reusable UI components **without turning your application into a SPA**, making it a natural fit for CodeIgniter-based projects.

🧩 **Enabling the Helper**

After installing and running frontend:init, you must load the helper so CodeIgniter can resolve frontend\_script().

The recommended approach is to load it globally in your BaseController:

```
namespace App\Controllers;

use CodeIgniter\Controller;

class BaseController extends Controller
{
     public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
    {
        // Load here all helpers you want to be available in your controllers that extend BaseController.
        // Caution: Do not put the this below the parent::initController() call below.
        $this->helpers = ['form', 'url','frontend'];

        // Caution: Do not edit this line.
        parent::initController($request, $response, $logger);

        // Preload any models, libraries, etc, here.
        // $this->session = service('session');
    }
}

```

🖼️ **Loading the frontend assets in views**

```

```

✅ Best practice: Place this call in your main layout view (for example app/Views/layouts/default.php), so all child views automatically load the frontend assets.

🔄 Updating
----------

[](#-updating)

After updating the package via Composer:

composer update jricardolima/ci4-lit-rollup

Run the init command again to generate any new files:

php spark frontend:init

⚠️ Existing configuration files will NOT be overwritten. If a new version introduces changes to configs or scripts, please check the CHANGELOG for manual steps.

📄 **License**

MIT

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance62

Regular maintenance activity

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

8

Last Release

241d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f7b4a74b0f9a8b422f40304d9ca7fea5e1a5102a1f2a440706b7e96cab93a3a3?d=identicon)[jricardo\_lima](/maintainers/jricardo_lima)

---

Top Contributors

[![jRicardoLima](https://avatars.githubusercontent.com/u/26034469?v=4)](https://github.com/jRicardoLima "jRicardoLima (10 commits)")

### Embed Badge

![Health badge](/badges/jricardolima-ci4-lit-rollup/health.svg)

```
[![Health](https://phpackages.com/badges/jricardolima-ci4-lit-rollup/health.svg)](https://phpackages.com/packages/jricardolima-ci4-lit-rollup)
```

###  Alternatives

[codeigniter4/appstarter

CodeIgniter4 starter app

1811.8M](/packages/codeigniter4-appstarter)[abydahana/aksara

Aksara is a modern, developer-friendly framework and CMS built on CodeIgniter 4, featuring rapid CRUD development, modular architecture, smart routing, flexible access control, API integration, and an AI assistant to make content management faster and smarter.

1141.2k](/packages/abydahana-aksara)[hermawan/codeigniter4-datatables

Serverside Datatables library for CodeIgniter4

10949.8k4](/packages/hermawan-codeigniter4-datatables)[jason-napolitano/codeigniter4-cart-module

A basic port of the codeigniter 3 cart module for CodeIgniter 4.

5915.6k](/packages/jason-napolitano-codeigniter4-cart-module)[maniaba/asset-connect

AssetConnect is a file management library for CodeIgniter 4 that allows you to associate files with any entity in your application

1016.0k](/packages/maniaba-asset-connect)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
