定制 mressex/cubex-vite-plugin 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mressex/cubex-vite-plugin

最新稳定版本:0.0.10

Composer 安装命令:

composer require mressex/cubex-vite-plugin

包简介

Cubex Plugin for Vite

README 文档

README

Introduction

Vite is a modern frontend tool that delivers an extremely fast development experience. It includes features like lightning-fast cold server start, instant hot module replacement, and optimized builds for production.

This plugin integrates Vite into Cubex to provide a seamless development experience.

This project is a modified version of the CodeIgniter Vite Plugin which in turn is based on the Laravel Vite Plugin

Installation

Install with composer:

composer require mressex/cubex-vite-plugin

Create a vite.config.js file in the root of your project:

// vite.config.js
import { defineConfig } from 'vite';
import cubex from "cubex-vite-plugin";

export default defineConfig({
    plugins: [
        cubex([
            'assets/scss/index.scss',
            'assets/ts/index.ts',
        ]),
    ],
});

Getting Started

  • Install your node dependencies: npm install
  • Start vite server: npm run dev

Add to the Cubex DI, also requires Dispatch to be setup

$cubex->share(Vite::class, $cubex->resolve(Vite::class, $ctx->getProjectRoot()));

Loading Your Scripts and Styles

Register and css or ts files in the vite.config.js file. The plugin will automatically load the files in the development environment and use the production build in the production environment.

pass true if you want to include the Vite client for Hot Mode Reloading

protected function _registerResources(Vite $vite): void
  {
    $vite(['assets/scss/index.scss', 'assets/ts/index.ts'], true);
  }

统计信息

  • 总下载量: 53
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: TypeScript

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-01-31