From f5fa369c304cb6c738e90deaf28e654655ab1fd8 Mon Sep 17 00:00:00 2001 From: monster010 Date: Mon, 2 Oct 2023 18:08:45 +0200 Subject: [PATCH] Updated README.md --- README.md | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/README.md b/README.md index bac89e4..dcf8405 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,65 @@ This plugin configures Vite for use with a CodeIgniter backend server. This plugin is based on the [Laravel Vite plugin](https://github.com/laravel/vite-plugin). +## Installation + +Install with composer: + +```shell +composer require monster010/codeigniter-vite-plugin +``` + +Publish default resources (package.json, vite.config.js, tailwind.config.js, etc.) + +```shell +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 + +``` + + + {{-- ... --}} + + + +``` + +Alternative: + +``` + + + {{-- ... --}} + + + +``` + ## License The CodeIgniter Vite plugin is open-sourced software licensed under the [MIT license](LICENSE.md).