Skip to content

Commit f5fa369

Browse files
committed
Updated README.md
1 parent 78a0837 commit f5fa369

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

README.md

+59
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,65 @@ This plugin configures Vite for use with a CodeIgniter backend server.
1313

1414
This plugin is based on the [Laravel Vite plugin](https://github.com/laravel/vite-plugin).
1515

16+
## Installation
17+
18+
Install with composer:
19+
20+
```shell
21+
composer require monster010/codeigniter-vite-plugin
22+
```
23+
24+
Publish default resources (package.json, vite.config.js, tailwind.config.js, etc.)
25+
26+
```shell
27+
php spark vite:publish
28+
```
29+
30+
Alternative:
31+
32+
```
33+
// vite.config.js
34+
import { defineConfig } from 'vite';
35+
import codeigniter from "codeigniter-vite-plugin";
36+
37+
export default defineConfig({
38+
plugins: [
39+
codeigniter([
40+
'resources/css/app.css',
41+
'resources/js/app.js',
42+
]),
43+
],
44+
});
45+
```
46+
47+
## Getting Started
48+
49+
- Install your node dependencies: `npm install`
50+
- Start vite server: `npm run dev`
51+
- Loading helper `helper('vite')`
52+
53+
### Loading Your Scripts and Styles
54+
55+
```
56+
<!doctype html>
57+
<head>
58+
{{-- ... --}}
59+
60+
<?= vite_tags(['resources/css/app.css', 'resources/js/app.js']) ?>
61+
</head>
62+
```
63+
64+
Alternative:
65+
66+
```
67+
<!doctype html>
68+
<head>
69+
{{-- ... --}}
70+
71+
<?= vite_tags('resources/js/app.js') ?>
72+
</head>
73+
```
74+
1675
## License
1776

1877
The CodeIgniter Vite plugin is open-sourced software licensed under the [MIT license](LICENSE.md).

0 commit comments

Comments
 (0)