-
-
Notifications
You must be signed in to change notification settings - Fork 41
Description
The SPA deployment guide, as described here is incomplete:
The following note mentions, that when using the --minify option, links need to be updated:
Note: when using the --minify flag in the build command, we need to update the <script> tag in index.html to point to the minified file. This would be /priv/static/app.min.mjs instead of /priv/static/app.mjs. In the GitHub Action workflows below we have automated this step with a sed-command. We’ve assumed that your app is called app, so if your app has a different name you need to update the command accordingly.
In my tests, running gleam run -m lustre/dev build app --minify does NOT result in an app.min.js, but rather a app.js (still minified). Thus this note should just be removed.
The guide mentions the problems with deploying to a subdirectory in GitHub Pages (https://<username>.github.io/<repository>) although it does not provide an example of how to apply the described fixes in a GitHub Action
When trying to apply the fixes mentioned in 2) manually (updating the script and css tag in the generated .html), the loading of dynamic content (such as images) still resolve to the root domain, instead of the subdirectory. It would be nice if there was a build option to specify that.