nongbit/codeigniter-vite
最新稳定版本:1.0.2
Composer 安装命令:
composer require nongbit/codeigniter-vite
包简介
Integrate Vite to CodeIgniter 4
关键字:
README 文档
README
Integrate Vite to CodeIgniter 4.
Setup
Download package using composer.
composer require nongbit/codeigniter-vite
Run command to initiate vite.
php spark vite:init
Create and open APPPATH/Config/Vite.php.
<?php namespace Config; use CodeIgniter\Config\BaseConfig; class Vite extends BaseConfig { public array $entryPoints = [ '' => 'app/Views/assets/js/app.js', ]; }
Usage
Inside your view, call vite_url().
If the vite server is active then vite_url() will produce code like the following.
<script type="module" src="http://localhost:5173/app/Views/assets/js/app.js"></script>
If manifest.json is found then vite_url() will read the file and generate the appropriate html code, something like this:
<link rel="stylesheet" href="http://localhost/assets/app.css"> <script type="module" src="http://localhost/assets/app.js">
统计信息
- 总下载量: 109
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-01-05