Hi @AllanOricil
This might interest you - its a framework that I built to create "Single File Executables"
the READ-ME has all the gory bits.
It basically compiles Node RED with embedded flows/modules to an S.F.E
Not sure it's related  - but maybe useful for you
its based on Node RED v4 + ESBuild + PKG
EDIT
See original post : Node RED v4 : Single File Executable
and lets not forget  @dceejay  also had fun here : GitHub - dceejay/electron-node-red: Electron Node-RED template