PWA toolkit environment variables


In the pwa toolkit, is there something similar to the angular environment variables? I would like to use a different url for a server in development and in production

Anyone achieved that or could point me to an example?


Not sure it works if I would use SSR but I did the following.

In stencil.config.ts I provided a different globalScript according prod or dev

let globalScript: string = 'src/global/app.ts';

const dev: boolean = process.argv && process.argv.indexOf('--dev') > -1;
if (dev) {
    globalScript = 'src/global/app-dev.ts';

export const config: Config = {
    globalScript: globalScript,

then, for the app itself, I had a look at the Ionic core code and I basically did the same :wink: See setupConfig as start point