You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 27, 2025. It is now read-only.
Make sure to read the Livewire upgarde guide, in case you're updating to `Statamic Livewire` 3, as there are breaking changes:
26
-
https://livewire.laravel.com/docs/upgrading
23
+
### Manually including Livewire's frontend assets
24
+
By default, Livewire injects the JavaScript and CSS assets it needs into each page that includes a Livewire component. If you want more control over this behavior, you can [manually include the assets](https://livewire.laravel.com/docs/installation#manually-including-livewires-frontend-assets) on a page using the following Antlers tags or Blade directives:
Livewire injects its styles and scripts automatically into the page. However, this does not work if caching is enabled (`half`/`full`). In that case, you want to include them [manually](https://livewire.laravel.com/docs/installation#manually-including-livewires-frontend-assets), by using the respective tags `{{ livewire:styles }}` and`{{ livewire:scripts }}`.
26
+
```html
27
+
<html>
28
+
<head>
29
+
<!-- If using Antlers -->
30
+
{{ livewire:styles }}
31
+
32
+
<!-- If using Blade -->
33
+
@livewireStyles
34
+
</head>
35
+
<body>
36
+
37
+
...
38
+
<!-- If using Antlers -->
39
+
{{ livewire:scripts }}
40
+
41
+
<!-- Blade -->
42
+
@livewireScripts
43
+
</body>
44
+
</html>
45
+
```
34
46
35
-
In case you need to include some custom Alpine plugins, you can [bundle the assets yourself](https://livewire.laravel.com/docs/installation#manually-bundling-livewire-and-alpine) and disable the automatic injection by using the `{{ livewire:scriptConfig }}` tag. Do not forget to include the `{{ livewire:styles }}` tag as well.
47
+
### Manually bundling Livewire and Alpine
48
+
If you need to include some custom Alpine plugins, you need to [manually bundle the Livewire and Alpine assets](https://livewire.laravel.com/docs/installation#manually-bundling-livewire-and-alpine) and disable the automatic injection by using the following Antlers tag or Blade directive. Do not forget to include the Livewire styles as well.
36
49
37
50
```html
38
51
<html>
@@ -47,14 +60,31 @@ In case you need to include some custom Alpine plugins, you can [bundle the asse
This addon adds an `AssetsReplacer` class to make Livewire compatible with half and full static caching. You may customize the replacers in the config of this addon:
0 commit comments