I have just checked the GitHub actions logs, the upgrade from webpack 4 to 5 did not really speed up the UI build.
I honestly haven’t checked that closer; but after the first local UI build the following ones should be a bit faster since all dependencies are already installed and shouldn’t have been removed unless you use the clean command with mvn.
In order to speed up the build you probably need to have a look on Vite. It is being said to be faster during development due to different strategy used for code swapping. Disclaimer - I am not a web developer hence I am not sure if it gives any significant boost with web-bundling itself.
I previously rebuilt the bundle jar, install it to my live openhab instance and test my changes that way, but that’s wayyyy too slow.
I have since discovered I could run npm start and it proxies through to my live openhab instance that way, and I get instantaneous update as I changed the source code!
Yes using npm start (see CONTRIBUTING) is definitely the most efficient workflow when doing UI development.
If you just want to build everything for a local build it doesn’t really help. In that case you can also just let Maven download the SNAPSHOT version build by Jenkins.
If you don’t want to depend on the Jenkins build and always want to build it yourself it may be time to get some faster hardware.
Yarn could speed up the depedency installation, but should not improve build times.
As Lukasz said, Vite could improve the build times, it is said to be reallly fast, but since normally only CI does real UI builds and the webpack dev server is also really fast, I don’t see a benefit in using Vite that would convince me in spending my time in changing the build system.