0.0.7 • Published 2 months ago

codeigniter-vite-plugin v0.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

CodeIgniter Vite Plugin

Introduction

Vite is a modern frontend build tool that provides an extremely fast development environment and bundles your code for production.

This plugin configures Vite for use with a CodeIgniter backend server.

This plugin is based on the Laravel Vite plugin.

Installation

Install with composer:

composer require monster010/codeigniter-vite-plugin

Publish default resources (package.json, vite.config.js, tailwind.config.js, etc.)

php spark vite:publish

Alternative:

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

export default defineConfig({
    plugins: [
        codeigniter([
            'resources/css/app.css',
            'resources/js/app.js',
        ]),
    ],
});

Getting Started

  • Install your node dependencies: npm install
  • Start vite server: npm run dev
  • Loading helper helper('vite')

Loading Your Scripts and Styles

<!doctype html>
<head>
    {{-- ... --}}

    <?= vite_tags(['resources/css/app.css', 'resources/js/app.js']) ?>
</head>

Alternative:

<!doctype html>
<head>
    {{-- ... --}}

    <?= vite_tags('resources/js/app.js') ?>
</head>

License

The CodeIgniter Vite plugin is open-sourced software licensed under the MIT license.

0.0.7

2 months ago

0.0.5

7 months ago

0.0.4

7 months ago

0.0.2

7 months ago

0.0.1

7 months ago