Multiple build
Hi,
Currently I have a SolidStart application with two different builds, one for
SSR
renderer hosted on Vercel and another for Static
renderer to build an app with Capacitor.
I would like to know what would be the best approach through an npm
script to build either application, knowing that I have environment variables that differ.
Should I create two app.config files or pass variables in config?
Thank you in advance for your help, I am not much closer to being able to deploy5 Replies
I‘d probably use variables in the config which you can pass in the build command in package.json
Thanks for a quick response, I prefer this solution, but I don't know how set up this.
When I see the build command in vinxi cli, I find only these options
--config Path to config file (default: app.config.js)
--preset Server preset (default: node-server)
--version Print the versions of Vinxi core dependencies It's possible to do have a solution like
--version Print the versions of Vinxi core dependencies It's possible to do have a solution like
vinxi build --mode app|web
and use it in app.config.ts
?
Or make a reference to env file like .env.app|.env.web
?Yes or simply prepend them to the command like:
You‘ll probably have to install dotenv to have access in app.config.ts
I feel a bit stupid 😅 , I didn't think of this solution at all.
I just tested it, I can access it via
process.env
It‘s just experience 😅