There's a tricky import resolution order problem which makes an addon's applyConfig function unable to see any values that are set in a project config.js.
We have the following import order:
Something (it doesn't matter what) in Volto needs stuff that is exported from ~/config.js
in ~/config.js, first thing we do is import * as voltoConfig from @plone/volto
In @plone/volto/config/index.js, we do "applyConfigurationFromAllAddons(configObject)" (pseudocode)
so now an addon's applyConfig runs, but it's missing stuff from '~/config' that will be added later in the code.
Some possible solutions:
addons can use process RAZZLE_* environment variables to configure themselves. This is not always possible, for complex settings.
introduce another config file in Volto projects? Something like ~/addons-config.js?. It doesn't need to be included by Volto in any way, only recommended to addon authors, to be used, and to be documented by addons as needed.
There's a tricky import resolution order problem which makes an addon's applyConfig function unable to see any values that are set in a project config.js.
We have the following import order:
~/config.js
~/config.js
, first thing we do isimport * as voltoConfig from @plone/volto
@plone/volto/config/index.js
, we do "applyConfigurationFromAllAddons(configObject)" (pseudocode)Some possible solutions:
RAZZLE_*
environment variables to configure themselves. This is not always possible, for complex settings.~/addons-config.js
?. It doesn't need to be included by Volto in any way, only recommended to addon authors, to be used, and to be documented by addons as needed.Any other ideas?