Select to view content in your preferred language

Separate the config modification from app download into a independently used function/capability

216
0
03-07-2025 06:34 PM
Status: Open
Labels (3)
RyanTaylor
Occasional Contributor

Per Esri documentation you can provide a JavaScript object as the 4th parameter to the zipApp function to modify the config.json included with the downloaded zip.

RyanTaylor_0-1741382345304.jpeg

However, in our case we need to create multiple configurations for the same application as it is promoted through different environments via our DevOps workflow. That is, upon release, we need to create configuration for our acceptance **and** production environments **without** rebuilding the application code.

It would be helpful if the app-download.js exported a `createConfig` function that when passed a filename, and a configModifier would write the modified configuration to a new file in a similar to the zipApp function. However, this would allow us to skip building the app and downloading a new bundle.

Example: 

 

 

createConfig({ filename: "config.acceptance.json", configModifier: { 'attributes.portalUrl': 'new-portal-url' }})

 

 

This would provide more flexibility for DevOps flows. Upon our releases we could rebuild the application once and create as many configs as necessary for our various environments without duplicating the rather large application zip.