BuilderIO / partytown

Relocate resource intensive third-party scripts off of the main thread and into a web worker. 🎉
https://partytown.builder.io
MIT License
12.97k stars 427 forks source link

Pass environment to partytown `resolveUrl` config to make multiple env reverse proxy #310

Open harrytran998 opened 1 year ago

harrytran998 commented 1 year ago

Is your feature request related to a problem? Please describe. When we config resolveUrl(url) to make some reverse proxy. Bcs we have a lot of environment, EX: In UAT(user acceptant test) env, we want the reverse proxy server to be A. But in production, it might become B.

But we cannot pass the environment outside into resolveUrl()

Describe the solution you'd like Maybe pass the ENV in the partytown config. Then use callback in the top config like

partytow =  {
    debug: env.dev === 'true',
    env: ENV,
    resolveUrl(url, config) {
        const env = config.env;
    }
}
nandazman commented 9 months ago

any update on this ?