arbims/vite-plugin
最新稳定版本:v1.0.5
Composer 安装命令:
composer require arbims/vite-plugin
包简介
VitePlugin plugin for CakePHP
README 文档
README
Installation
You can install this plugin into your CakePHP application using composer.
The recommended way to install composer packages is:
composer require arbims/vite-plugin
Load the plugin in your Application.php:
bin/cake plugin load VitePlugin
Load the Helper in your AppView.php:
$this->loadHelper('VitePlugin.Vite');
add config Vite environment in /config/bootstrap.php
Configure::write('IS_DEV', true);
Usage
run this command
if you want use vue replace react with vue or preact
bin/cake vite_plugin react
In your php-layout, include this in your html head:
<?= $this->Vite->assets('js/main.jsx', \Cake\Core\Configure::read('IS_DEV'), 'react') ?>
if want to use vue
<?= $this->Vite->assets('js/main.js', \Cake\Core\Configure::read('IS_DEV')) ?>
then run
npm install
npm install -D sass
npm run dev
wee nedd change IS_DEV variable false if we are in production.
Configure::write('IS_DEV', false);
then run
npm run build
统计信息
- 总下载量: 371
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-09-07