5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 04:09:46 +08:00

add warning about dynamic assets and vite v5.0.0+ (#3254)

* add warning about dynamic assets and vite v5.0.0+
This commit is contained in:
Benoit Botton 2024-02-22 07:03:45 +00:00 committed by GitHub
parent 57e6834bd2
commit 8145b0e0c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 0 deletions

View File

@ -1,5 +1,14 @@
# Dynamic Assets
:::info
This does not work with vite v5.0.0+ and wails v2 due to changes in vite.
Changes are planned in v3 to support similar functionality under vite v5.0.0+.
If you need this feature, stay with vite v4.0.0+.
See [issue 3240](https://github.com/wailsapp/wails/issues/3240) for details
:::
If you want to load or generate assets for your frontend dynamically, you can achieve that using the
[AssetsHandler](../reference/options#assetshandler) option. The AssetsHandler is a generic `http.Handler` which will
be called for any non GET request on the assets server and for GET requests which can not be served from the

View File

@ -314,6 +314,15 @@ If not defined, the result is the following in cases where the Handler would hav
- GET request: `http.StatusNotFound`
- Other request: `http.StatusMethodNotAllowed`
:::info
This does not work with vite v5.0.0+ and wails v2 due to changes in vite.
Changes are planned in v3 to support similar functionality under vite v5.0.0+.
If you need this feature, stay with vite v4.0.0+.
See [issue 3240](https://github.com/wailsapp/wails/issues/3240) for details
:::
NOTE: When used in combination with a Frontend DevServer there might be limitations, eg. Vite serves the index.html
on every path, that does not contain a file extension.