Document the ViteBundler feature (#209)

* Document the ViteBundler feature

* Fix formatting

* Remove Vite integration page, make links to the integration page link to the feature page

* Add example for enabling the feature

* improve writing

Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
This commit is contained in:
lukinovec 2022-10-04 19:49:49 +02:00 committed by GitHub
parent 5f9f141580
commit 31a64ab28f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 0 deletions

View file

@ -156,6 +156,7 @@ return [
'Tenant Config' => 'features/tenant-config', 'Tenant Config' => 'features/tenant-config',
'Cross-domain redirect' => 'features/cross-domain-redirect', 'Cross-domain redirect' => 'features/cross-domain-redirect',
'Universal routes' => 'features/universal-routes', 'Universal routes' => 'features/universal-routes',
'Vite bundler' => 'features/vite-bundler',
], ],
], ],
], ],
@ -207,6 +208,7 @@ return [
'Livewire' => 'integrations/livewire', 'Livewire' => 'integrations/livewire',
'Orchid' => 'integrations/orchid', 'Orchid' => 'integrations/orchid',
'Sanctum' => 'integrations/sanctum', 'Sanctum' => 'integrations/sanctum',
'Vite' => 'features/vite-bundler',
], ],
], ],
'Console commands' => 'console-commands', 'Console commands' => 'console-commands',

View file

@ -0,0 +1,18 @@
---
title: Vite bundler
extends: _layouts.documentation
section: content
---
# Vite bundler {#vite-bundler}
Enabling the `ViteBundler` feature makes Vite generate correct asset paths by using the `global_asset()` helper instead of the default `asset()` helper.
To enable the feature, uncomment `Stancl\Tenancy\Features\ViteBundler::class` in the `features` section of the tenancy config:
```php
'features' => [
// [...]
Stancl\Tenancy\Features\ViteBundler::class,
],
```

View file

@ -16,3 +16,4 @@ If you're using the [automatic mode]({{ $page->link('automatic-mode') }}) & [mul
- [Laravel Telescope]({{ $page->link('integrations/telescope') }}) - [Laravel Telescope]({{ $page->link('integrations/telescope') }})
- [Livewire]({{ $page->link('integrations/livewire') }}) - [Livewire]({{ $page->link('integrations/livewire') }})
- [Laravel Sanctum]({{ $page->link('integrations/sanctum') }}) - [Laravel Sanctum]({{ $page->link('integrations/sanctum') }})
- [Vite]({{ $page->link('features/vite-bundler') }})

View file

@ -13,6 +13,8 @@ section: content
- [`TenantConfig`]({{ $page->link('features/tenant-config') }}) for mapping keys from the tenant storage into the application config - [`TenantConfig`]({{ $page->link('features/tenant-config') }}) for mapping keys from the tenant storage into the application config
- [`CrossDomainRedirect`]({{ $page->link('features/cross-domain-redirect') }}) for adding a `domain()` macro on `RedirectResponse` letting you change the intended hostname of the generated route - [`CrossDomainRedirect`]({{ $page->link('features/cross-domain-redirect') }}) for adding a `domain()` macro on `RedirectResponse` letting you change the intended hostname of the generated route
- [`UniversalRoutes`]({{ $page->link('features/universal-routes') }}) for route actions that work in both the central & tenant context - [`UniversalRoutes`]({{ $page->link('features/universal-routes') }}) for route actions that work in both the central & tenant context
- [`ViteBundler`]({{ $page->link('features/vite-bundler') }}) for making Vite generate the correct asset paths
All of the package's Features are in the `Stancl\Tenancy\Features` namespace. All of the package's Features are in the `Stancl\Tenancy\Features` namespace.
You may register features by adding their class names to the `tenancy.features` config. You may register features by adding their class names to the `tenancy.features` config.