Download the PHP package nongbit/codeigniter-vite without Composer
On this page you can find all versions of the php package nongbit/codeigniter-vite. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nongbit/codeigniter-vite
More information about nongbit/codeigniter-vite
Files in nongbit/codeigniter-vite
Package codeigniter-vite
Short Description Vite integration for CodeIgniter 4 with multi‑entry support.
License MIT
Informations about the package codeigniter-vite
CodeIgniter 4 Vite
Vite integration for CodeIgniter 4 with multi‑entry point support.
Requirements
- PHP 7.4 or 8.0+
- CodeIgniter 4.4+
- Composer
- Node.js 18+ and npm
Installation
Setup
1. Run setup command
Use --force to overwrite existing files.
This copies:
app/Config/Vite.phppackage.jsonandvite.config.jsto your project root- Example assets to
app/Views/assets/js/app.jsandapp/Views/assets/css/app.css
2. Install Node dependencies
3. Start Vite dev server
Usage
In your view, simply call:
This uses the default entry point (configured as defaultEntry in app/Config/Vite.php, which defaults to app).
For other entry points:
- If the Vite dev server is running, it outputs hot-reload tags.
- Otherwise, it looks for the production manifest (supports Vite 4 & 5 manifest locations). If found, it outputs the bundled
<script>and<link>tags. If no manifest is found, it outputs nothing (safe for production).
Multi‑entry points
Add a new entry point (e.g., for admin section):
Use --force to overwrite existing assets for that entry.
Each entry point will have its own assets in app/Views/{entry}/assets/.
Configuration
Edit app/Config/Vite.php:
publicPath: Absolute path to the public directory (defaultFCPATH). Usually correct.buildDirectory: Subdirectory insidepublicPathwhere Vite builds assets. Empty means directly insidepublic/. Set todistif your ViteoutDirispublic/dist.devServerUrl: Manual Vite dev server URL. Leave empty for auto-detection onhttp://localhost:5173. Useful for Docker (http://host.docker.internal:5173) or custom setups.defaultEntry: Name of the default entry point used when callingvite()without arguments.
Production
The helper will automatically switch to using the production manifest.
BONUS (using Tailwind CSS)
Install tailwindcss and @tailwindcss/vite via npm.
Then add the @tailwindcss/vite plugin to your Vite configuration.
Add an @import to your app.css.
License
MIT