Skip to content

Commit 01c0623

Browse files
authored
Update README.md
1 parent 94932a8 commit 01c0623

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

README.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,37 @@ php please vendor:publish --tag=livewire-forms-config
2828

2929
## Manually bundling Livewire and Alpine
3030

31-
If you are [manually bundling Livewire and Alpine](https://livewire.laravel.com/docs/installation#manually-bundling-livewire-and-alpine), you will also need to import the Livewire Forms script:
31+
If you are [manually bundling Livewire and Alpine](https://livewire.laravel.com/docs/installation#manually-bundling-livewire-and-alpine), you will also need to import the Livewire Forms scripts.
32+
33+
### Full bundle
34+
35+
The `livewire-forms.js` script is the full bundle and contains all the forms logic and external libraries like Filepond.
3236

3337
```diff
3438
import { Livewire, Alpine } from '../../vendor/livewire/livewire/dist/livewire.esm';
3539
import Clipboard from '@ryangjchandler/alpine-clipboard'
36-
+ import "../../vendor/aerni/livewire-forms/resources/js/livewire-forms.js";
40+
+ import "../../vendor/aerni/livewire-forms/resources/dist/js/livewire-forms.js";
3741

3842
Alpine.plugin(Clipboard)
3943

4044
Livewire.start()
4145
```
4246

47+
### Individual imports
48+
49+
If you want more control, you may import individual scripts instead. This can be useful if you don't want to use some of the provided integrations like Filepond. At the bare minimum you should import `form.js`.
50+
51+
```diff
52+
import { Livewire, Alpine } from '../../vendor/livewire/livewire/dist/livewire.esm';
53+
import Clipboard from '@ryangjchandler/alpine-clipboard'
54+
+ import "../../vendor/aerni/livewire-forms/resources/dist/js/form.js";
55+
+ import "../../vendor/aerni/livewire-forms/resources/dist/js/filepond.js";
56+
+ import "../../vendor/aerni/livewire-forms/resources/dist/css/filepond.css";
57+
+ import "../../vendor/aerni/livewire-forms/resources/dist/js/grecaptcha.js";
58+
59+
Livewire.start()
60+
```
61+
4362
Then, add the `{{ livewire:styles }}` and `{{ livewire:scriptConfig }}` tags to your layout:
4463

4564
```html

0 commit comments

Comments
 (0)