Skip to content

Commit

Permalink
Fix order of preference in addons-registry for the theme (#5649)
Browse files Browse the repository at this point in the history
  • Loading branch information
sneridagh authored Jan 17, 2024
1 parent a45a843 commit 669824b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/registry/news/5649.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix order of preference in addons-registry for the theme definition (THEME, volto.config.js, package.json) @sneridagh
6 changes: 3 additions & 3 deletions packages/registry/src/addon-registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 669824b

Please sign in to comment.