S
SolidJS3mo ago
cdegrel

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 deploy
5 Replies
Madaxen86
Madaxen863mo ago
I‘d probably use variables in the config which you can pass in the build command in package.json
cdegrel
cdegrelOP3mo ago
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 vinxi build --mode app|web and use it in app.config.ts ? Or make a reference to env file like .env.app|.env.web?
Madaxen86
Madaxen863mo ago
Yes or simply prepend them to the command like:
"build:app" : "MODE=app vinxi build",

"build:web" : "MODE=web vinxi build",
"build:app" : "MODE=app vinxi build",

"build:web" : "MODE=web vinxi build",
You‘ll probably have to install dotenv to have access in app.config.ts
cdegrel
cdegrelOP3mo ago
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
Madaxen86
Madaxen863mo ago
It‘s just experience 😅
Want results from more Discord servers?
Add your server