Skip to content

Commit

Permalink
add warning about dynamic assets and vite v5.0.0+ (wailsapp#3254)
Browse files Browse the repository at this point in the history
* add warning about dynamic assets and vite v5.0.0+
  • Loading branch information
BenoitBotton authored Feb 22, 2024
1 parent 57e6834 commit 8145b0e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions website/docs/guides/dynamic-assets.mdx
Original file line number Diff line number Diff line change
@@ -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
Expand Down
9 changes: 9 additions & 0 deletions website/docs/reference/options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit 8145b0e

Please sign in to comment.