diff --git a/packages/registry/news/5649.bugfix b/packages/registry/news/5649.bugfix new file mode 100644 index 0000000000..ee865ea482 --- /dev/null +++ b/packages/registry/news/5649.bugfix @@ -0,0 +1 @@ +Fix order of preference in addons-registry for the theme definition (THEME, volto.config.js, package.json) @sneridagh diff --git a/packages/registry/src/addon-registry.js b/packages/registry/src/addon-registry.js index 6e0013798b..a2c44e9f0d 100644 --- a/packages/registry/src/addon-registry.js +++ b/packages/registry/src/addon-registry.js @@ -128,10 +128,10 @@ class AddonConfigurationRegistry { this.packages = {}; this.customizations = new Map(); - // Theme from a package.json key, from volto.config.js or from an ENV VAR - // Programatically via volto.config.js wins or the ENV VAR if present + // Theme from an ENV VAR, from volto.config.js or from a package.json key + // in this order of preference this.theme = - packageJson.theme || this.voltoConfigJS.theme || process.env.THEME; + process.env.THEME || this.voltoConfigJS.theme || packageJson.theme; this.initDevelopmentPackages(); this.initPublishedPackages();