I would like to write some custom parameters to .unoproj and read them in my application, when it’s launched. Reading would happen preferable with JS. This would allow me to create several .unoproj files with different configuration and therefor create several different apps from my code base.
Is this already possible? And if not, could it be added?
Other way to do this would allow adding a filename to Includes. This would take the file from configs folder and store it as Config.js and it could be accessed in JS with just require(“Config.js”)
… or something, you know what’s best. Anyway this is a feature I would really like to have.
This sounds like something you can achieve using a preprocess step before building your Uno project.
So you can use your Uno project as usual:
And for instance use a build/configure script to create Config.js before triggering a build:
if [ "$IS_BOBBY" ]; then
cp config/ConfigBobby.js Config.js
cp config/ConfigDefault.js Config.js
fuse build ...
In the future we might implement script hooks (pre/post-build steps) in Uno projects to support things like this better.
Thanks dude, the config copy before build sounds just fine to me.