Support pre-build hook with wails dev & wails build #1577
Labels
awaiting feedback
More information is required from the requestor
Ready For Testing
A fix is available and needs testing
Milestone
Is your feature request related to a problem? Please describe.
The problem is that my team already has built our front-end assets, and we just need to include it in our desktop app (https://github.com/ipfs/ipfs-desktop).
You can see in the README of https://github.com/SgtPooki/ipfs-desktop-wails, that we don't need a front-end command to run at all, but we do need a command to run to get our prebuilt frontend (see https://github.com/SgtPooki/ipfs-desktop-wails#run-a-local-version).
Since we need to get these front-end assets between
wails dev
andwails generate module
, we get errors unless we run an explicit command prior to runningwails
. I believe it would be wise for wails to offer a solution for the multitude of usecases a preBuildHook could support.Describe the solution you'd like
wails.json
already haspostBuildHooks
, I would like to proposepreBuildHooks
. Essentially an agnostic version of "frontend:*" though not necessarily a replacement.For my issue, I would only need to run
./get-webui.sh
in the preBuildHook:wails.json
Describe alternatives you've considered
The only two solutions I could think of that allow us to fully bundle our webui in the app (obtaining via runtime is not a viable solution) are:
get-webui.sh
shell script prior to running wails command./frontend/get-webui.sh
and set"frontend:build": "bash ./get-webui.sh",
inwails.json
Solution 1
This works, and is okay, but definitely not ideal, requires build cmd to be:
at least on the first run.
Solution 2
This is currently what I'm using as it's the desired DX I want. See SgtPooki/ipfs-desktop-wails@fab2491
but allows us to have a single canonical wails build command:
wails build # or wails dev
Some issues with this solution that others may run into
With no
./frontend
folder:with existing
./frontend/.gitkeep
With empty
./frontend/index.html
This allows things to work, but I don't like the idea that wails could be modifying/hooking into a file that will be overwritten.
Additional context
No response
The text was updated successfully, but these errors were encountered: