Skip to content

Commit

Permalink
Updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
monster010 committed Oct 2, 2023
1 parent 78a0837 commit f5fa369
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

```
<!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](LICENSE.md).

0 comments on commit f5fa369

Please sign in to comment.